Cycles in simple graphs
Cycle
A cycle is a path beginning and ending with the same vertex.
Link to original
Length (cycle)
The length of a cycle is the number of edges in it.
Link to original
Simple cycle
A cycle is called simple if it does not contain the same edge twice.
Link to original
Hamiltonian cycle
A Hamiltonian cycle is a [[Simple cycle|simple cycle]] passing through every vertex exactly once.
Link to original
title: Example 1
$$
(a,d,c,b,a) \text{ is a simple cycle in } G \text{ of length } 4
$$
```graphviz
graph G {
a--e
b--e
b--f
c--f
d--e
e--f
a--d [penwidth=3]
c--d [penwidth=3]
b--c [penwidth=3]
b--a [penwidth=3]
}title: Example 1
$$
(b,e,d,a,e,b) \text{ is a cycle in } G \text{ of length } 5 \text{ but it is not simple}
$$
```graphviz
graph G {
a--e [penwidth=3]
b--e [penwidth=6]
b--f
c--f
d--e [penwidth=3]
e--f
a--d [penwidth=3]
c--d
b--c
b--a
}title: Example 1
$$
(c,f,e,d,a,b,c) \text{ is a Hamiltonian cycle in } G
$$
```graphviz
graph G {
a--e
b--e
b--f
c--f [penwidth=3]
d--e [penwidth=3]
e--f [penwidth=3]
a--d [penwidth=3]
c--d
b--c [penwidth=3]
b--a [penwidth=3]
}