Universal Optimality of Dijkstra Via Beyond-Worst-Case Heaps
Bernhard Haeupler, Richard Hladík, Václav Rozhon, Robert E. Tarjan, Jakub Tetek
Abstract
In this paper we prove that Dijkstra's shortest-path algorithm, if implemented with a sufficiently efficient heap, is universally optimal in its running time, and with suitable small additions is also universally optimal in its number of comparisons.
Universal optimality is a powerful beyond-worst-case performance guarantee for graph algorithms that informally states that a single algorithm on a problem involving graphs with arc and/or vertex weights performs as well as possible on every graph, assuming a worst-case choice of weights. We give the first application of this notion to any sequential algorithm.
We design a new heap data structure with a working-set bound, which guarantees that the heap takes advantage of a certain kind of locality in the heap operations. Our heap has the optimal (amortized) bounds of Fibonacci heaps but also has the beyond-worst-case guarantee that the cost of deleting the minimum item is logarithmic in the number of items inserted after it but before it is deleted, instead of logarithmic in the size of the heap when the item is deleted. That is, deletion of recently inserted items is especially efficient.
We prove that our working-set bound guarantees universal optimality for the problem of ordering vertices by their distance from the source vertex, which we call the distance order problem. Our result relies on the observation that the sequence of heap operations generated by any run of Dijkstra's algorithm on a fixed graph possesses enough locality that one can couple the number of comparisons performed by any heap with our working-set bound to the minimum number of comparisons required to solve the distance order problem on this graph for a worst-case choice of arc lengths. CCS Concepts: • Theory of computation → Shortest paths; Sorting and searching; • Mathematics of computing → Graph algorithms.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext a0fd1c41-b383-45a9-a856-fb4835cb1e8dCited by top-tier papers4
- Breaking the Sorting Barrier for Directed Single-Source Shortest PathsRan Duan, Jiayi Mao, Xiao Mao, Xinkai Shu et al.STOC 2025 · 8 citations
- Beyond Trajectory-Level Attribution: Graph-Based Credit Assignment for Agentic Reinforcement LearningCheng Xin, Shuo He, Lang Feng, Haiyang Xu et al.ICML 2026 · 6 citations
- Fast and Simple Sorting Using Partial InformationBernhard Haeupler, Richard Hladík, John Iacono, Václav Rozhon et al.SODA 2025 · 3 citations
- Trust Region Interior Point Methods: Optimal ℓ₂- and Faster Wide-Neighborhood Path FollowingDaniel Dadush, Haoyuan Ma, Bento Natura, László A. VéghSTOC 2026 · 1 citation
Builds on6
- Undirected (1+ε)-shortest paths via minor-aggregates: near-optimal deterministic parallel and distributed algorithmsVáclav Rozhon, Christoph Grunau, Bernhard Haeupler, Goran Zuzic et al.STOC 2022 · 22 citations
- Hop-constrained expander decompositions, oblivious routing, and distributed universal optimalityBernhard Haeupler, Harald Räcke, Mohsen GhaffariSTOC 2022 · 19 citations
- Breaking the Sorting Barrier for Directed Single-Source Shortest PathsRan Duan, Jiayi Mao, Xiao Mao, Xinkai Shu et al.STOC 2025 · 8 citations
- Universally-Optimal Distributed Shortest Paths and Transshipment via Graph-Based ℓ1-Oblivious RoutingGoran Zuzic, Gramoz Goranci, Mingquan Ye, Bernhard Haeupler et al.SODA 2022 · 7 citations
- Fast and Simple Sorting Using Partial InformationBernhard Haeupler, Richard Hladík, John Iacono, Václav Rozhon et al.SODA 2025 · 3 citations
Related papers
- A Randomized Algorithm for Single-Source Shortest Path on Undirected Real-Weighted GraphsRan Duan, Jiayi Mao, Xinkai Shu, Longhui YinFOCS 2023 · 6 citations
- Functional Correctness of C Implementations of Dijkstra's, Kruskal's, and Prim's AlgorithmsAnshuman Mohan, Wei Xiang Leow, Aquinas HoborCAV 2021 · 11 citations
- Distances and shortest paths on graphs of bounded highway dimension: simple, fast, dynamicSébastien Collette, John IaconoSODA 2024 · 1 citation
- All-Hops Shortest PathsVirginia Vassilevska Williams, Zoe Xi, Yinzhan Xu, Uri ZwickSODA 2025
- Near-Optimal Decremental SSSP in Dense Weighted DigraphsAaron Bernstein, Maximilian Probst Gutenberg, Christian Wulff-NilsenFOCS 2020 · 16 citations
