Skip to main content

graovac_ghorbani_index

Function graovac_ghorbani_index 

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

Compute the Graovac-Ghorbani index.

GG(G) = Σ_{(u,v)∈E} ln(n_u · n_v) / ln(n_u + n_v)

where n_u(e) = number of vertices closer to u than to v. Terms where n_u + n_v ≤ 1 or either count is zero are skipped.

§Examples

use rust_igraph::{Graph, graovac_ghorbani_index};

// K_3: all edges have n_u=1, n_v=1 → ln(1)/ln(2) = 0
let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
assert!((graovac_ghorbani_index(&g).unwrap()).abs() < 1e-10);