pub fn degree_neighbor_variance_sum(graph: &Graph) -> IgraphResult<f64>Expand description
Compute the sum of neighbor degree variances.
Σ_{v: d(v)>0} Var(d(N(v)))
For each non-isolated vertex, computes the population variance of its neighbors’ degrees and sums them. Returns 0.0 for edgeless or regular graphs.
§Examples
use rust_igraph::{Graph, degree_neighbor_variance_sum};
// K_3: each vertex sees [2,2] → Var=0 → sum 0
let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
assert!(degree_neighbor_variance_sum(&g).unwrap().abs() < 1e-10);