graph-ml/ Centrality Algorithms
Last Updated: October 20, 2018

Identifying influential nodes and bottlenecks within your graph.

Centrality Algorithms

Centrality algorithms identify the most important or influential vertices in your graph. Depending on the algorithm, "importance" can mean popularity, accessibility, or brokerage.

1. PageRank

Perhaps the most famous centrality algorithm, PageRank measures the global influence of a vertex.

  • How it works: A vertex is important if it is linked to by other important vertices.
  • Use Case: Search engine ranking, entity importance in a knowledge graph.
  • Personalized PageRank: Calculates influence relative to a specific "source" vertex (e.g., "What products are most relevant to this user?").

2. Betweenness Centrality

Measures how often a vertex acts as a bridge along the shortest path between other vertices.

  • Use Case: Finding supply chain bottlenecks or identifying "brokers" in a criminal network.
  • Resource Intensive: Requires calculating all-pairs shortest paths. Use the "Approximate" version for very large graphs.

3. Closeness Centrality

Measures the average distance from a vertex to all other reachable vertices.

  • Use Case: Finding the best location for a new warehouse to ensure it can reach all customers quickly.

4. Degree Centrality

The simplest measure of centrality—it simply counts the number of incoming or outgoing edges.

  • In-Degree: Popularity (e.g., "Who has the most followers?").
  • Out-Degree: Gregariousness (e.g., "Who sends the most emails?").
AlgorithmComplexityBest For
PageRankLow-MediumGlobal Influence
BetweennessHighInfrastructure Bottlenecks
ClosenessMediumAccessibility
DegreeVery LowImmediate Popularity

[!IMPORTANT] When running Centrality algorithms on massive graphs, ensure you have allocated enough memory for the Accumulators that store the scores during computation.