Skip to main content

centralization_degree_tmax

Function centralization_degree_tmax 

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

Theoretical maximum of degree centralization for a graph with nodes vertices (igraph_centralization_degree_tmax with a null graph).

The graph is considered directed unless mode is NeighborMode::All. The most centralized structure is the star (the in- or out-star for directed graphs). loops tells whether self-loops count (and how) in the degree, since they change the maximum. For nodes == 0 the result is NaN. See igraph_t::centralization_degree_tmax to read size and directedness from a graph. Time complexity: O(1).

Binds igraph_centralization_degree_tmax.

ยงExamples

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

// Undirected star on 5 vertices: (n - 1)(n - 2) = 12.
assert_eq!(centralization_degree_tmax(5, NeighborMode::All, Loops::None).unwrap(), 12.0);