Walks of a simple graph as steps of its adjacency relation #
A walk of length n from u to v in a simple graph is a chain of n steps of the adjacency
relation (SimpleGraph.exists_walk_length_eq_iff_relatesInSteps). Hence the extended distance
SimpleGraph.edist is at most n exactly when v is reached from u within n steps
(SimpleGraph.edist_le_iff_relatesWithinSteps). This connects Mathlib's graph metric to the
step-counted reachability Relation.RelatesWithinSteps that bounded connectivity uses.
Main results #
SimpleGraph.exists_walk_length_eq_iff_relatesInSteps: walks of lengthnare chains ofnadjacency steps.SimpleGraph.edist_le_iff_relatesWithinSteps: the distance is at mostnexactly when there is a chain of at mostnadjacency steps.
theorem SimpleGraph.exists_walk_length_eq_iff_relatesInSteps {V : Type u_1} {G : SimpleGraph V} {u v : V} {n : ℕ} :
Walks are chains of adjacency steps: there is a walk of length n from u to v
exactly when v is reached from u in n steps of the adjacency relation.
theorem SimpleGraph.edist_le_iff_relatesWithinSteps {V : Type u_1} {G : SimpleGraph V} {u v : V} {n : ℕ} :
The distance is at most n exactly when v is reached from u within n steps of the
adjacency relation.