Skip to main content

second_ve_degree_zagreb

Function second_ve_degree_zagreb 

Source
pub fn second_ve_degree_zagreb(graph: &Graph) -> IgraphResult<u64>
Expand description

Compute the second ve-degree Zagreb index.

M₂^{ve}(G) = Σ_{(u,v)∈E} d_{ve}(u) · d_{ve}(v)

Self-loops are skipped.

§Examples

use rust_igraph::{Graph, second_ve_degree_zagreb};

// K_3: d_ve=[4,4,4], 3 edges × 16 = 48
let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
assert_eq!(second_ve_degree_zagreb(&g).unwrap(), 48);