Dijkstra's algorithm on the word RAM: statements #
This file defines the single-source shortest-path problem solved by Dijkstra's algorithm Dijkstra Cormen et al., Section 24.3.
An instance (Cslib.Algorithms.WordRAM.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.WordRAM.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. A program writes a distance as a word with 0 for an unreachable vertex and d + 1 for
distance d (Cslib.Algorithms.WordRAM.Dijkstra.encodeDist).
Main definitions #
Cslib.Algorithms.WordRAM.Dijkstra.Instance: a weighted directed graph with a source.Cslib.Algorithms.WordRAM.Dijkstra.Instance.dist: the shortest-path distance.Cslib.Algorithms.WordRAM.Dijkstra.encodeDist: a distance as a word.
Main results #
Cslib.Algorithms.WordRAM.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.
Instances For
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.
Instances For
A distance as a word: 0 for an unreachable vertex and d + 1 for distance d.