Skip to main content

ev_degree_randic

Function ev_degree_randic 

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

Compute the ev-degree Randić index.

R_{ev}(G) = Σ_{e~f, adjacent} 1/√(d_{ev}(e) · d_{ev}(f))

Pairs where either edge has ev-degree 0 (self-loops or K₂) are skipped.

§Examples

use rust_igraph::{Graph, ev_degree_randic};

// K_3: 3 adjacent pairs, each 1/√(2·2) = 0.5, total = 1.5
let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
assert!((ev_degree_randic(&g).unwrap() - 1.5).abs() < 1e-10);