Skip to main content

exponential_abc

Function exponential_abc 

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

Compute the exponential atom-bond connectivity index.

EABC(G) = Σ_{(u,v)∈E} exp(√((du+dv-2) / (du·dv)))

Edges with a degree-0 endpoint or du+dv-2 < 0 are skipped. Self-loops are skipped.

§Examples

use rust_igraph::{Graph, exponential_abc};

// K_3: 3 edges, d=(2,2), each exp(√(2/4)) = exp(1/√2) → 3·exp(1/√2)
let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
let expected = 3.0 * (1.0_f64 / 2.0_f64.sqrt()).exp();
assert!((exponential_abc(&g).unwrap() - expected).abs() < 1e-10);