pub fn circuit_rank_ratio(graph: &Graph) -> IgraphResult<f64>Expand description
Compute the circuit rank ratio of the graph.
CRR = (m - n + c) / m
where c is the number of connected components. The circuit rank
(cyclomatic number) m - n + c counts the number of independent
cycles. Dividing by m gives the fraction of edges that are
“redundant” beyond a spanning forest. Returns 0.0 for graphs
with no edges.
§Examples
use rust_igraph::{Graph, circuit_rank_ratio};
// K_3: m=3, n=3, c=1 → circuit_rank=1, CRR=1/3
let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
assert!((circuit_rank_ratio(&g).unwrap() - 1.0/3.0).abs() < 1e-10);