Expand description
The dependency build order: a depth-first topological sort that rejects cycles, so building (and evaluating) the derived measures terminates.
Nodes are indices 0..g.len(); g[u] lists u’s dependencies, in the
order they are visited. The result is the DFS post-order from roots.
Functions§
- build_
order - The dependency build order of
rootsin graphg:Ok(order), the DFS post-order, holds exactly the nodes reachable fromroots, each once and after all of its dependencies;Err(w), at a nodewon a cycle, exactly when a cycle is reachable fromroots.