Introduction
Modern navigation services, such as Google Maps or ride-sharing platforms like Uber, are no longer satisfied with providing a single shortest path. Users frequently require multiple alternative routes to account for personal preference or real-time road conditions. This requirement defines the $k$-shortest path (KSP) problem.
However, computing KSP at scale presents two significant hurdles. First, road networks are dynamic; traffic fluctuations mean edge weights change constantly, rendering traditional static indices obsolete. Second, existing KSP algorithms like Yen’s are inherently sequential, making them difficult to parallelize across distributed systems for massive datasets.
The KSP-DG Framework
To address these challenges, we introduce KSP-DG, a distributed framework designed for high-performance KSP queries in dynamic environments. The framework relies on a novel indexing strategy and a parallelized query processing algorithm.
Distributed Two-Level Path (DTLP) Index
The core of KSP-DG is the DTLP index, which prioritizes structural stability over transient traffic states. Instead of indexing exact shortest paths, the DTLP index utilizes a hierarchical approach:
- Graph Partitioning: The global road network is partitioned into several subgraphs. Vertices that connect these subgraphs are designated as "boundary vertices."
- Two-Level Hierarchy: As shown in Figure 5, the index maintains a "Skeleton Graph" at the second level, consisting only of boundary vertices. The first level contains the detailed subgraphs and "bounding paths" between boundary vertices.
- Bounding Paths and vfrags: To handle dynamic weights, the index stores "bounding paths" based on structural lower bounds. By decomposing edge weights into "virtual fragments" (vfrags), the system can maintain a stable index that requires only minimal arithmetic updates when traffic changes, rather than full graph re-computations.
The KSP-DG Algorithm: Filter-and-Refine
The framework employs a "filter-and-refine" strategy to process queries. A master node first performs a "filter" step on the compact skeleton graph to identify a reference path. This reference path determines which subgraphs are relevant to the query.
In the "refine" step, these subgraphs are processed in parallel across a cluster of servers. We utilize Progressive Yen's (PYen), an optimized version of the classic algorithm that parallelizes deviation path searches and employs early pruning to accelerate local computation.
Experimental Evaluation
We evaluated KSP-DG using four large-scale road networks from the DIMACS challenge, ranging from New York (264k vertices) to the Central USA (14M vertices). Traffic dynamics were simulated by varying edge weights to mimic real-world congestion.
Key Results
- Efficiency: KSP-DG achieves orders-of-magnitude speedups over centralized baselines like Yen’s algorithm, particularly as the number of requested paths ($k$) increases.
- Scalability: The system demonstrates near-linear horizontal scalability, effectively handling massive datasets like CUSA (14M nodes) where traditional methods struggle.
- Low Maintenance: By focusing on structural "bounding paths," the DTLP index maintenance cost remains significantly lower than indices that require frequent shortest-path re-calculations.
Conclusion and Future Directions
KSP-DG represents the first distributed solution for KSP queries that effectively balances high query performance with low maintenance in dynamic networks. While the current implementation focuses on mathematical shortest paths, future work will explore adding diversity constraints to ensure alternative routes are sufficiently distinct, as well as supporting waypoint-constrained queries.
Summary updated