Skip to main content

Module analysis

Module analysis 

Source
Expand description

Static graph analysis — cycle detection, longest path, reachability.

Operates on the static edges declared via crate::builder::Graph::edge. Dynamic routing (a node returning Goto::Send to a peer that wasn’t declared statically) is invisible here — by design, since this is a diagnostics tool for the graph topology you wrote, not its runtime behavior.

let analysis = compiled.analyze();
if analysis.has_cycle {
    eprintln!("cycle detected");
}
println!("longest path: {} hops", analysis.depth);

depth is the longest acyclic path from the start node to any reachable node, measured in edge hops. For graphs with cycles, depth is 0 (it’s only meaningful for DAGs).

Structs§

GraphAnalysis
Output of CompiledGraph::analyze.