Hamiltonian Graphs #
In this file we introduce Hamiltonian paths, cycles and graphs.
Main definitions #
SimpleGraph.Walk.IsHamiltonian: Predicate for a walk to be Hamiltonian.SimpleGraph.Walk.IsHamiltonianCycle: Predicate for a walk to be a Hamiltonian cycle.SimpleGraph.IsHamiltonian: Predicate for a graph to be Hamiltonian.
A Hamiltonian path is a walk p that visits every vertex exactly once. Note that while
this definition doesn't contain that p is a path, p.isPath gives that.
Equations
Instances For
A Hamiltonian path visits every vertex.
Hamiltonian paths are paths.
A path whose support contains every vertex is Hamiltonian.
If a path p is Hamiltonian then its vertex set must be finite.
Equations
Instances For
The support of a Hamiltonian walk is the entire vertex set.
The length of a Hamiltonian path is one less than the number of vertices of the graph.
The length of the support of a Hamiltonian path equals the number of vertices of the graph.
If a path p is Hamiltonian, then p.support.get defines an equivalence between
Fin p.support.length and α.
Equations
Instances For
If a path p is Hamiltonian, then p.getVert defines an equivalence between
Fin p.support.length and α.
Equations
Instances For
A Hamiltonian cycle is a cycle that visits every vertex once.
- edges_nodup : p.edges.Nodup
- isHamiltonian_tail : p.tail.IsHamiltonian
Instances For
A Hamiltonian cycle visits every vertex.
The length of a Hamiltonian cycle is the number of vertices.
A Hamiltonian graph is a graph that contains a Hamiltonian cycle.
By convention, the singleton graph is considered to be Hamiltonian.
Equations
Instances For
A finite simple graph with at least three vertices and a bridge is not Hamiltonian.
More precisely, let G : SimpleGraph V be a simple graph on a finite vertex type V.
If Fintype.card V ≥ 3 and there exists an edge of G which is a bridge,
then G does not admit a Hamiltonian cycle, i.e. ¬ G.IsHamiltonian.