Skip to main content

abc_index

Function abc_index 

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

Compute the atom-bond connectivity (ABC) index.

ABC(G) = Σ_{(u,v)∈E} √((deg(u)+deg(v)-2)/(deg(u)·deg(v)))

§Examples

use rust_igraph::{Graph, abc_index};

// Single edge: √((1+1-2)/(1·1)) = 0
let g = Graph::from_edges(&[(0,1)], false, Some(2)).unwrap();
assert!((abc_index(&g).unwrap() - 0.0).abs() < 1e-10);