Skip to main content

degree_centrality

Function degree_centrality 

Source
pub fn degree_centrality<V>(q: &GraphQuery<V>) -> HashMap<V::Id, f64>
where V: GraphValue + Clone, V::Id: Clone + Eq + Hash,
Expand description

Degree centrality for all nodes.

For a graph with n nodes, the degree centrality of node v is degree(v) / (n - 1). Returns 0.0 for all nodes in a single-node graph.

Does not take a TraversalWeight parameter — degree centrality is a structural property (count of incident relationships, direction-agnostic).