Skip to main content

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: Social Graph

Create the Graph

Run Betweenness Centrality - Sort Persons by importance based on FRIEND relationship

Expected result:

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 samplingSize to trade accuracy for performance (larger samples are slower but usually more accurate).
  • Set samplingSeed to a fixed value to make runs reproducible; if you omit it, results may vary between runs due to random sampling.

Frequently Asked Questions

Use CALL algo.betweenness({nodeLabels: ['Label'], relationshipTypes: ['TYPE']}) YIELD node, score. All configuration parameters are optional.
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.
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.
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.
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.