Walks #
In a simple graph, a walk is a finite sequence of adjacent vertices, and can be thought of equally well as a sequence of directed edges.
Warning: graph theorists mean something different by "path" than do homotopy theorists. A "walk" in graph theory is a "path" in homotopy theory. Another warning: some graph theorists use "path" and "simple path" for "walk" and "path."
Some definitions and theorems have inspiration from multigraph counterparts in [Cho94].
Main definitions #
SimpleGraph.Walk(with accompanying pattern definitionsSimpleGraph.Walk.nil'andSimpleGraph.Walk.cons')SimpleGraph.Walk.Nil: A predicate for the empty walkSimpleGraph.Walk.length: The length of a walkSimpleGraph.Walk.support: The list of vertices a walk visits in orderSimpleGraph.Walk.darts: The list of darts a walk visits in orderSimpleGraph.Walk.edges: The list of edges a walk visits in orderSimpleGraph.Walk.edgeSet: The set of edges of a walk visits
Tags #
walks
A walk is a sequence of adjacent vertices. For vertices u v : V,
the type walk u v consists of all walks starting at u and ending at v.
We say that a walk visits the vertices it contains. The set of vertices a
walk visits is SimpleGraph.Walk.support.
See SimpleGraph.Walk.nil' and SimpleGraph.Walk.cons' for patterns that
can be useful in definitions since they make the vertices explicit.
- nil {V : Type u} {G : SimpleGraph V} {u : V} : G.Walk u u
- cons {V : Type u} {G : SimpleGraph V} {u v w : V} (h : G.Adj u v) (p : G.Walk v w) : G.Walk u w
Instances For
Equations
- One or more equations did not get rendered due to their size.
- SimpleGraph.instDecidableEqWalk.decEq SimpleGraph.Walk.nil SimpleGraph.Walk.nil = isTrue ⋯
- SimpleGraph.instDecidableEqWalk.decEq SimpleGraph.Walk.nil (SimpleGraph.Walk.cons h p) = isFalse ⋯
- SimpleGraph.instDecidableEqWalk.decEq (SimpleGraph.Walk.cons h p) SimpleGraph.Walk.nil = isFalse ⋯
Instances For
Equations
- SimpleGraph.Walk.instInhabited G v = { default := SimpleGraph.Walk.nil }
The one-edge walk associated to a pair of adjacent vertices.
Equations
Instances For
Pattern to get Walk.nil with the vertex as an explicit argument.
Equations
Instances For
Pattern to get Walk.cons with the vertices as explicit arguments.
Equations
- SimpleGraph.Walk.cons' u v w h p = SimpleGraph.Walk.cons h p
Instances For
The length of a walk is the number of edges/darts along it.
Equations
Instances For
The edges of a walk is the list of edges it visits in order.
This is defined to be the list of edges underlying SimpleGraph.Walk.darts.
Equations
Instances For
Alias of SimpleGraph.Walk.isChain_adj_support.
Alias of SimpleGraph.Walk.isChain_dartAdj_darts.
Every edge in a walk's edge list is an edge of the graph.
It is written in this form (rather than using ⊆) to avoid unsightly coercions.
Predicate for the empty walk.
Solves the dependent type problem where p = G.Walk.nil typechecks
only if p has defeq endpoints.
- nil {V : Type u} {G : SimpleGraph V} {u : V} : Walk.nil.Nil
Instances For
Equations
Alias of the forward direction of SimpleGraph.Walk.nil_iff_eq_nil.
A walk with its endpoints defeq is Nil if and only if it is equal to nil.
The recursion principle for nonempty walks
Equations
- SimpleGraph.Walk.notNilRec cons SimpleGraph.Walk.nil = fun (hp : ¬SimpleGraph.Walk.nil.Nil) => absurd ⋯ hp
- SimpleGraph.Walk.notNilRec cons (SimpleGraph.Walk.cons h q) = fun (x : ¬(SimpleGraph.Walk.cons h q).Nil) => cons h q
Instances For
Given a set S and a walk w from u to v such that u ∈ S but v ∉ S,
there exists a dart in the walk whose start is in S but whose end is not.