liveBook · Manning

Gds.degree

As explained in Graph Algorithms for Data Science

gds.degree is a Neo4j Graph Data Science procedure that computes degree centrality scores for nodes in a projected graph.

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

How Graph Algorithms for Data Science covers it

How deep it goes
Explains statistics, streaming, direction reversal, and weighted degree, without detailing algorithm internals.
Examples
Uses a retweet amplification network, percentile tables, weighted distributions, and ranked users as concrete examples.
What it assumes
Assumes a projected graph and basic Cypher familiarity while defining incoming and outgoing degree in plain language.
What you can do after
Evaluate projected-network degree distributions and rank nodes by incoming, outgoing, or weighted connectivity.
How it connects
Connects degree centrality with graph projection, degree distribution, weighted graphs, out-degree, and in-degree.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Graph Algorithms for Data Science. The section links point to the parts of the book it draws on.