Skip to main content

freeman_degree_centralization

Function freeman_degree_centralization 

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

Compute Freeman’s degree centralization.

C_D = Σ (d_max - d(v)) / ((n-1)(n-2))

The sum of deviations from the maximum degree, normalized by the theoretical maximum for a star graph. Ranges from 0 (regular graphs) to 1 (star-like). Returns 0.0 for graphs with fewer than 3 vertices.

§Examples

use rust_igraph::{Graph, freeman_degree_centralization};

// Star S_5: max=4, deviations=[0,3,3,3,3]=12, denom=(4)(3)=12 → 1.0
let g = Graph::from_edges(&[(0,1),(0,2),(0,3),(0,4)], false, Some(5)).unwrap();
assert!((freeman_degree_centralization(&g).unwrap() - 1.0).abs() < 1e-10);