Introduction
Betweenness Centrality is a graph algorithm that quantifies the importance of a node based on the number of shortest paths that pass through it. Nodes that frequently occur on shortest paths between other nodes have higher betweenness centrality scores. This makes the algorithm useful for identifying key connectors or brokers within a network.Algorithm Overview
The core idea of Betweenness Centrality is that a node is more important if it lies on many of the shortest paths connecting other nodes. It’s particularly useful in understanding information flow or communication efficiency in a graph.For example, in a social network, a person who frequently connects otherwise unconnected groups would have high betweenness centrality.
Syntax
The procedure accepts an optional configuration map:Parameters
Yield
Example
Let’s take this Social Graph as an example:
Create the Graph
Run Betweenness Centrality - Sort Persons by importance based on FRIEND relationship
Usage Notes
- Scores are based on all shortest paths between node pairs.
- Nodes that serve as bridges between clusters tend to score higher.
- Betweenness Centrality can be computationally expensive on large, dense graphs.
- Use
samplingSizeto trade accuracy for performance (larger samples are slower but usually more accurate). - Set
samplingSeedto a fixed value to make runs reproducible; if you omit it, results may vary between runs due to random sampling.
Frequently Asked Questions
What is the call syntax for Betweenness Centrality?
What is the call syntax for Betweenness Centrality?
Use
CALL algo.betweenness({nodeLabels: ['Label'], relationshipTypes: ['TYPE']}) YIELD node, score. All configuration parameters are optional.Why do my results change between runs?
Why do my results change between runs?
By default, the algorithm uses random sampling with a time-based seed. Set
samplingSeed to a fixed integer value (e.g. samplingSeed: 42) for reproducible results.How does samplingSize affect accuracy?
How does samplingSize affect accuracy?
The
samplingSize parameter controls how many source nodes are sampled for approximation. Larger values yield more accurate results but increase computation time. The default is 32.When should I use Betweenness Centrality vs PageRank?
When should I use Betweenness Centrality vs PageRank?
Use Betweenness Centrality to find bridge or broker nodes connecting different clusters. Use PageRank to measure overall node influence based on incoming link quantity and quality.
Can Betweenness Centrality run on large graphs?
Can Betweenness Centrality run on large graphs?
Yes, but it can be expensive on very large, dense graphs. Use the
samplingSize parameter to trade accuracy for speed, and filter with nodeLabels/relationshipTypes to reduce the computation scope.