Skip to main content

degree_eccentricity_index

Function degree_eccentricity_index 

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

Compute the degree-eccentricity index.

DE(G) = Σ_{v∈V} d(v) · ε(v)

Returns 0 for empty graphs.

§Examples

use rust_igraph::{Graph, degree_eccentricity_index};

// Path 0-1-2: degrees [1,2,1], eccentricities [2,1,2]
// DE = 1·2 + 2·1 + 1·2 = 6
let g = Graph::from_edges(&[(0,1),(1,2)], false, Some(3)).unwrap();
assert_eq!(degree_eccentricity_index(&g).unwrap(), 6);