pub fn edge_adamic_adar_sum(graph: &Graph) -> IgraphResult<f64>Expand description
Compute the sum of Adamic–Adar indices across all edges.
Σ_{(u,v)∈E} Σ_{w ∈ N(u) ∩ N(v)} 1/ln(d(w))
Common neighbors with higher degree contribute less (rare shared neighbors are more informative). Returns 0.0 for the empty graph. Vertices with degree ≤ 1 contribute infinity in theory; we skip them (they can’t be common neighbors of an edge’s endpoints in a simple graph with ≥ 3 vertices). Self-loops are skipped.
§Examples
use rust_igraph::{Graph, edge_adamic_adar_sum};
// K_3: each edge has 1 common neighbor of degree 2
// → 3 · (1/ln(2)) ≈ 3/0.6931 ≈ 4.328
let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
let expected = 3.0 / 2.0_f64.ln();
assert!((edge_adamic_adar_sum(&g).unwrap() - expected).abs() < 1e-10);