Skip to main content

reciprocal_randic_index

Function reciprocal_randic_index 

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

Compute the reciprocal Randić index.

RR(G) = Σ_{(u,v)∈E} √(d_u · d_v)

This is R_{+½}(G), the general Randić index with α = +½.

§Examples

use rust_igraph::{Graph, reciprocal_randic_index};

// K_3: all degrees 2 → 3·√(2·2) = 3·2 = 6
let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
assert!((reciprocal_randic_index(&g).unwrap() - 6.0).abs() < 1e-10);