Expand description
Full graph (complete graph) constructor (ALGO-CN-014).
Counterpart of igraph_full() in
references/igraph/src/constructors/full.c:54-124.
In a full graph every possible edge is present: every vertex is connected to every other vertex. The two boolean flags shape the ecount:
| directed | loops | ecount | emission pattern |
|---|---|---|---|
| false | false | n·(n−1)/2 | (i, j) for every 0 ≤ i < j < n |
| false | true | n·(n+1)/2 | (i, j) for every 0 ≤ i ≤ j < n |
| true | false | n·(n−1) | (i, j) for every i ≠ j |
| true | true | n² | (i, j) for every 0 ≤ i, j < n |
Emission order matches upstream byte-for-byte (source-major,
target-ascending; for the directed && !loops case the inner loop
walks j ∈ [0, i) first then j ∈ (i, n)).
Time complexity: O(|V|^2) = O(|E|).
Degenerate inputs:
n == 0→ empty graph (vcount = 0, ecount = 0).n == 1 ∧ loops == false→ singleton, no edges.n == 1 ∧ loops == true→ singleton with a single self-loop(0, 0).
Functions§
- full_
graph - Build the full (complete) graph on
nvertices.