Skip to main content

minmax_degree_ratio

Function minmax_degree_ratio 

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

Compute the min-max degree ratio index.

mm(G) = Σ_{(u,v)∈E} min(d(u),d(v))/max(d(u),d(v))

Each term is in (0,1], equalling 1 when d(u)=d(v). For regular graphs: mm(G) = m. Edges with a degree-0 endpoint are skipped. Self-loops are skipped.

§Examples

use rust_igraph::{Graph, minmax_degree_ratio};

// K_3: 3 edges → 3·1 = 3
let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
assert!((minmax_degree_ratio(&g).unwrap() - 3.0).abs() < 1e-10);