The travelling salesman problemEdexcel International A Level Maths: Revision notes
Section 1
The problem and tours
The travelling salesman problem (TSP) asks for a route of minimum length which visits every vertex in an undirected network. A walk that visits every vertex and returns to its starting vertex is called a tour. Examples are a delivery driver visiting customers, a sales representative visiting towns, or a drilling machine moving between holes. No quick method is known that always gives the best tour for a large network, so for exam networks we either list all the tours or find bounds on the best one (see the next topic).
Always read whether the route must return to the start. A tour always does.
Section 2
The classical problem
In the classical TSP each vertex is visited exactly once (apart from the start, which is also the finish). A tour that does this is a cycle through all the vertices. The classical problem is normally set on a complete graph, one in which every pair of vertices is joined by an arc. If the network has vertices there are different tours, counting a tour and its reverse as the same. For there are , and for there are , which is why only small networks can be solved by listing. If a vertex has only one arc, such as a vertex at the end of a dead-end road, no classical tour exists, since the tour would have to enter and leave by the same arc.
Counting a tour and its reverse as different tours. They have the same length, so count them once.
Section 3
The practical problem
In the practical TSP a vertex may be revisited. This is needed when the network is not complete, for example when a vertex can only be reached through another vertex. A van delivering to shops along a one-road spur must go in and come out again. If the network is a tree, every arc must be travelled twice, so the shortest tour has length twice the total weight of the arcs. In general you list sensible tours, add up each total, and compare. If a vertex is joined only to by an arc of weight , that arc adds to the tour.
Practical problems arise on real road maps, where some places can only be reached through others.
Section 4
The triangle inequality
A complete network satisfies the triangle inequality if, for every triangle in it, the longest side is no longer than the sum of the other two: This says that going directly between two vertices is never longer than going through a third vertex. Distances measured in straight lines satisfy it. If a network does not satisfy it, some direct arc is longer than a route through another vertex, so the practical and classical problems can have different answers. To show the inequality fails, find one triangle where the longest side is greater than the sum of the other two, such as .
Checking a side that is not the longest. Always compare the longest side with the other two.
Section 5
Finding the shortest tour in a small network
For a complete network with four vertices , , , there are three tours starting at :
- ----
- ----
- ---- With , , , , , the lengths are , and . The shortest tour has length . For five vertices list the tours systematically by fixing the start and listing orders of the other four vertices, then dropping reversals. Always show every tour you considered.
List tours systematically, for example in alphabetical order, so that none is missed.
Section 6
Exam skills
State whether the problem is classical (each vertex exactly once) or practical (vertices may be revisited). Give the route as a list of vertices, starting and ending at the same vertex, and show the length as a sum. To explain why no classical tour exists, name a vertex that is joined to only one other vertex. When a new arc is added, find any tour that uses it, write its length with the unknown, and compare with the previous best tour to form an inequality.
Forgetting to return to the start when giving the length of a tour.
That's the notes covered.
Carry on to the next subtopic.
Exam questions on The travelling salesman problem
- A sales representative must visit four towns , , and , starting and finishing at . Every pair of towns is joined by a direct road. The distances in km are , , , , and . Each town is to be visited exactly once.Find the length of the shortest tour for the classical problem.2 marks
- A driver starts at a depot , delivers to three shops , and , and returns to . The only roads are , and , with lengths in km. The driver may pass through a junction more than once.A fourth shop is added, joined only to by a road of length km. Find the length of the shortest route that visits all four shops and returns to .2 marks
- Four offices , , and are joined by a complete network of direct links. The lengths in km are , , , , and .Show that the triangle inequality is not satisfied by this network.3 marks
Written by the Exaim team, led by Shaun Daswani (Head of Upper Secondary, Improve ME Institute; MSc Financial Mathematics, Imperial College London; BSc, UCL) and Jason Daswani (operational lead, Improve ME Institute; LSE).