Skip to main content

max_degree

Function max_degree 

Source
pub fn max_degree(graph: &Graph, mode: DegreeMode) -> IgraphResult<u32>
Expand description

Returns the maximum degree in the graph.

Returns 0 for empty graphs (no vertices). For directed graphs, uses the specified mode.

ยงExamples

use rust_igraph::{Graph, max_degree, DegreeMode};

let mut g = Graph::with_vertices(4);
g.add_edge(0, 1).unwrap();
g.add_edge(0, 2).unwrap();
g.add_edge(0, 3).unwrap();
assert_eq!(max_degree(&g, DegreeMode::All).unwrap(), 3);