pub fn degeneracy_gap(graph: &Graph) -> IgraphResult<f64>Expand description
Degeneracy gap: (degeneracy − average_coreness) / degeneracy.
Measures how far the average vertex is from the densest core. Returns a value in [0, 1). A value of 0 means all vertices have the same coreness (complete graph). Higher values indicate a larger gap between the core elite and the periphery.
Returns 0.0 for edgeless graphs (degeneracy = 0).
§Examples
use rust_igraph::{Graph, degeneracy_gap};
// K4: all coreness = 3, gap = 0
let g = Graph::from_edges(
&[(0, 1), (0, 2), (0, 3), (1, 2), (1, 3), (2, 3)],
false,
Some(4),
)
.unwrap();
assert!(degeneracy_gap(&g).unwrap().abs() < 1e-10);