Expand description
Forest fire random-graph generator (ALGO-GN-006).
Counterpart of igraph_forest_fire_game() in
references/igraph/src/games/forestfire.c:106-257.
§Model
Leskovec–Kleinberg–Faloutsos (KDD’05). Nodes are added one at a
time. Each new node v:
- picks
ambsambassador vertices uniformly at random from the already-present nodes and cites each of them; - for every ambassador
a, drawsx ~ Geom(1 − p)outgoing andy ~ Geom(1 − r·p)incoming neighbours ofa(wherepis the forward burning probability andrthe backward factor), cites those still-unvisited neighbours, and pushes them onto the burn queue; - the burn continues breadth-first until the queue empties.
The corrected variant from
https://www.cs.cmu.edu/~jure/pubs/powergrowth-tkdd.pdf is the one
mirrored here — the published paper algorithm uses
mean = p/(1−p) which igraph corrects to a single geometric draw.
§Validation
fw_prob ∈ [0, 1)— strict upper bound so the geometric draw is finite (geometric mean isp/(1−p)).bw_factor · fw_prob ∈ [0, 1)— same guard for the incoming draw.ambs ≥ 0.ambs = 0returns an edgeless graph ofnisolated vertices, matching upstream.
§Algorithm cost
Asymptotic cost is hard to pin down because the burn radius depends
on the in/out-neighbourhood sizes built up so far. In the sparse
regime (p away from 1) the expected work per new node is bounded
by the geometric tail, giving roughly O(n / (1 − p)²) overall.
Memory is O(n + |E|): two per-vertex Vec<u32> adjacency arrays
plus the edge buffer.
§Determinism
Fully deterministic in (n, fw_prob, bw_factor, ambs, directed, seed) via SplitMix64.
Functions§
- forest_
fire_ game - Generate a forest-fire-model random graph on
nvertices.