Skip to main content

hub_ratio

Function hub_ratio 

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

Compute the hub ratio.

Fraction of vertices whose degree exceeds the average degree. Returns 0.0 for empty graphs.

§Examples

use rust_igraph::{Graph, hub_ratio};

// K_3: all d=2, avg=2, no vertex exceeds → 0.0
let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
assert!(hub_ratio(&g).unwrap().abs() < 1e-10);