Skip to main content

edge_conn_ratio

Function edge_conn_ratio 

Source
pub fn edge_conn_ratio(graph: &Graph) -> IgraphResult<f64>
Expand description

Compute the edge connectivity ratio.

For connected graphs: min_degree / (n-1). This is the same formula as vertex connectivity ratio since both use min_degree as a proxy (Whitney’s theorem: κ(G) ≤ κ’(G) ≤ δ(G)). Returns 0.0 for disconnected or trivial graphs.

§Examples

use rust_igraph::{Graph, edge_conn_ratio};

// Cycle_4: min_degree=2, n-1=3 → 2/3
let g = Graph::from_edges(
    &[(0,1),(1,2),(2,3),(3,0)], false, Some(4)
).unwrap();
assert!((edge_conn_ratio(&g).unwrap() - 2.0/3.0).abs() < 1e-10);