A walk of a specified length in the native sparse graph.
- nil {n : Nat} {G : SparseGraph n} {root : Fin n} : Walk G root root 0
- step {n : Nat} {G : SparseGraph n} {root u v : Fin n} {length : Nat} : Walk G root u length → G.adj u v = true → Walk G root v (length + 1)
Instances For
structure
Hex.GraphIso.Nauty.Sparse.Distances
{n : Nat}
(G : SparseGraph n)
(root : Fin n)
(dist : Array Nat)
:
Shortest-path values with n representing exactly the unreachable
vertices. This contract includes both an attaining walk and minimality.
Instances For
theorem
Hex.GraphIso.Nauty.Sparse.Distances.unique
{n : Nat}
{G : SparseGraph n}
{root : Fin n}
{a b : Array Nat}
(ha : Distances G root a)
(hb : Distances G root b)
:
theorem
Hex.GraphIso.Nauty.Sparse.Distances.of_edges
{n : Nat}
{G : SparseGraph n}
{root : Fin n}
{dist : Array Nat}
(hsize : dist.size = n)
(hbound : ∀ (v : Fin n), dist[↑v]! ≤ n)
(hroot : dist[↑root]! = 0)
(hsound : ∀ (v : Fin n), dist[↑v]! < n → Walk G root v dist[↑v]!)
(hedge : ∀ (u v : Fin n), dist[↑u]! < n → G.adj u v = true → dist[↑v]! < n ∧ dist[↑v]! ≤ dist[↑u]! + 1)
:
Distances G root dist
The final BFS obligations imply shortest paths: discovered vertices have attaining walks and are closed under adjacency, and each edge increases the assigned value by at most one.