pub fn bottleneck_ratio(graph: &Graph) -> IgraphResult<f64>Expand description
Compute the bottleneck ratio.
min_edge_betweenness / max_edge_betweenness — measures how
concentrated flow bottlenecks are. Values near 1 indicate all edges
carry similar load (uniform flow); values near 0 indicate a few
edges carry most of the flow. Uses shortest-path betweenness.
Returns 0.0 for trivial graphs.
§Examples
use rust_igraph::{Graph, bottleneck_ratio};
// K_3: all edge betweennesses equal → ratio = 1.0
let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
assert!((bottleneck_ratio(&g).unwrap() - 1.0).abs() < 1e-10);