Skip to main content

Module spanning

Module spanning 

Source
Expand description

Spanning-tree algorithms (ALGO-MST-, ALGO-RST-).

Mirrors the upstream igraph C file references/igraph/src/misc/spanning_trees.c which groups the deterministic minimum-spanning-tree variants (BFS-unweighted, Prim, Kruskal, automatic dispatch) and the loop-erased random-walk (LERW) random spanning tree.

Currently hosts:

  • mst (ALGO-MST-001): minimum_spanning_tree — Prim / Kruskal / Unweighted / Automatic with a Vec<EdgeId> return type.
  • random_spanning_tree (ALGO-RST-001): random_spanning_tree — uniform spanning tree/forest via loop-erased random walk.

Enums§

MstAlgorithm
Selector for the minimum-spanning-tree algorithm.

Functions§

minimum_spanning_tree
Computes a minimum spanning tree (or forest, if disconnected) of graph and returns the IDs of the edges that constitute the tree.
random_spanning_tree
Uniformly sample a random spanning tree (or forest) of a graph.