Expand description
Connected components — undirected (union-find) + strongly-connected
(Tarjan, directed). Both return a labelling Vec<usize> (comp[i] = component id,
compact 0..count) plus the component count.
Structs§
- Components
- A component labelling:
of[i]is nodei’s component (compact0..count).
Functions§
- connected
- Weakly / undirected connected components via union-find. Two nodes share a component iff a path connects them ignoring edge direction.
- strongly_
connected - Strongly connected components (Tarjan, directed). Two nodes share an SCC iff
each is reachable from the other following edge direction. Iterative (no recursion
blowout on deep graphs). Component ids are compact
0..count.