MCPcopy Create free account
hub / github.com/douchuan/algorithm / degree

Method degree

src/graph/undirected/graph.rs:74–76  ·  view source on GitHub ↗

compute the degree of v

(&self, v: usize)

Source from the content-addressed store, hash-verified

72impl Graph {
73 /// compute the degree of v
74 pub fn degree(&self, v: usize) -> usize {
75 self.adj(v).fold(0, |acc, _| acc + 1)
76 }
77
78 /// compute maximum degree
79 pub fn max_degree(&self) -> usize {

Callers 1

max_degreeMethod · 0.45

Calls 1

adjMethod · 0.45

Tested by

no test coverage detected