Skip to main content

connective_eccentricity_index

Function connective_eccentricity_index 

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

Compute the connective eccentricity index.

ξ^ce(G) = Σ_v deg(v) / ecc(v)

Vertices with eccentricity 0 (isolated) are skipped.

§Examples

use rust_igraph::{Graph, connective_eccentricity_index};

// Path 0-1-2: deg=[1,2,1], ecc=[2,1,2]
// ξ^ce = 1/2 + 2/1 + 1/2 = 3.0
let g = Graph::from_edges(&[(0,1),(1,2)], false, Some(3)).unwrap();
assert!((connective_eccentricity_index(&g).unwrap() - 3.0).abs() < 1e-10);