Skip to main content

tarjan_scc

Function tarjan_scc 

Source
pub fn tarjan_scc(
    edges: &[(u16, u16)],
    num_services: usize,
    scc_id_out: &mut [u16],
) -> usize
Expand description

Strongly-connected-component count via Tarjan’s algorithm. Returns the SCC ID per node into scc_id_out (length must be >= num_services), and the total SCC count.

Used for cycle detection: if SCC count < num_services, the graph has at least one cycle and the operator should consider whether the causality attribution algorithm’s “first slew → upstream-most” heuristic is valid for their topology (it is for DAGs; ambiguous for graphs with cycles).