pub fn mean_eccentricity_ratio(graph: &Graph) -> IgraphResult<f64>Expand description
Compute the mean eccentricity ratio.
mean_eccentricity / diameter — how close the average vertex’s
eccentricity is to the maximum (diameter). Values near 1 indicate
most vertices are far from the center; values near radius/diameter
indicate a compact center. Returns 0.0 for disconnected or trivial
graphs.
§Examples
use rust_igraph::{Graph, mean_eccentricity_ratio};
// K_4: all eccentricities = 1, diameter = 1 → ratio = 1.0
let g = Graph::from_edges(
&[(0,1),(0,2),(0,3),(1,2),(1,3),(2,3)], false, Some(4)
).unwrap();
assert!((mean_eccentricity_ratio(&g).unwrap() - 1.0).abs() < 1e-10);