Skip to main content

degree_laplacian_energy

Function degree_laplacian_energy 

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

Compute the degree Laplacian energy of the graph.

DLE = Σ |d(v) - 2m/n| / (n · d_max)

Normalized sum of absolute deviations of degrees from their mean. Measures how far the degree sequence is from uniform. Zero for regular graphs. Returns 0.0 for graphs with fewer than 2 vertices or no edges.

§Examples

use rust_igraph::{Graph, degree_laplacian_energy};

// K_3: d=2 for all, mean=2 → DLE = 0/... = 0.0
let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
assert!(degree_laplacian_energy(&g).unwrap().abs() < 1e-10);