pub fn edgelist_percolation(
edges: &[(VertexId, VertexId)],
) -> IgraphResult<EdgelistPercolation>Expand description
Percolation curve as a sequence of vertex-pair edges is added.
Returns an EdgelistPercolation with two vectors, both of
length edges.len():
giant_size[i]: size of the largest component after edgeiis added (1 if no edges or the first edge connects two new vertices).vertex_count[i]: number of distinct vertices touched by any edge in0..=i.
Vertex ids are inferred from the edge list — the implicit vertex
count is max(max(u, v) for (u, v) in edges) + 1. Endpoints may
be self-loops (a self-loop adds nothing to either output).
Returns IgraphError::InvalidArgument if any vertex id exceeds
i32::MAX (matches upstream’s IGRAPH_EINVVID semantics).
Counterpart of igraph_edgelist_percolation from
references/igraph/src/connectivity/percolation.c:105.
§Examples
use rust_igraph::edgelist_percolation;
// Adding edges (0-1), (2-3), (1-2): the giant grows 2, 2, 4.
let edges = [(0u32, 1u32), (2, 3), (1, 2)];
let p = edgelist_percolation(&edges).unwrap();
assert_eq!(p.giant_size, vec![2, 2, 4]);
assert_eq!(p.vertex_count, vec![2, 4, 4]);