Skip to main content

revised_szeged_index

Function revised_szeged_index 

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

Compute the revised Szeged index of a graph.

Sz*(G) = Σ_{(u,v)∈E} (n_u + n₀/2) · (n_v + n₀/2)

Vertices equidistant from both endpoints are split evenly between the two sides.

§Examples

use rust_igraph::{Graph, revised_szeged_index};

// Single edge 0-1: n0=1, n1=1, equidistant=0 → (1)(1) = 1.0
let g = Graph::from_edges(&[(0,1)], false, Some(2)).unwrap();
assert!((revised_szeged_index(&g).unwrap() - 1.0).abs() < 1e-10);