Skip to main content

fifth_ga_index

Function fifth_ga_index 

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

Compute the fifth geometric-arithmetic index.

GA₅(G) = Σ_{(u,v)∈E} 2√(ε(u)·ε(v)) / (ε(u)+ε(v))

where ε(v) is the eccentricity. Self-loops and edges where ε(u)+ε(v) = 0 are skipped.

§Examples

use rust_igraph::{Graph, fifth_ga_index};

// K_3: all eccentricities = 1
// Each edge: 2√(1·1)/(1+1) = 1, 3 edges → GA₅ = 3
let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
assert!((fifth_ga_index(&g).unwrap() - 3.0).abs() < 1e-10);