Consider the following graphs. Check that you can start at one vertex and travel along each edge exactly once without lifting your pen from the paper.
Each graph has a trail that uses every edge exactly once. The trail on the left is open and starts and finishes at different vertices. The graph on the right is closed and any vertex can be the start/end.
Traversable is the word to describe graphs where you can start at a vertex and draw in all the edges without taking your pen off the page or retracing any edge. The two types of traversable graphs are:
If a graph has a closed trail (it starts and finishes at the same vertex) that uses every edge, it is called Eulerian (named after the same Euler who gave us the formula v+f-e=2). It can also be called an Eulerian trail or an Eulerian circuit.
If a graph has an open trail (it starts and finishes at different vertices) that uses every edge, it is described as semi-Eulerian. It can also be called a semi-Eulerian trail.
It is possible to determine if an undirected graph is Eulerian or semi-Eulerian without having to actually find the trail:
If a graph has exactly two vertices of odd degree, then the graph is semi-Eulerian. These two vertices will be the start and the end of the open semi-Eulerian trail.
If a graph has all even vertices, then the graph is Eulerian. The closed Eulerian trail can start at any vertex.
Suppose G is a very large network, with 300 vertices, each of even degree.
Does a semi-Eulerian trail exist for G?
Does an Eulerian circuit exist for G?
Consider the following network:
Is it possible to draw an Eulerian circuit on the diagram?
Write an Eulerian circuit starting and ending with the vertex B.
Consider the network below:
Is the network Eulerian or semi-Eulerian?
Which vertex or vertices can the trail start at?
Sarah has started to traverse through the graph, by moving along the vertices B,\,C,\,D. Which vertices are possible to travel to next along such a trail?
Write a semi-Eulerian trail for the network that completes Sarah's journey.
A graph is traversable if you can start at a vertex and trace all the edges without taking your pen off the page or retracing any edge. The two types of traversable graphs are:
If a graph has a closed trail that uses every edge, it is called Eulerian. A graph is Eulerian if all vertices have even degree.
If a graph has an open trail that uses every edge, it is described as semi-Eulerian. A graph is semi-Eulerian if exactly two vertices have odd degree.
When we looked at Eulerian graphs, we were focused on using each of the edges just once.
We will now look at Hamiltonian graphs, which are named after Sir William Hamilton - an Irish mathematician, physicist and astronomer.
A Hamiltonian graph is a graph which has a closed path (cycle) that visits each vertex exactly once, ending on the same vertex as it began. This closed path is also called a Hamiltonian cycle.
A semi-Hamiltonian path is a path that visits every vertex once and starts and ends at different vertices. Semi-Hamiltonian graphs are sometimes called traceable.
If a graph has a Hamiltonian cycle then it automatically has a semi-Hamiltonian path (by just dropping off the last vertex in the cycle we create a path - for example, ABDC and DBAC in the graph above).
Unlike Eulerian and semi-Eulerian paths, there is no systematic procedure to help us identify if a semi-Hamiltonian path or Hamiltonian cycle exists. The only thing we can do is look for them.
Here are three networks:
the first is semi-Hamiltonian and has a semi-Hamiltonian path highlighted;
the second is Hamiltonian and has a Hamiltonian cycle highlighted;
the third does not have a Hamiltonian or semi-Hamiltonian path.
The following graph is a complete graph. Recall that means each vertex is connected to every other vertex. It has many semi-Hamiltonian paths and Hamiltonian cycles. Remember, a semi-Hamiltonian path is a path where we visit each of the vertices only once.
Also, because it is a complete graph all of the paths listed above can be turned into Hamiltonian cycles by returning to the original node.
In a complete graph with n vertices, each vertex is connected to every other vertex by an edge. Starting at any vertex there are n-1 possible choices of vertices to visit next. After that, there are \\ n-2 vertices left to visit, and so on. Since every vertex is connected to every other vertex, this means there are n! = n \times (n-1) \times (n-2) \times ... \times 2 \times 1 possible Hamiltonian cycles.
For example, if a complete graph has 4 vertices the number of Hamiltonian cycles is given by:4! = 4 \times 3 \times 2 \times 1 = 24
A graph can be a traversable Eulerian/semi-Eulerian, a Hamiltonian/semi-Hamiltonian network, both, or neither, as these examples demonstrate:
The first is Eulerian and Hamiltonian, the second is only Hamiltonian, the third is only Eulerian, and the fourth is neither.
Which of the following graphs are semi-Hamiltonian?
A rock band is planning a tour across several cities. The following table represents the routes and distance between the cities at which they will be performing.
Starting City | Ending City | Distance |
---|---|---|
A | C | 9 |
A | F | 6 |
B | E | 11 |
B | F | 5 |
C | D | 3 |
C | F | 7 |
E | D | 5 |
E | F | 8 |
Which of the following graphs does the table represent?
Using either the correct graph or table given, find the shortest route for the rock band to cross starting at city A and passing by each city only once.
A hamiltonian graph contains a Hamiltonian cycle - a closed path that includes all vertices, other than the start/end vertex, one time.
A semi-Hamiltonian graph contains a semi-Hamiltonian path - an open path that includes all vertices once.