Efficiently Computing Top-K Shortest Path Join

Lijun Chang, Xuemin Lin, Lu Qin, Jeffrey Xu Yu, Jian Pei

Abstract

The Top-K Shortest Path Join (KPJ) problem is a critical task in graph analysis, aimed at finding the $k$ shortest paths between two sets of nodes representing conceptual categories. Traditional approaches, often based on Yen's deviation algorithm, are computationally expensive and incompatible with pre-computed distance indices. This paper introduces the BestFirst framework, which employs a best-first search paradigm combined with iterative lower-bound tightening. By utilizing online indexing techniques like Partial and Incremental Shortest Path Trees (SPTP/SPTI), the proposed method avoids exhaustive graph traversals and minimizes redundant calculations. Evaluations on large-scale road networks show that our approach is several orders of magnitude faster than existing baselines, maintaining high efficiency even as graph sizes scale.

Introduction

In graph analysis, the classic K-Shortest Path (KSP) problem finds the $k$ shortest paths between two specific nodes. However, many real-world applications involve "conceptual nodes"—sets of physical nodes representing categories like "hotels" or "IKEAs." Finding the top-$k$ paths between these sets is the Shortest Path Join (KPJ).

Example graph illustrating conceptual nodes and potential paths for the Shortest Path Join problem.

The existing approach was to simplify KPJ into a standard KSP problem by adding "virtual nodes" and using the Deviation Algorithm (Yen’s algorithm). This has two major flaws:

  1. Computational Waste: It generates $O(k \cdot n)$ candidate paths, each requiring an expensive shortest-path calculation, even if they aren't in the final top-$k$.
  2. Index Incompatibility: Adding query-specific virtual nodes makes pre-computed distance indices (like distance oracles) useless, forcing the algorithm to traverse the graph exhaustively.

Methodology: The BestFirst Framework

The authors propose a framework called BestFirst, which treats the search space as a collection of subspaces that are recursively divided. Instead of fully computing every candidate path, the algorithm calculates a lower bound for each subspace. It only performs a full shortest-path search in a subspace if its lower bound is smaller than the current $k$-th shortest path found so far.

Iterative Bounding and Online Indexing

To make lower bounds tighter without high costs, the authors use a threshold $\tau$ that "guesses" the distance. They test if a subspace contains a path shorter than $\tau$ using a procedure called TestLB. If it doesn't, the lower bound is updated to $\tau$, and $\tau$ is increased iteratively. This is supported by dynamic indexing structures:

  • SPTP (Partial Shortest Path Tree): Built as a byproduct of the initial shortest path search to provide more accurate distance estimates.
  • SPTI (Incremental Shortest Path Tree): A tree that grows dynamically as the threshold $\tau$ increases, pruning nodes that are too far away to be relevant to the current search.
Evolution of Partial Shortest Path Trees ($PT_1, PT_2, PT_3$) during the iterative search process.

Experimental Evaluation

The researchers evaluated their approach using six real-world road networks, including the massive Western USA network (~6.2 million nodes).

Key Results

  • Speedup: The proposed IterBoundI algorithm outperformed the baseline (DA-SPT) by several orders of magnitude across all datasets.
  • Scalability: On the Western USA dataset, while the baseline struggled, IterBoundI remained efficient. When the graph size increased 40x, the processing time only increased by roughly 3x.
  • KSP Performance: Even when applied to the simpler KSP problem (node-to-node), these techniques outperformed specialized state-of-the-art KSP algorithms by significant margins.

Conclusion

The core insight of this work is that pruning is better than computing. By using lazy evaluation and query-time indexing, the BestFirst framework avoids the "heavy lifting" of Dijkstra-like searches until absolutely necessary. While the current implementation focuses on simple paths and requires some parameter tuning for the scaling factor $\alpha$, it represents a significant leap forward in the efficiency of complex graph join queries.

Summary updated

BibTeX
@inproceedings{chang2015efficiently,
  author = {Lijun Chang and Xuemin Lin and Lu Qin and Jeffrey Xu Yu and Jian Pei},
  title = {{Efficiently Computing Top-K Shortest Path Join}},
  booktitle = {EDBT},
  year = {2015},
  doi = {10.5441/002/edbt.2015.13},
}
Figure