Skip to contents

Create a full graph

Usage

make_full_graph(n, directed = FALSE, loops = FALSE)

full_graph(...)

Arguments

n

Number of vertices.

directed

Whether to create a directed graph.

loops

Whether to add self-loops to the graph.

...

Passed to make_full_graph().

Value

An igraph graph

Examples

make_full_graph(5)
#> IGRAPH 0e3c5fb U--- 5 10 -- Full graph
#> + attr: name (g/c), loops (g/l)
#> + edges from 0e3c5fb:
#>  [1] 1--2 1--3 1--4 1--5 2--3 2--4 2--5 3--4 3--5 4--5
print_all(make_full_graph(4, directed = TRUE))
#> IGRAPH 8862f45 D--- 4 12 -- Full graph
#> + attr: name (g/c), loops (g/l)
#> + graph attributes:
#> | + name:
#> |   [1] "Full graph"
#> | + loops:
#> |   [1] FALSE
#> + edges:
#> 1 -> 2 3 4   2 -> 1 3 4   3 -> 1 2 4   4 -> 1 2 3