PSPC: Efficient Parallel Shortest Path Counting on Large-Scale Graphs

You Peng, Jeffrey Xu Yu, Sibo Wang

TL;DR

PSPC introduces a novel parallel algorithm for counting shortest paths in massive graphs, a task traditionally bottlenecked by sequential processing. By transforming node-order dependencies into distance-based propagation, the authors achieve near-linear speedup on multi-core systems, enabling real-time shortest path analysis on billion-scale graphs.

What Problem Does This Paper Address?

In graph analytics, knowing the distance between two points is common, but counting how many shortest paths exist (Shortest Path Counting, or SPC) is often more informative. SPC is a critical building block for calculating "Betweenness Centrality" (identifying influential nodes) and improving routing in road networks where multiple paths might offer better redundancy against traffic.

The current state-of-the-art method uses "2-hop hub labeling," which pre-computes labels for nodes to answer queries instantly. However, building this index is notoriously difficult to parallelize. Standard algorithms process nodes one by one because the labels for the $i$-th node depend on the results of the previous $i-1$ nodes. This sequential bottleneck makes indexing massive, modern datasets (like social networks or web graphs) prohibitively slow.

Methods

The authors propose PSPC (Parallel Shortest Path Counting), which breaks the sequential bottleneck through several key innovations:

  • Distance-Based Propagation: Instead of iterating through nodes, PSPC iterates through distances ($d=1, 2, \dots, D$). Because paths of length $d$ only depend on paths of length $d-1$, all nodes can be processed in parallel at each distance step.
  • Parallel Pruning: To keep the index size manageable, the authors introduced "Label Elimination" and "Label Merging" rules. These allow the system to discard redundant path information in parallel without losing accuracy.
  • Cost-Function Dynamic Scheduling: Parallel tasks are rarely equal. To prevent "straggler" threads from slowing down the whole process, PSPC uses a dynamic scheduler that estimates the computational cost of each node and distributes work to CPU threads on the fly.
  • Hybrid Vertex Ordering: The efficiency of hub labeling depends on the order in which nodes are ranked. PSPC uses a hybrid strategy: degree-based ordering for social networks (which are dense) and tree-decomposition-based ordering for road networks (which are sparse and "long").
  • Landmark Filtering: The algorithm pre-calculates distances to a small set of high-degree "landmark" nodes, allowing it to prune search branches even earlier during the indexing phase.

Datasets

The authors evaluated their approach on 10 diverse, real-world datasets from the KONECT and SNAP repositories:

  • Social/Interaction Networks: Facebook (FB), Youtube (YT), Petster (PE), Flickr (FL), DBLP (DB), and WikiConflict (WI).
  • Web/Location Graphs: Google (GO), Gowalla (GW), Berkstan (BE), and Indochina (IN).
  • Scale: The datasets range from 63k nodes up to the Indochina web graph, which contains 7.4 million nodes and 150 million edges.

Key Insights and Ideas

  • The "Distance Layer" Breakthrough: The most significant "aha moment" is the realization that while node-order is a sequential constraint, graph distance is a natural parallel boundary. By processing the graph "layer by layer" based on distance, the authors bypassed the fundamental dependency that crippled previous parallel attempts.
  • Independence of Index Size: Surprisingly, the parallel paradigm does not significantly increase the index size. PSPC produces an index comparable in size to sequential methods but builds it much faster.
  • Structural Awareness: The paper highlights that road networks and social networks are fundamentally different. A ranking strategy that works for a "small-world" social network fails on a road network, necessitating the hybrid ordering approach.

Key Results

  • Speedup: PSPC achieved near-linear speedup. Using 20 threads, it reached up to 16.7x speedup on the Facebook dataset and 15.4x on WikiConflict.
  • Indexing Efficiency: Even on a single thread, PSPC was roughly 18-27% faster than the previous state-of-the-art sequential algorithm (HP-SPCs).
  • Real-Time Queries: Once the index is built, shortest path counts can be retrieved in approximately 100 microseconds, even for complex queries.
  • Billion-Scale Capability: PSPC is one of the few methods capable of handling billion-scale path counts on massive graphs like Indochina within a reasonable time frame.

Limitations and Future Work

The authors noted that certain datasets, specifically DBLP (DB) and Flickr (FL), required significantly more indexing time and space than other graphs of similar size. The specific graph properties (likely related to local density or "clustering") that cause this inefficiency remain unclear.

Future work will focus on:

  1. Investigating the specific topological features that lead to larger index sizes.
  2. Adapting the parallel labeling method for dynamic graphs, where edges are frequently added or deleted (e.g., real-time traffic updates or social media follows).

Summary updated

BibTeX
@inproceedings{peng2023pspc,
  author = {You Peng and Jeffrey Xu Yu and Sibo Wang},
  title = {{PSPC: Efficient Parallel Shortest Path Counting on Large-Scale Graphs}},
  booktitle = {ICDE},
  year = {2023},
  doi = {10.1109/icde55515.2023.00074},
}
Figure