The single-source shortest-path problem #
This file defines the single-source shortest-path problem solved by Dijkstra's algorithm
Dijkstra Cormen et al., Section 24.3. Nothing here refers to a
machine: the word-RAM statements (CslibFrontier.Algorithms.WordRAM.Dijkstra.HeapStatement) and
the interface client (CslibFrontier.Algorithms.Lean.Dijkstra.Client) both import it.
An instance (Cslib.Algorithms.Dijkstra.Instance) is a directed graph on Fin n with
natural-number edge weights, given by its weight matrix, and a source vertex. The distance
Cslib.Algorithms.Dijkstra.Instance.dist is the infimum, in ℕ∞, of the weights of the
paths (Quiver.Path, Quiver.Path.addWeight) between two vertices; it is ⊤ when there is no
path.
Main definitions #
Cslib.Algorithms.Dijkstra.Instance: a weighted directed graph with a source.Cslib.Algorithms.Dijkstra.Instance.dist: the shortest-path distance.
Main results #
Cslib.Algorithms.Dijkstra.Instance.dist_self: every vertex is at distance0from itself.
References #
An instance of the single-source shortest-path problem: a directed graph on Fin n with
natural-number edge weights, given by its weight matrix, and a source vertex. The entry
weight u v is some c for an edge from u to v of weight c, and none for no edge.
- n : ℕ
The number of vertices.
The weight matrix.
The source.
The vertices of an instance, as a quiver: an arrow from u to v is a weight c with
I.weight u v = some c, so there is at most one.
Instances For
The largest edge weight, and 0 when there is no edge.