Skip to main content

elliptic_sombor_index

Function elliptic_sombor_index 

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

Compute the elliptic Sombor index.

ESO(G) = Σ_{(u,v)∈E} (d(u)+d(v)) √(d(u)²+d(v)²)

Self-loops are skipped.

§Examples

use rust_igraph::{Graph, elliptic_sombor_index};

// K_3: 3 edges, d=2 for all. Each term: (2+2)√(4+4) = 4√8
// ESO = 3 × 4√8 = 12√8 ≈ 33.941
let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
let eso = elliptic_sombor_index(&g).unwrap();
assert!((eso - 12.0 * 8.0_f64.sqrt()).abs() < 1e-10);