pub fn hub_dominance(graph: &Graph) -> IgraphResult<f64>Expand description
Compute the hub dominance.
HD(G) = d_max / (2m) — the fraction of total degree held by
the maximum-degree vertex. Returns 0.0 for edgeless or empty
graphs.
§Examples
use rust_igraph::{Graph, hub_dominance};
// Star S_5: d_max=4, 2m=8 → HD = 0.5
let g = Graph::from_edges(&[(0,1),(0,2),(0,3),(0,4)], false, Some(5)).unwrap();
assert!((hub_dominance(&g).unwrap() - 0.5).abs() < 1e-10);