All revision notes topics

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).

Key termstravelling salesman problemtour
Exam tip

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 nn vertices there are (n−1)!2\frac{(n-1)!}{2} different tours, counting a tour and its reverse as the same. For n=4n=4 there are 33, and for n=5n=5 there are 1212, 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.

Key termsclassical problemcomplete graph
Common mistake

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 BB by an arc of weight ww, that arc adds 2w2w to the tour.

Key termspractical problem
Exam tip

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 ABCABC in it, the longest side is no longer than the sum of the other two: AB≤AC+CB,where AB is a longest length.AB\leq AC+CB,\quad\text{where }AB\text{ is a longest length}. 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 30>15+1030>15+10.

Key termstriangle inequality
Common mistake

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 WW, XX, YY, ZZ there are three tours starting at WW:

  • WW-XX-YY-ZZ-WW
  • WW-XX-ZZ-YY-WW
  • WW-YY-XX-ZZ-WW With WX=20WX=20, WY=35WY=35, WZ=25WZ=25, XY=15XY=15, XZ=30XZ=30, YZ=10YZ=10 the lengths are 7070, 9595 and 105105. The shortest tour has length 7070. For five vertices list the 1212 tours systematically by fixing the start and listing orders of the other four vertices, then dropping reversals. Always show every tour you considered.
Exam tip

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.

Common mistake

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

  1. A sales representative must visit four towns PP, QQ, RR and SS, starting and finishing at PP. Every pair of towns is joined by a direct road. The distances in km are PQ=12PQ=12, PR=15PR=15, PS=9PS=9, QR=8QR=8, QS=14QS=14 and RS=11RS=11. Each town is to be visited exactly once.
    Find the length of the shortest tour for the classical problem.2 marks
  2. A driver starts at a depot HH, delivers to three shops AA, BB and CC, and returns to HH. The only roads are HA=5HA=5, HB=7HB=7 and HC=4HC=4, with lengths in km. The driver may pass through a junction more than once.
    A fourth shop DD is added, joined only to CC by a road of length 33 km. Find the length of the shortest route that visits all four shops and returns to HH.2 marks
  3. Four offices WW, XX, YY and ZZ are joined by a complete network of direct links. The lengths in km are WX=20WX=20, WY=35WY=35, WZ=25WZ=25, XY=15XY=15, XZ=30XZ=30 and YZ=10YZ=10.
    Show that the triangle inequality is not satisfied by this network.3 marks
See the full worksheet

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).