pub fn spectral_gap_ratio(graph: &Graph) -> IgraphResult<f64>Expand description
Compute the spectral gap ratio μ_2 / μ_n.
A ratio close to 1 indicates uniform expansion (the graph is close
to Ramanujan). Returns 0.0 if μ_n is zero or the graph has
fewer than 2 vertices.
§Examples
use rust_igraph::{Graph, spectral_gap_ratio};
// K_3: μ_2 = μ_3 = 3/2, ratio = 1.0
let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
let r = spectral_gap_ratio(&g).unwrap();
assert!((r - 1.0).abs() < 0.1);