pub fn pi_index(graph: &Graph) -> IgraphResult<u64>Expand description
Compute the Padmakar-Ivan (PI) index of a graph.
PI(G) = Σ_{(u,v)∈E} (n_u(e) + n_v(e))
Equivalently, PI(G) = Σ_{(u,v)∈E} (n - n₀(e)) where n₀(e) is
the number of vertices equidistant from both endpoints (including
unreachable vertices).
§Examples
use rust_igraph::{Graph, pi_index};
// Path 0-1-2: edge (0,1): nu=1,nv=2 → 3; edge (1,2): nu=2,nv=1 → 3
// PI = 6
let g = Graph::from_edges(&[(0,1),(1,2)], false, Some(3)).unwrap();
assert_eq!(pi_index(&g).unwrap(), 6);