Skip to main content

edge_degree_max_sum

Function edge_degree_max_sum 

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

Compute the edge degree max sum.

EDmax(G) = Σ_{(u,v)∈E} max(d(u), d(v))

Self-loops are skipped. For regular graphs with degree r: EDmax = m·r. Note that EDmin + EDmax = M₁ (first Zagreb).

§Examples

use rust_igraph::{Graph, edge_degree_max_sum};

// K_3: 3 edges, all (2,2) → 3·2 = 6
let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
assert_eq!(edge_degree_max_sum(&g).unwrap(), 6);