Skip to main content

vertex_conn_ratio

Function vertex_conn_ratio 

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

Compute the vertex connectivity ratio.

For connected graphs: min_degree / (n-1). For disconnected graphs: 0.0. This is an upper bound proxy for the actual vertex connectivity κ(G) / (n-1). Returns 0.0 for trivial graphs.

§Examples

use rust_igraph::{Graph, vertex_conn_ratio};

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