Skip to contents

The hypercube graph Q_n has 2^n vertices and 2^(n-1) n edges.

Usage

graph_hypercube(n, directed = FALSE)

Arguments

n

The dimension of the hypercube graph.

directed

A logical value, whether to consider directed paths. Ignored for undirected graphs.

Value

An igraph_ptr object.

Examples

graph_hypercube(3L)
#> $V  tibble [8 × 0] (S3: tbl_df/tbl/data.frame)
#>  Named list()
#> # A tibble: 12 × 2
#>     from    to
#>    <int> <int>
#>  1     2     1
#>  2     3     1
#>  3     5     1
#>  4     4     2
#>  5     6     2
#>  6     4     3
#>  7     7     3
#>  8     8     4
#>  9     6     5
#> 10     7     5
#> 11     8     6
#> 12     8     7