Skip to main content

edge_degree_rms

Function edge_degree_rms 

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

Compute the edge endpoint degree RMS.

√( Σ_{(u,v)∈E} (d(u)² + d(v)²) / (2m) )

Root-mean-square of endpoint degrees over all edge endpoints. Self-loops are skipped (m = non-loop edge count). Returns 0.0 for edgeless graphs. For regular graphs with degree r: RMS = r.

§Examples

use rust_igraph::{Graph, edge_degree_rms};

// K_3: 3 edges, all (2,2) → √((3·(4+4))/(2·3)) = √(4) = 2.0
let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
assert!((edge_degree_rms(&g).unwrap() - 2.0).abs() < 1e-10);