Skip to main content

eccentric_connectivity_index

Function eccentric_connectivity_index 

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

Compute the eccentric connectivity index.

ξ^c(G) = Σ_v deg(v) · ecc(v)

Isolated vertices contribute 0. For disconnected graphs, eccentricity is computed within the reachable set of each vertex.

§Examples

use rust_igraph::{Graph, eccentric_connectivity_index};

// Path 0-1-2: deg=[1,2,1], ecc=[2,1,2]
// ξ^c = 1·2 + 2·1 + 1·2 = 6
let g = Graph::from_edges(&[(0,1),(1,2)], false, Some(3)).unwrap();
assert_eq!(eccentric_connectivity_index(&g).unwrap(), 6);