Dijkstra's algorithm with a natively realized binary heap #
The existing LogLinearStatement is a projection of the native memory-client endpoint
Cslib.Algorithms.Lean.Dijkstra.Native.Binary.exists_program_state. One exact-basis flat program
and instruction factor precede every runtime graph and word size. The original word envelope,
output addresses and shortest-path semantics are unchanged; the bound includes the input
prefix, native body and final halt. The underlying endpoint also retains the complete final
memory and frontier of the original memory program.
The old structured heapDijkstra implementation and its implementation-specific helpers
heapDijkstra_spec and logLinearSpec, with literal coefficients 200 and 230, are
superseded. Those coefficients are not asserted for the new native witness. The unchanged
public endpoint already quantifies over one uniform constant.
Main results #
logLinearStatement: the original log-linear statement, proved through native realization.
References #
Log-linear main theorem. 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 + 1) (⌊log₂ n⌋ + 1)) instructions.