pub fn growing_random_game(
n: u32,
m: u32,
directed: bool,
citation: bool,
seed: u64,
) -> IgraphResult<Graph>Expand description
Generate a growing random graph on n vertices, adding m new
edges per step.
n— vertex count.n = 0returns an empty graph;n = 1returns a single isolated vertex.m— number of new edges contributed per added vertex.m = 0yieldsnisolated vertices.directed— generate a directed graph.citation— iftrue, every new edge originates at the freshly-added vertex; iffalse, both endpoints are uniformly sampled within the current frontier.seed— initialises an internalSplitMix64PRNG. Same(n, m, directed, citation, seed)always yields the same graph.
§Errors
Returns IgraphError::Internal if (n - 1) · m overflows u64
(only possible at (u32::MAX, u32::MAX) scale).
§Examples
use rust_igraph::growing_random_game;
// 50-vertex directed citation graph with 2 new edges per step.
// Exactly (n - 1) · m = 49 · 2 = 98 edges.
let g = growing_random_game(50, 2, true, true, 0xCAFE).unwrap();
assert_eq!(g.vcount(), 50);
assert_eq!(g.ecount(), 98);
assert!(g.is_directed());