Dijkstra's algorithm on the word RAM with a Fibonacci heap: statements #
This file states what a single-source shortest-path program on the word RAM must satisfy to achieve the Fredman–Tarjan running-time bound of Dijkstra's algorithm with a Fibonacci heap Dijkstra Fredman and Tarjan Cormen et al., Chapter 19 and Section 24.3.
Because memory past the input starts at 0, the priority-queue and distance arrays require only
O(1) fresh initialization, and the algorithm extracts at most min n (m + 1) reachable vertices
from the source. We therefore state both:
Cslib.Algorithms.WordRAM.Dijkstra.FibonacciSpec: the sharper reachable-vertex boundsteps + 1 ≤ K (m + min(n, m + 1) (⌊log₂ n⌋ + 1));Cslib.Algorithms.WordRAM.Dijkstra.FibonacciLinearSpecandCslib.Algorithms.WordRAM.Dijkstra.FibonacciStatement: the textbook boundsteps + 1 ≤ K (m + n (⌊log₂ n⌋ + 1)), derived immediately fromFibonacciSpec.
Both bounds use the exact same word-size hypothesis
Fits w (8 * (G.n + G.m + 2) * (G.maxWeight + 2)) as
Cslib.Algorithms.WordRAM.Dijkstra.LogLinearSpec.
Main definitions #
Cslib.Algorithms.WordRAM.Dijkstra.FibonacciSpec: a flat program computes every distance from the source withinK (m + min(n, m + 1) (⌊log₂ n⌋ + 1))instructions.Cslib.Algorithms.WordRAM.Dijkstra.FibonacciLinearSpec: textbookK (m + n (⌊log₂ n⌋ + 1))program specification.Cslib.Algorithms.WordRAM.Dijkstra.FibonacciSpecStatement: some program meetsFibonacciSpec.Cslib.Algorithms.WordRAM.Dijkstra.FibonacciStatement: some program meetsFibonacciLinearSpec.
Main results #
Cslib.Algorithms.WordRAM.Dijkstra.FibonacciSpec.toLinearSpec:FibonacciSpecimpliesFibonacciLinearSpecwith the same constantK.
References #
- E. W. Dijkstra, A note on two problems in connexion with graphs
- M. L. Fredman and R. E. Tarjan, Fibonacci heaps and their uses in improved network optimization algorithms, Section 4 (pp. 609–610).
- T. H. Cormen, C. E. Leiserson, R. L. Rivest and C. Stein, Introduction to Algorithms, Section 24.3 (p. 662).
Shortest paths in O(m + min(n, m + 1) (⌊log₂ n⌋ + 1)) time. Instantiation of
ShortestPathSpec with the sharper reachable-vertex Fredman–Tarjan step bound.
Shortest paths in O(m + n (⌊log₂ n⌋ + 1)) time. Instantiation of ShortestPathSpec
with the textbook Fredman–Tarjan step bound.
The sharper reachable-vertex specification FibonacciSpec implies the textbook specification
FibonacciLinearSpec with the same constant K.
Reachable-vertex Fibonacci-heap Dijkstra theorem (statement). Some word-RAM program over
the exact basis meets FibonacciSpec.
Fibonacci-heap Dijkstra main theorem (statement). Some word-RAM program over the exact
basis computes all shortest-path distances from the source of a weighted directed graph with n
vertices and m edges, given by adjacency lists, within O(m + n (⌊log₂ n⌋ + 1)) instructions.