Decision Mathematics 1 (Paper 3D or 4D), topic 3 (Algorithms on graphs II), spec point 3.2
The problem
Find the shortest tour that visits every vertex and returns to the start.
- In the classical problem, each vertex is visited exactly once.
- In the practical problem, vertices may be revisited.
To use the methods below on a practical problem, first make a table of least distances: replace each entry with the shortest distance between the two vertices. That table satisfies the triangle inequality (the direct route is never longer than going via another vertex).
The answer is usually not found exactly. Instead, find an interval: .
Upper bound: nearest neighbour
- Start at a vertex.
- Go to the nearest unvisited vertex.
- Repeat until every vertex is visited, then return to the start.
Try different start vertices: the smallest result is the best upper bound.
Upper bound: from a minimum spanning tree
Doubling the minimum spanning tree gives a tour, so twice its weight is an upper bound. Use short cuts (going directly between vertices instead of retracing) to reduce it.
Lower bound: deleted vertex
- Remove one vertex and its edges.
- Find a minimum spanning tree of what is left.
- Add the two shortest edges from the removed vertex.
Try different vertices: the largest result is the best lower bound. If a lower bound gives a tour (a Hamiltonian cycle), that tour is optimal.
Worked example
| P | Q | R | S | U | |
|---|---|---|---|---|---|
| P | – | 12 | 9 | 15 | 10 |
| Q | 12 | – | 7 | 11 | 14 |
| R | 9 | 7 | – | 8 | 13 |
| S | 15 | 11 | 8 | – | 6 |
| U | 10 | 14 | 13 | 6 | – |
Nearest neighbour from P: P-R (9), R-Q (7), Q-S (11), S-U (6), U-P (10). Total 43.
Delete R: the minimum spanning tree of P, Q, S, U is SU 6, PU 10, QS 11, weight 27. The two shortest edges from R are 7 and 8. Lower bound .
So . (Deleting P, S or U gives only 40, and deleting Q gives 41.)
Common mistake: taking the smallest lower bound or the largest upper bound. You want the largest lower bound and the smallest upper bound, to make the interval as narrow as possible.
Exam tip: write the tour in full, with each edge weight, so the examiner can follow your nearest neighbour choices. Finish with the interval for the optimal length.
Check yourself
Upper bounds of 52, 48 and 50 are found. Which is best?
.
What does the triangle inequality say?
For any three vertices, the longest side is no longer than the sum of the other two.
A lower bound gives a Hamiltonian cycle. What can you say?
That cycle is an optimal tour.