Skip to main content

platt_index

Function platt_index 

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

Compute the Platt index (sum of edge degrees).

F(G) = Σ_{(u,v)∈E} (d(u) + d(v) - 2)

Each edge (u,v) has edge-degree = d(u) + d(v) - 2 (the number of edges adjacent to it, not counting itself). Self-loops are skipped.

§Examples

use rust_igraph::{Graph, platt_index};

// K_3: each edge (2+2-2)=2, 3 edges → 6
let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
assert_eq!(platt_index(&g).unwrap(), 6);