pub fn distance_gini(graph: &Graph) -> IgraphResult<f64>Expand description
Gini coefficient of the pairwise distance distribution.
Measures inequality among all finite pairwise distances. A value of 0 means all distances are equal (e.g. complete graph where all d=1). Higher values indicate more spread in the distance distribution.
Returns 0.0 for graphs with fewer than 2 finite distances.
§Examples
use rust_igraph::{Graph, distance_gini};
// K3: all distances = 1 → Gini = 0
let g = Graph::from_edges(&[(0, 1), (1, 2), (0, 2)], false, Some(3)).unwrap();
assert!(distance_gini(&g).unwrap().abs() < 1e-10);