Skip to main content

irl_irregularity

Function irl_irregularity 

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

Compute the IRL irregularity (irregularity by logarithm).

IRL(G) = Σ_{(u,v)∈E} |ln d(u) - ln d(v)|

Edges with a degree-0 endpoint are skipped. Self-loops are skipped. Returns 0.0 for regular graphs and edgeless graphs.

§Examples

use rust_igraph::{Graph, irl_irregularity};

// K_3: all degrees 2, IRL = 0
let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
assert!(irl_irregularity(&g).unwrap().abs() < 1e-10);