Skip to main content

modified_sombor_index

Function modified_sombor_index 

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

Compute the modified Sombor index.

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

Self-loops are skipped.

§Examples

use rust_igraph::{Graph, modified_sombor_index};

// K_3: 3 edges, each 1/√(4+4) = 1/√8
// mSO = 3/√8 ≈ 1.0607
let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
let mso = modified_sombor_index(&g).unwrap();
assert!((mso - 3.0 / 8.0_f64.sqrt()).abs() < 1e-10);