Skip to main content

distance_kurtosis

Function distance_kurtosis 

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

Compute the distance kurtosis.

Excess kurtosis (fourth standardized moment minus 3) of the distribution of all pairwise shortest path lengths. Positive values indicate heavy tails; negative values indicate light tails relative to a normal distribution. Returns 0.0 for disconnected or trivial graphs.

§Examples

use rust_igraph::{Graph, distance_kurtosis};

// K_4: all distances = 1, zero variance → kurtosis = 0
let g = Graph::from_edges(
    &[(0,1),(0,2),(0,3),(1,2),(1,3),(2,3)], false, Some(4)
).unwrap();
assert!(distance_kurtosis(&g).unwrap().abs() < 1e-10);