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).
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:
- 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$.
- 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.
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
IterBoundIalgorithm outperformed the baseline (DA-SPT) by several orders of magnitude across all datasets. - Scalability: On the Western USA dataset, while the baseline struggled,
IterBoundIremained 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