Mathster Maths topics Free worksheets Coverage Mathster for schools

Maths topics › A level Further Maths › D1, travelling and salesman

Find an upper bound for the travelling salesman problem using the nearest neighbour algorithm (A level only)

A level Further Maths · D1, travelling and salesman

Try a question

The table gives the distances, in kilometres, between five places.

ABCDE
A-16501973
B16-848058
C5084-6679
D198066-82
E73587982-


Apply the nearest neighbour algorithm starting at each place in turn, closing each path into a route by returning to its start. What is the length of the shortest route you find?

Free worksheet

10 questions on this objective, ready to print.

Download the worksheet (PDF)

We use this address to send you the answers, and for news only if you tick the box.

Worked solution

The working

  1. Apply the nearest neighbour algorithm from each place in turn: from the place just reached, go to the nearest place not yet visited; after the fifth place, return to the start (that last arc is forced).
  2. The five routes are:
    Start at A: A-B-E-C-D-A, length \(16 + 58 + 79 + 66 + 19 = { 238}\) km
    Start at B: B-A-D-C-E-B, length \(16 + 19 + 66 + 79 + 58 = { 238}\) km
    Start at C: C-A-B-E-D-C, length \(50 + 16 + 58 + 82 + 66 = { 272}\) km
    Start at D: D-A-B-E-C-D, length \(19 + 16 + 58 + 79 + 66 = { 238}\) km
    Start at E: E-B-A-D-C-E, length \(58 + 16 + 19 + 66 + 79 = { 238}\) km
  3. The shortest of these five routes starts at A and has length 238 km.
  4. The length of the shortest route found is 238 km.

Answer: 238

Mathster is maths homework, practice and assessment for schools, with animated worked solutions. Try Mathster free for 60 days →

Objectives from the AS and A level subject content for further mathematics (Department for Education). Contains public sector information licensed under the Open Government Licence v3.0.