Walks in multigraphs #
This file defines edge-labelled walks in Mathlib's Graph. Unlike walks in a simple graph, a
walk records the identity of each edge it traverses. Thus parallel edges give distinct walks,
while a loop has one length-one traversal. The basic API includes vertex and edge lists,
concatenation, reversal, paths, cycles, internally disjoint walks, and the induced reachability
relation.
The interface follows Mathlib's SimpleGraph.Walk, adapted so that walks retain actual multigraph
edge identities. The path-composition lemma Graph.Walk.IsPath.isCycle_append is adapted from
Mathlib's theorem of the same name for simple-graph walks.
An edge-labelled walk in a multigraph. Each step records an edge together with its incidence; a zero-length walk may be based at any ambient point.
- nil {α : Type u} {β : Type v} {G : Graph α β} {x : α} : G.Walk x x
- cons {α : Type u} {β : Type v} {G : Graph α β} {x y z : α} (e : β) (h : G.IsLink e x y) (p : G.Walk y z) : G.Walk x z
Instances For
Forgetting actual-edge membership from edgesAttach gives the edge list.
Two paths with opposite endpoints form a cycle when their interiors and edge identities are disjoint and at least one path is nonempty.
Reachability is an equivalence relation on the actual vertices of a graph.