Skip to main content

centralization_closeness_tmax

Function centralization_closeness_tmax 

Source
pub fn centralization_closeness_tmax(
    nodes: usize,
    mode: NeighborMode,
) -> Result<f64>
Expand description

Theoretical maximum of closeness centralization for a graph with nodes vertices (igraph_centralization_closeness_tmax with a null graph).

The graph is considered directed unless mode is NeighborMode::All. The most centralized structure is the star. The maximum refers to normalized closeness scores, as used by centralization_closeness. Time complexity: O(1).

Binds igraph_centralization_closeness_tmax.

ยงExamples

use igraph::{centrality::centralization_closeness_tmax, prelude::*};

// Undirected: (n - 1)(n - 2) / (2n - 3).
let t = centralization_closeness_tmax(5, NeighborMode::All).unwrap();
assert!((t - 12.0 / 7.0).abs() < 1e-12);