AI Glossary / Graphs and symbolic AI / Intermediate
(Shortest Path) Betweenness
Definition
(Shortest Path) Betweenness is a network measure describing how often a node lies between other nodes on shortest paths. For each relevant pair, the node receives the fraction of their shortest paths that pass through it, and these fractions are added. It highlights potential connecting roles under a shortest-path assumption, rather than measuring every possible kind of importance.
What it means
A node can have few direct connections yet connect otherwise distant parts of a network. Betweenness captures that kind of position by examining routes between other nodes, not just the number of immediate neighbors.
The meaning depends on the graph. Nodes could represent places, software components, or organizations, while edges represent a defined connection. Shortest may mean fewest edges or the lowest total distance or cost, depending on the chosen weights.
High betweenness suggests a node lies on many shortest routes in the representation. It does not prove that real traffic uses those routes, that the node controls communication, or that removing it would necessarily disconnect the network. Those are additional questions requiring appropriate evidence.
How it works
Choose a pair of distinct source and target nodes. Count their shortest paths and determine how many pass through the node being assessed. If one of two equally short paths passes through it, that pair contributes one-half rather than one whole unit.
Repeat across pairs and add the contributions. In the usual endpoint-excluding version, a node does not receive credit merely for being the source or target. Raw scores may be normalized to support comparisons, but the normalization depends on graph size, directionality, and endpoint conventions.
An undirected graph treats a pair as one unordered pair; a directed graph distinguishes source-to-target directions. NetworkX also offers approximation using sampled source nodes. For weighted calculations, its documented weights represent distances and must be positive. A relationship-strength weight therefore needs a justified interpretation before it is used as a shortest-path distance.
Three practical examples
1. A network operations team examines which routers appear on many shortest routes in its topology, then compares that structural result with actual routing behavior and capacity.
2. An organization studies connections between project teams to identify potential coordination dependencies, while avoiding claims about an individual's value based solely on their graph position.
3. A knowledge-graph analyst uses betweenness as one exploratory signal for entities connecting different regions of the graph, checking whether the encoded relations make shortest paths meaningful.
Think of it this way
Think of a town intersection that lies on many of the shortest journeys between neighborhoods. It may be an important crossing even if it connects only a small number of roads directly.
The analogy is limited. Travelers may avoid the shortest route because of congestion, restrictions, or preferences. A graph may omit such factors, and shortest-path betweenness does not automatically measure actual traffic. It describes a structural role under the selected representation and routing assumption.
Worked example
Consider an original undirected graph with four nodes and edges A - B, B - D, A - C, and C - D. Every edge has unit length, making a diamond with no direct A - D or B - C edge.
To assess B with endpoints excluded, consider pairs among A, C, and D. The A - C shortest path is their direct edge and does not use B. The C - D shortest path is also direct. Between A and D there are two shortest paths: A - B - D and A - C - D. Exactly one passes through B.
B therefore has raw betweenness 0 + 0 + 1/2 = 0.5. There are three possible unordered pairs among the other three nodes, so the usual normalized value is 0.5 / 3 = 1/6, about 0.167.
By symmetry, each node has the same value. This example shows why counting a node once whenever it appears on any shortest path would overstate its share when routes tie.
Illustrative case study
Fictional case: Cedar Systems maps dependencies between internal services and finds a service with high shortest-path betweenness. Managers initially call it the single point of failure for the whole platform.
Engineers review the graph definition and discover that some edges describe information exchange rather than mandatory runtime dependencies. They also inspect alternative routes, recovery arrangements, and actual request flows before deciding what resilience changes are warranted.
This case is invented. It illustrates that a centrality score can guide investigation without establishing an operational conclusion by itself. The significance of a node depends on what the edges represent and on behavior not necessarily captured by the graph.
Common misconceptions and mistakes
Betweenness is not degree: a node with many neighbors need not lie on many shortest paths between others. It is also different from a bridge or articulation-point test, which addresses particular disconnection properties.
Raw and normalized scores should not be mixed, and directed and undirected conventions can produce different values. A high score is not automatically a recommendation to remove, reward, or monitor a node. Missing edges, arbitrary weight choices, or an unsuitable shortest-path assumption can make a mathematically correct score misleading for the practical question.
Business use
Businesses can use betweenness to explore coordination dependencies, network structure, and possible concentration of routes. Begin with a clear reason for representing the system as a graph and document what nodes, edges, and weights mean.
Record whether endpoints are counted and which normalization is used. For large networks, distinguish approximate estimates from exact calculations. Compare the findings with operational evidence and other measures before acting. The score guides questions without replacing analysis of capacity, resilience, or responsibility.
People also ask
Can a node have zero betweenness and still matter?
Yes. An endpoint, specialist service, or essential local resource can be important without lying between other nodes on shortest paths.
What happens when shortest paths tie?
The pair's contribution is divided according to the fraction of those paths passing through the node, rather than giving every participating node full credit.
Do larger edge weights mean stronger connections here?
Not by default. In NetworkX's weighted shortest-path calculation, weights are distances or costs. A strength measure needs an appropriate, justified transformation or a different analysis.
Check your understanding
One of four equally short paths between two nodes passes through V. What contribution does that pair make to V's unnormalized, endpoint-excluding betweenness?
Answer: One-quarter, provided V is an intermediate node. The contribution is the fraction of the pair's shortest paths that pass through V.
Related terms
- Shortest Paths
- Graph
- Directed graph
- Edge weight
- Centrality
- shortest path
- degree centrality
- articulation point
- network analysis
Learn next
Next, compare degree and betweenness on a small graph. Find a node with few neighbors that still connects many shortest routes, and explain which real-world assumption would make that position relevant.
More in Graphs and symbolic AI
- Absolute error - Absolute error is the size of the difference between a predicted or estimated numerical value and its reference value, without regard to direction.
- Abstraction - Abstraction is the deliberate representation of something using selected features while leaving out other details.
- Abstraction hierarchy - An abstraction hierarchy is an arrangement of representations at different levels of detail, connected so that a problem can be considered broadly and then...
- Accessibility relations - Accessibility relations are connections between possible worlds or states in a formal model, specifying which alternatives are relevant from a given world.
- Action cost function - An action cost function assigns a numerical cost to taking an action in a planning or search problem.
- Actor - An actor, in planning, is an entity that performs actions within the modeled environment.
Sources
NetworkX, betweenness_centrality documentation and conventions: https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.centrality.betweenness_centrality.html The primary implementation documentation was read. The diamond-graph calculation and fictional service-network case are original. Interpretation depends on the graph definition and chosen conventions.
Previous: Shortest Augmenting Path Next: Shortest Paths