gds.degree computes degree centrality for nodes in a projected graph. Use it to inspect how many relationships each node has when the network is not materialized for ordinary Cypher analysis. section 6.2.1
Stats mode returns the centrality distribution. By default, scores represent outgoing relationships; use REVERSE for incoming relationships. Supply relationshipWeightProperty to analyze weighted degree. section 6.2.1
A practical workflow is:
- Run gds.degree.stats on the projected graph to examine minimum, maximum, mean, and percentile values. section 6.2.1
- Use stream mode to return nodeId and score without storing results, then map node IDs with gds.util.asNode. section 6.2.1
- Rank streamed scores to identify nodes with the highest out-degree or in-degree. section 6.2.1
Retweet amplification network
The projected network has a mean outgoing degree of about 1.5, indicating sparsity. The highest out-degree user retweeted from 146 users, while the highest in-degree user had a score of 117. section 6.2.1
Listing 6.4 Evaluating the out-degree distribution of the inferred retweet amplification network
CALL gds.degree.stats('amplify')
YIELD centralityDistribution
View the Cypher call for evaluating the projected network's out-degree distribution. section 6.2.1
