Abstract
We study the problem of point-to-point distance querying for massive scale-free graphs, which is important for numerous applications. Given a directed or undirected graph, we propose to build an index for answering such queries based on a hop-doubling labeling technique. We derive bounds on the index size, the computation costs and I/O costs based on the properties of unweighted scale-free graphs. We show that our method is much more efficient compared to the state-of-the-art technique, in terms of both querying time and indexing time. Our empirical study shows that our method can handle graphs that are orders of magnitude larger than existing methods.
Introduction
Finding the shortest distance between two points (P2P distance querying) is a fundamental operation for social network analysis, web search, and RDF graph processing. While classical algorithms like Dijkstra’s are standard, they are often too slow for real-time queries on massive modern graphs. To address this, researchers utilize 2-hop labeling, where each vertex stores distances to a small set of "pivot" nodes. If two nodes share a pivot in their labels, their distance can be calculated instantly.
However, existing 2-hop methods face a "scalability wall." Most state-of-the-art algorithms, such as Pruned Landmark Labeling (PLL), must reside entirely in RAM, making them unusable for graphs with hundreds of millions of edges on standard hardware. Furthermore, for general graphs, the index size can explode to $O(V^2)$, which is impractical for large-scale data. This paper introduces Hop-Doubling Labeling (HopDb), a disk-based indexing method designed specifically for scale-free networks—graphs where a few "hubs" have very high degrees while most nodes have few connections.
Methodology: Hop-Doubling Labeling
The core of the proposed approach is the Hop-Doubling Labeling algorithm, which builds a 2-hop cover through an iterative process. Unlike in-memory competitors, HopDb is designed as a disk-based algorithm, allowing it to process graphs much larger than the available system RAM.
Vertex Ranking and Trough Paths
Nodes are first ranked by degree, prioritizing high-degree "hubs" as pivots because they naturally lie on many shortest paths. The algorithm focuses on "trough paths"—shortest paths where all intermediate nodes have a lower rank than the endpoints. This strategy significantly reduces the number of paths that need to be indexed.
Iterative Labeling and Pruning
Instead of a global search, the algorithm iteratively generates label entries. In each step, it combines existing labels to cover paths that are twice as long as those in the previous step. To keep the index lean, a pruning step removes redundant label entries that are already covered by higher-ranked pivots.
To prevent a "candidate explosion" in early iterations (where many short paths are discovered), the authors introduce a hybrid approach called Hop-Stepping Enhancement. This uses "Hop-Stepping" (increasing path length by 1) for the first few iterations before switching to "Hop-Doubling" for long-range connections.
Key Insights: The Hub Dimension
The efficiency of HopDb relies on the unique properties of scale-free networks. The authors argue that these networks have a small "hub dimension" ($h$), meaning a tiny fraction of high-degree nodes can hit almost all long shortest paths. This allows the total index size to be bounded by $O(h|V|)$ rather than $O(V^2)$.
Simply ranking nodes by degree is incredibly effective for these graphs. It ensures that the most "useful" pivots are processed first, leading to massive pruning opportunities. The transition from Hop-Stepping to Hop-Doubling further balances the high computational cost of early iterations with the need for logarithmic convergence in later stages.
Experimental Evaluation
The authors evaluated HopDb on a wide range of massive real-world and synthetic datasets, including social networks like Delicious (602M edges) and communication networks like Enron.
Performance and Scalability
HopDb demonstrated massive scalability, successfully indexing the Delicious graph in about 9 hours using only 4GB of RAM. In contrast, state-of-the-art in-memory methods like PLL failed on this dataset due to memory exhaustion. Query performance remained excellent, with times in the microsecond range for memory-based queries and roughly 20-40 milliseconds for disk-based queries.
Index Efficiency
The resulting indices were significantly smaller than those produced by other 2-hop methods. For example, on the 'Cat' dataset, HopDb's index was nearly 3x smaller than PLL's. Empirical studies confirmed that the average label size remains small and stable even as the graph size grows, supporting the "small hub dimension" theory.
Conclusion
Hop-Doubling Labeling provides a highly scalable solution for P2P distance querying on massive scale-free networks. By exploiting hub structures and employing a disk-based iterative process, it overcomes the memory bottlenecks of previous methods. Future work includes adapting HopDb for dynamic networks where edges are frequently updated and further exploring its application to weighted graphs.
Summary updated