Skip to main content

degree_pair_concentration

Function degree_pair_concentration 

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

Fraction of edges in the most common degree-pair class.

Returns a value in (0, 1]. A value of 1 means all edges connect vertices of the same degree pair. Lower values indicate more diverse edge connectivity patterns.

Returns 0.0 for graphs with no edges.

§Examples

use rust_igraph::{Graph, degree_pair_concentration};

// K3: all 3 edges have pair (2,2) → concentration = 1.0
let g = Graph::from_edges(&[(0, 1), (1, 2), (0, 2)], false, Some(3)).unwrap();
assert!((degree_pair_concentration(&g).unwrap() - 1.0).abs() < 1e-10);