pub fn first_zagreb_index(graph: &Graph) -> IgraphResult<u64>Expand description
Compute the first Zagreb index M₁(G) = Σ deg(v)².
§Examples
use rust_igraph::{Graph, first_zagreb_index};
// Path 0-1-2: degrees [1, 2, 1], M₁ = 1+4+1 = 6
let g = Graph::from_edges(&[(0,1),(1,2)], false, Some(3)).unwrap();
assert_eq!(first_zagreb_index(&g).unwrap(), 6);