Skip to main content

lanzhou_index

Function lanzhou_index 

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

Compute the Lanzhou index.

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

Returns 0 for empty graphs.

§Examples

use rust_igraph::{Graph, lanzhou_index};

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