Paths in simple graphs
Path
A path is a sequence of vertices where is an edge for each .
Link to original
Length (path)
The length of a path is the number of edges in it.
Link to original
Simple path
A path is called simple if it does not contain the same edge twice.
Link to original
Hamiltonian path
A Hamiltonian path is a [[Simple path|simple path]] passing through every vertex exactly once.
Link to original
title: Example 1
$$
(a,b,c,f,b,e) \text{ is a simple path in } G \text{ of length } 5
$$
```graphviz
graph G {
a--d
a--e
d--c
d--e
e--f
edge [colorscheme=orrd9]
a--b [color=9 penwidth=3]
b--c [color=8 penwidth=3]
c--f [color=7 penwidth=3]
f--b [color=6 penwidth=3]
b--e [color=5 penwidth=3]
}title: Example 2
$$
(a,b,c,d,a,b) \text{ is a path in } G \text{ of length } 5 \text{ but it is not simple as it contains } a-b \text{ twice}
$$
```graphviz
graph G {
a--e
d--c
e--f
b--c
c--f
f--b
edge [colorscheme=greens9]
a--b [color=9 penwidth=5]
b--e [color=8 penwidth=3]
d--e [color=7 penwidth=3]
a--d [color=6 penwidth=3]
}title: Example 3
$$
(d,a,e,b,f,c) \text{ is a Hamiltonian path in } G
$$
```graphviz
graph G {
d--c
e--f
b--c
a--b
d--e
edge [colorscheme=blues9]
a--d [color=9 penwidth=3]
a--e [color=8 penwidth=3]
b--e [color=7 penwidth=3]
f--b [color=6 penwidth=3]
c--f [color=5 penwidth=3]
}