Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
144 tokens/sec
GPT-4o
7 tokens/sec
Gemini 2.5 Pro Pro
46 tokens/sec
o3 Pro
4 tokens/sec
GPT-4.1 Pro
38 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

Breaking the Sorting Barrier for Directed Single-Source Shortest Paths (2504.17033v1)

Published 23 Apr 2025 in cs.DS

Abstract: We give a deterministic $O(m\log{2/3}n)$-time algorithm for single-source shortest paths (SSSP) on directed graphs with real non-negative edge weights in the comparison-addition model. This is the first result to break the $O(m+n\log n)$ time bound of Dijkstra's algorithm on sparse graphs, showing that Dijkstra's algorithm is not optimal for SSSP.

Summary

  • The paper presents a deterministic SSSP algorithm achieving O(m log^(2/3)n) time, surpassing Dijkstra's O(m+n log n) bound for sparse graphs.
  • It employs a recursive divide-and-conquer strategy that combines elements of Dijkstra’s and Bellman-Ford methods to reduce the frontier size.
  • The work introduces innovative techniques like FindPivots and specialized data structures to efficiently manage relaxations in the comparison-addition model.

This paper, "Breaking the Sorting Barrier for Directed Single-Source Shortest Paths" (2504.17033), presents a deterministic algorithm for solving the single-source shortest path (SSSP) problem on directed graphs with non-negative real edge weights in O(mlog2/3n)O(m\log^{2/3}n) time. This is a significant result because it is the first algorithm to break the O(m+nlogn)O(m+n\log n) time complexity of Dijkstra's algorithm on sparse graphs (mnm \approx n), which has long been considered a sorting barrier for SSSP in the comparison-addition model.

The standard Dijkstra's algorithm, when implemented with efficient priority queues like Fibonacci heaps or relaxed heaps, achieves O(m+nlogn)O(m+n\log n) time. This runtime is dominated by the nlognn \log n term in sparse graphs, which arises from extracting the minimum-distance vertex from a priority queue nn times. This process implicitly sorts the vertices by their distance from the source. Recent work has shown that if the algorithm is required to output this sorted order, Dijkstra's is indeed optimal [HHRTT24]. This paper shows that if only the distances are required, a faster deterministic algorithm exists for directed graphs. Previous work had achieved faster-than-sorting randomized SSSP for undirected graphs [DMSY23].

The core technical approach of the new algorithm is a sophisticated divide-and-conquer strategy that merges ideas from Dijkstra's algorithm and the BeLLMan-Ford algorithm. Dijkstra's algorithm proceeds by always exploring from the vertex with the smallest current distance estimate, effectively sorting vertices. BeLLMan-Ford, conversely, performs relaxations iteratively over all edges, making progress on paths up to a certain number of edges or vertices. The proposed algorithm aims to compute distances in increasing order, but crucially avoids fully sorting the vertices by their distances.

At a high level, the algorithm processes vertices in stages, defined by distance bounds. Suppose we have computed all shortest paths shorter than some value bb. The goal is to find shortest paths for vertices with true distances between bb and some larger bound BB. In a Dijkstra-like approach, one would use a priority queue containing vertices whose current distance estimates fall within [b,B)[b, B). The bottleneck is when this "frontier" of vertices is large, requiring Ω(nlogn)\Omega(n \log n) time to extract the minimum repeatedly.

The key innovation is a technique to reduce the size of this frontier. The algorithm maintains a set of "incomplete" vertices whose true distances are less than the current upper bound BB, but whose shortest paths are not yet finalized. These incomplete vertices must have their shortest path pass through some "complete" vertex on the current frontier SS. The algorithm aims to limit the size of this frontier SS relative to the set UU of "vertices of interest" (those with true distance <B< B whose shortest path goes through SS) to roughly U/k|U|/k, where k=log1/3(n)k = \log^{1/3}(n) is a parameter.

This is achieved using a sub-routine called FindPivots. Given a bound BB and a frontier SS, FindPivots performs kk steps of BeLLMan-Ford-like relaxation only from vertices in SS (and vertices reached within kk steps). After kk steps, any vertex vUv \in U whose shortest path passes through a complete vertex uSu \in S and uses at most kk edges involving other vertices in UU will have its distance finalized and be marked as complete. The vertices in SS that are roots of "shortest path trees" within UU containing at least kk vertices are designated as "pivots". The crucial property is that the number of such pivots is at most U/k|U|/k. Any incomplete vertex in UU after this process must depend on a pivot. This significantly reduces the size of the set of "important" frontier vertices.

The overall algorithm is a recursive procedure, BMSSP(l, B, S), which computes shortest paths bounded by BB starting from the set SS at recursion level ll.

  1. Base Case (l=0l=0): SS is a singleton {x}\{x\}. It runs a small Dijkstra-like process from xx up to a limit of k+1k+1 vertices or the bound BB.
  2. Recursive Step (l>0l>0):
    • Call FindPivots(B, S) to get a set of pivots PSP \subseteq S and a set WW of vertices completed within kk steps. P|P| is small relative to U|U|.
    • Initialize a specialized data structure (described below) with pivots PP. This structure is designed for partial sorting of distance values.
    • Iteratively:
      • Pull a subset SiS_i of M=2(l1)tM = 2^{(l-1)t} vertices with the smallest distances from the data structure, obtaining a new bound BiB_i.
      • Recursively call BMSSP(l-1, B_i, S_i). This finds distances for vertices reachable through SiS_i with distances less than BiB_i.
      • Relax edges from the complete vertices UiU_i returned by the recursive call. Neighbors whose distances are updated are either inserted back into the data structure (if their new distance is in [Bi,B)[B_i, B)) or "batch prepended" (if their new distance is in [Bi,Bi)[B'_i, B_i), where BiB'_i is the bound returned by the recursive call). Batch prepending is an optimized insertion for elements smaller than all others currently in the structure.
    • Continue iterations until the distance bound BB is reached or a workload limit (U>k2lt|U| > k \cdot 2^{lt}) is hit, indicating a "partial execution".
    • Return the computed boundary BB' and the set UU of complete vertices found within that bound.

The specialized data structure from lemma:partition is crucial for managing the vertices in the frontier DD at each level. It needs to efficiently handle insertions of new vertices with various distance values and also efficiently pull out a small set of vertices with the minimum current distance values (Pull). The Batch Prepend operation is needed because distances to neighbors of a completed vertex uUiu \in U_i might be smaller than many values currently in the structure DD, effectively belonging to an earlier "batch" of distances. The lemma describes a block-based linked list structure augmented with a binary search tree to support these operations with amortized costs depending on the total number of elements NN, the batch size MM, and the number of batch prepended elements LL.

The parameters are set to k=log1/3(n)k = \lfloor \log^{1/3}(n) \rfloor and t=log2/3(n)t = \lfloor \log^{2/3}(n) \rfloor. The number of recursion levels is O(logn/t)=O(log1/3n)O(\log n / t) = O(\log^{1/3} n). The size of SS at level ll is bounded by 2lt2^{lt}.

The total time complexity is derived by summing the costs across all levels of the recursion tree. The dominant costs come from the FindPivots calls and the operations on the specialized data structure.

  • FindPivots on a call (l,B,S)(l, B, S) takes O(kmin{kS,U})O(k \min\{k|S|, |U|\}) time. Summing this cost over all nodes in the recursion tree gives O(nk(logn)/t)=O(nlog1/3nlog1/3n)=O(nlog2/3n)O(n \cdot k \cdot (\log n)/t) = O(n \log^{1/3} n \log^{1/3} n) = O(n \log^{2/3} n). The constant degree graph transformation ensures the number of edges processed per vertex relaxation is constant.
  • Operations on the data structure: Insert takes amortized O(t)O(t) time, Batch Prepend takes amortized O(logk)O(\log k) per element, and Pull takes O(M)O(M). The total number of insertions is related to the number of edge relaxations. Each edge relaxation (u,v)(u,v) can potentially insert vv into the data structure. An edge (u,v)(u,v) can cause vv to be inserted via Insert only once across all levels. It can cause vv to be inserted via Batch Prepend multiple times if dvd{v} is updated below BiB_i bounds in recursive calls. The analysis shows that the total data structure time is bounded by O(mlog2/3n+nlog2/3nloglogn)=O(mlog2/3n)O(m \log^{2/3} n + n \log^{2/3} n \log\log n) = O(m \log^{2/3} n).

The overall time complexity combines these costs, resulting in the claimed O(mlog2/3n)O(m\log^{2/3}n). The transformation to a constant-degree graph, a standard technique, takes O(m)O(m) time and space. Handling non-unique path lengths adds only a constant factor overhead to comparisons. The algorithm works in the comparison-addition model, appropriate for real-valued edge weights.

In summary, the paper provides a significant theoretical advancement by presenting the first deterministic SSSP algorithm faster than Dijkstra's for sparse directed graphs with real non-negative weights in the comparison-addition model. The key is a recursive divide-and-conquer approach that intelligently combines ideas from Dijkstra and BeLLMan-Ford, using a frontier reduction technique based on limited relaxations and a specialized data structure for managing potential frontier vertices without full sorting. While the constant factor log2/3n\log^{2/3}n might mean Dijkstra remains faster in practice for typical graph sizes, this work fundamentally changes our understanding of the lower bounds for SSSP when vertex ordering is not required.