UndiGraph.completeGraph
- static UndiGraph.completeGraph(n)
Create a complete undirected graph with n nodes.
- Parameters:
n (
int) – number of nodes- Returns:
graph where every pair of distinct nodes is connected by an edge, with nodes 0..n-1
- Return type:
Example
import pyagrum as gum
g = gum.UndiGraph.completeGraph(3)
g.nodes()
# {0, 1, 2}
sorted(g.edges())
# [(0, 1), (0, 2), (1, 2)]
Used by
UndiGraph, ChainGraph, CliqueGraph, MixedGraph, PDAG
