Skip to main content

total_eccentricity

Function total_eccentricity 

Source
pub fn total_eccentricity(graph: &Graph) -> IgraphResult<u64>
Expand description

Compute the total eccentricity.

ζ(G) = Σ_v ecc(v)

§Examples

use rust_igraph::{Graph, total_eccentricity};

// Path 0-1-2: ecc=[2,1,2] → ζ = 5
let g = Graph::from_edges(&[(0,1),(1,2)], false, Some(3)).unwrap();
assert_eq!(total_eccentricity(&g).unwrap(), 5);