Skip to main content

reduced_reciprocal_randic

Function reduced_reciprocal_randic 

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

Compute the reduced reciprocal Randić index.

RRR(G) = Σ_{(u,v)∈E} 1/√((du-1)·(dv-1))

Edges where either endpoint has degree ≤ 1 are skipped (the reduced degree would be 0, making the denominator zero). Self-loops are skipped.

§Examples

use rust_igraph::{Graph, reduced_reciprocal_randic};

// K_3: 3 edges, d=(2,2), each 1/√(1·1)=1 → 3
let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
assert!((reduced_reciprocal_randic(&g).unwrap() - 3.0).abs() < 1e-10);