pub fn general_randic_index(graph: &Graph, alpha: f64) -> IgraphResult<f64>Expand description
Compute the general Randić index R_α(G).
R_α(G) = Σ_{(u,v)∈E} (d_u · d_v)^α
Special cases: α = −0.5 gives the classical Randić index;
α = 1 gives the second Zagreb index M₂.
Self-loops and edges with d_u · d_v = 0 are skipped.
§Examples
use rust_igraph::{Graph, general_randic_index};
// K_3: all degrees 2, α = 1 → 3 · (2·2)^1 = 12
let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
assert!((general_randic_index(&g, 1.0).unwrap() - 12.0).abs() < 1e-10);