BatchHL: Answering Distance Queries on Batch-Dynamic Networks at Scale

Muhammad Farhan, Qing Wang, Henning Koehler

Introduction

In modern data science, massive graphs such as social networks, web crawls, and communication grids are rarely static. These structures undergo constant "topological churn," where edges and vertices are added or deleted incessantly. Answering shortest-path distance queries (e.g., "how many degrees of separation between User A and User B?") in real-time requires high-performance indexing. Traditionally, researchers use distance labeling to pre-compute and store distance information. However, existing labeling algorithms struggle with high-velocity updates, particularly when changes arrive in bursts or involve complex edge deletions.

BatchHL is a high-performance framework designed to overcome these limitations. By shifting from traditional "one-update-at-a-time" processing to a unified batch-dynamic approach, it achieves orders-of-magnitude speedups over state-of-the-art methods, scaling to networks with billions of edges while maintaining millisecond-level query times.

The Challenges of Dynamic Labeling

Existing distance labeling algorithms face two primary hurdles in dynamic environments:

  1. The Unit-Update Bottleneck: Most current systems process changes individually. In high-velocity environments where updates arrive in bursts, processing 1,000 updates one-by-one is redundant and slow. Many changes likely affect the same neighborhood, leading to wasted computational effort.
  2. The Deletion Difficulty: While adding an edge is computationally straightforward (as it usually shortens paths), deleting an edge is "hard." A deletion may invalidate thousands of stored distances, requiring expensive re-computation to identify the next-best shortest path.

Methodology: The BatchHL Framework

BatchHL utilizes Highway Cover Labeling, a hybrid approach that combines a partial offline index with a limited online search. The core innovation lies in its ability to process updates in batches through two distinct phases:

Instead of treating insertions and deletions as opposite operations, BatchHL identifies a "shared pattern." The algorithm uses "anchors" (vertices near the update) to identify a superset of all vertices whose labels might be affected. By processing these in a single sweep, the framework eliminates the redundant traversals that plague single-update algorithms.

Batch Repair

Once affected vertices are identified, this phase efficiently updates their labels. It employs "boundary vertices"—neighbors whose distances remained unchanged—to infer new distances for the affected region. This localized repair prevents the need for a global index rebuild.

Landmark-based Parallelism

Distance labels are often calculated relative to specific "landmark" nodes. BatchHL leverages this structure for natural parallelism, updating labels for different landmarks simultaneously across multiple CPU cores. This parallel version, BHL$^P$, shows significant performance gains as batch sizes increase.

Key Insights

  • Unified Update Logic: Traditionally, incremental (additions) and decremental (deletions) algorithms are designed separately. BatchHL frames both as identifying vertices where a "composite path" (partly in the old graph, partly in the new) becomes the new shortest route. This unification is the foundation of efficient batching.
  • LD-Affected Pruning: The paper introduces "Landmark-Distance affected" (LD-affected) pruning. By tracking whether a path passes through another landmark, the algorithm can skip updating redundant labels, keeping the index size minimal and query speeds high.
  • Batching vs. Rebuilding: Experimental results demonstrate that even for large batches (10,000+ updates), updating the existing index with BatchHL is significantly faster than rebuilding the index from scratch—previously the only viable option for very large, highly dynamic graphs.

Experimental Evaluation

The researchers evaluated BatchHL on 14 massive real-world networks, representing a significant scale-up from previous studies. Datasets included social networks like Twitter (1.5B edges) and Friendster (1.8B edges), as well as web graphs like UK Web (3.7B edges).

Key Results

  • Massive Speedups: BatchHL is over 15x faster than FulFD (a leading fully dynamic method) on most datasets and several orders of magnitude faster than FulPLL.
  • Extreme Scalability: On the UK Web dataset, BatchHL maintained an average query time of 1 millisecond and processed updates at a rate of roughly 14.4 milliseconds per edge within a batch.
  • Index Efficiency: BatchHL maintains a minimal labeling. For the Youtube dataset, its index was only 20MB, compared to 83MB for FulFD and 3.14GB for FulPLL.

Limitations and Future Work

While BatchHL excels in complex social and web networks, the authors note that road networks present different challenges due to their large diameters and planar-like topologies. Future work may involve optimizing the highway cover approach for these specific structures. Additionally, while the framework supports directed and weighted graphs, further empirical validation on heavily weighted dynamic graphs remains a logical next step.

Summary updated

BibTeX
@inproceedings{farhan2022batchhl,
  author = {Muhammad Farhan and Qing Wang and Henning Koehler},
  title = {{BatchHL: Answering Distance Queries on Batch-Dynamic Networks at Scale}},
  booktitle = {SIGMOD},
  year = {2022},
  doi = {10.1145/3514221.3517883},
}
Figure