Skip to main content

nirmala_index

Function nirmala_index 

Source
pub fn nirmala_index(graph: &Graph) -> IgraphResult<f64>
Expand description

Compute the Nirmala index.

N(G) = Σ_{(u,v)∈E} √(d(u) + d(v))

Self-loops are skipped.

§Examples

use rust_igraph::{Graph, nirmala_index};

// K_3: 3 edges × √(2+2) = 3×2 = 6
let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
assert!((nirmala_index(&g).unwrap() - 6.0).abs() < 1e-10);