Graph Data Science

betweenness centrality

A score for each node equal to how often it lies on the shortest paths between other nodes.

Example

Every route to Eve runs through Dan. Every route between Ava or Cleo and the rest runs through Ben.

cypher
CALL gds.betweenness.stream('people')
YIELD nodeId, score
RETURN gds.util.asNode(nodeId).name AS person, score
ORDER BY score DESC

Ben scores 5, lying on the shortest path for five pairs: Ava with Cleo, Dan and Eve, and Cleo with Dan and Eve. Dan scores 3, for Ava, Cleo and Ben each reaching Eve. Ava, Cleo and Eve score 0, because no shortest path passes through an end of the graph.

Lessons that use this term

The lesson and course links below open in a new tab.

No published lesson uses this term yet.

All glossary terms