Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/douchuan/algorithm
/ avg_degree
Method
avg_degree
src/graph/undirected/graph.rs:88–90 ·
view source on GitHub ↗
compute average degree
(&self)
Source
from the content-addressed store, hash-verified
86
87
/// compute average degree
88
pub fn avg_degree(&self) -> f32 {
89
2.0 * self.E() as f32 / self.V() as f32
90
}
91
92
/// count self-loops
93
pub fn number_of_self_loops(&self) -> usize {
Callers
nothing calls this directly
Calls
2
E
Method · 0.45
V
Method · 0.45
Tested by
no test coverage detected