English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

Breaking the Sorting Barrier for Directed Single-Source Shortest Paths: A Deterministic O(m log^(2/3) n) Algorithm Explained

Forum topic · ✨步子哥 · 2025-12-11

Summary

This post explains a recent breakthrough in single-source shortest path (SSSP) algorithms for directed graphs. Classic Dijkstra's algorithm runs in O(m + n log n) time, with the n log n term caused by priority-queue sorting—the so-called sorting barrier. The discussed paper introduces a deterministic divide-and-conquer algorithm that breaks this barrier for directed graphs, achieving O(m log^(2/3) n) time. The core ideas are: (1) a Bounded Multi-Source Shortest Path (BMSSP) routine that recursively partitions unfinished vertices; (2) a FindPivots subroutine that identifies key vertices through which shortest paths must pass, splitting large problems into smaller subproblems; and (3) a custom block-linked-list data structure supporting Batch Prepend in amortized O(max(1, log(N/M))) and Pull in O(M), avoiding global sorting entirely. Only local sorting of unfinished frontier vertices is performed instead of a global ordering. For sparse graphs where m ≈ n, this reduces complexity from O(n log n) to O(n log^(2/3) n)—the first deterministic improvement over Dijkstra's bound on directed graphs, with implications for routing, social network analysis, and other graph algorithms such as minimum spanning trees.

Breaking the Sorting Barrier for Directed SSSP: Core Ideas of the Paper

1. Background and Limitations of Existing Methods

Single-source shortest path (SSSP) is a foundational graph problem: find shortest paths from a source to all other vertices. The classic Dijkstra algorithm (1959) runs in \(O(m + n \log n)\), where \(m\) is the number of edges and \(n\) the number of vertices. The \(n \log n\) term comes from the priority queue's sorting operations (e.g., heaps). For sparse graphs (\(m \approx n\)), this is bounded by the "sorting barrier"—the cost of ordering vertices seemed unavoidable.

Although later work (Fibonacci heaps, relaxation heaps) optimized the underlying data structures, Dijkstra's \(O(m + n \log n)\) bound remained unbroken for directed graphs. Prior progress existed for randomized algorithms or undirected graphs (e.g., \(O(m \log \log n)\)), but a deterministic breakthrough on directed graphs is the paper's central contribution.

2. Core Idea: Divide and Conquer with Pivots

The paper proposes a deterministic divide-and-conquer algorithm that recursively partitions the vertex set, reducing the number of vertices that need to be sorted:

  • Dynamic frontier management: split the vertex set \(U\) into "finished" (distance known) and "unfinished" (distance pending) subsets, sorting only unfinished vertices locally instead of globally.
  • Pivot partitioning: a FindPivots subroutine finds key vertices that split the problem into smaller subproblems, avoiding global sorting.
  • Recursion: each subproblem is solved by recursively calling the core algorithm (BMSSP), progressively shrinking problem size.
  • 3. The Core Algorithm: Bounded Multi-Source Shortest Path (BMSSP)

    BMSSP takes a distance upper bound \(B\) and a source set \(S\), and outputs a new bound \(B'\) and the unfinished vertex set \(U\). The flow (Algorithm 3):

    1. Base case: at recursion depth 0, solve small instances directly with Dijkstra (e.g., single source). 2. Find pivots: call FindPivots(B, S) to get a pivot set \(P\) whose shortest paths pass through vertices of \(S\). 3. Data structure initialization: use a dynamic structure \(D\) supporting Batch Prepend and Pull to manage vertex distances. 4. Recursive calls: recurse on subsets \(S_i\) for vertices with distances in \([B_i, B_{i+1})\). 5. Edge relaxation: update distances and insert updated vertices into \(D\). 6. Batch prepend: merge subproblem results back via Batch Prepend.

    4. The FindPivots Subroutine

    FindPivots(B, S) (Algorithm 1) finds pivots: unfinished vertices whose shortest paths must pass through \(S\).

  • Starting from \(S\), expand the vertex set \(W\) via \(k\) relaxation steps.
  • If \(|W| > k|S|\), vertices in \(W\) serve as pivots \(P\).
  • Return \(P\) and \(W\).
  • Pivots are the key to divide-and-conquer: they partition large problems into smaller ones without global sorting.

    5. Data Structure

    To support recursion, the paper designs a block-linked-list structure with:

  • Batch Prepend: insert multiple key-value (vertex–distance) pairs in amortized \(O(\max(1, \log(N/M)))\) time (\(N\) total pairs, \(M\) block size).
  • Pull: extract the \(M\) smallest key-value pairs in \(O(M)\) time.
  • Maintained via blocking and a binary search tree, it avoids sorting on every insert/query, lowering overall complexity.

    6. Time Complexity Analysis

    The new algorithm runs in \(O(m \log^{2/3} n)\), breaking Dijkstra's \(O(m + n \log n)\) barrier:

  • Recursion depth: with parameter \(k = \log^{1/3} n\), depth is \(O(\log^{1/3} n)\).
  • Per level: each level processes \(O(m)\) edge relaxations, with data structure operations costing \(O(\log^{2/3} n)\).
  • For sparse graphs (\(m \approx n\)), complexity drops from \(O(n \log n)\) to \(O(n \log^{2/3} n)\) — a significant improvement.

    7. Significance and Contributions

  • First deterministic breakthrough: first deterministic algorithm to break \(O(m + n \log n)\) on directed graphs.
  • Sparse graph optimization: roughly a \(\log^{1/3} n\) factor improvement, practically relevant for routing and social network analysis.
  • Technical insight: combining divide-and-conquer with dynamic data structures offers new ideas for other graph algorithms (minimum spanning trees, bottleneck paths).

Summary

Via divide-and-conquer, pivot partitioning, and a custom data structure, the paper presents a deterministic algorithm solving the sorting barrier for directed SSSP. Its core innovation is local sorting instead of global sorting, recursively shrinking problem size to achieve the complexity breakthrough—advancing both the theoretical frontier of graph algorithms and practical solutions.

> Note: the "distinct path lengths" assumption simplifies path comparison and does not limit generality—ties can be broken lexicographically by path sequences.

Tags

#algorithms#shortest-path#graph-theory#dijkstra#deterministic-algorithms#divide-and-conquer#data-structures#complexity-theory

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/176415109