Skip to contents

In a full graph, every vertex is connected to every other vertex.

Usage

graph_full(n, directed = FALSE, self_loops = FALSE)

Arguments

n

An integer value, the number of vertices.

directed

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

self_loops

A logical value, whether to include self-loops.

Value

An igraph_ptr object.

See also

Other deterministic generators: graph_create(), graph_empty(), graph_famous(), graph_kary_tree(), graph_square_lattice(), graph_star()

Examples

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