Skip to main content

scc

Function scc 

Source
pub fn scc(graph: &Subgraph) -> Vec<Vec<String>>
Expand description

Strongly connected components by Kosaraju’s algorithm (§5.4).

Both passes use an explicit stack. Recursion would put the traversal depth on the call stack, and a knowledge graph is deep enough for that to be a real overflow rather than a theoretical one.

Components come back in a canonical form — each component sorted, and the components ordered by their first element — so the result is comparable across runs without the caller having to normalise it.