Solving the Travelling Salesman Problem (Edexcel International A Level Maths: Decision 1)

Revision Note

Naomi C

Author

Naomi C

Last updated

Solving the Travelling Salesman Problem

How do I solve the travelling salesman problem?

  • List all of the possible Hamiltonian cycles and find the cycle of least weight
    • A complete graph with 3 vertices will have 2 possible Hamiltonian cycles
    • A complete graph with 4 vertices will have 6 possible Hamiltonian cycles
    • A complete graph with 5 vertices will have 24 possible Hamiltonian cycles
      • Although each of these values can be halved as each route will be the reverse of another route, e.g. DCBA is the reverse of the route ABCD
  • There is no known algorithm guaranteed to find the shortest Hamiltonian cycle in a graph
    • This method is therefore only suitable for small graphs
  • A Hamiltonian cycle will only be the optimal solution if the graph is a complete graph
    • So this solution method is only suitable for complete graphs
  • If you find a route where the weight is equal to the lower bound then this route is optimal

Examiner Tip

  • You need to remember the difference between the travelling salesman problem and the Chinese postman problem
    • The salesman is interested in selling at each destination (vertex)
    • The postman wants to walk along every road (edge) in order to deliver the letters

Worked example

The network below contains six vertices representing villages and the edges (roads) that connect them. The weighting of the edges represents the time, in minutes, that it takes to walk along a particular road between two villages.

The dashed lines indicate the edges that are to be repeated to convert the network into a complete network.
 

complete-network 

The lower bound for the time taken to walk a route that visits every vertex and returns to the start vertex is 53 minutes.

Starting from vertex A, find a route that shows that this is an optimal solution.
 

Because the network has 6 vertices there will be 120 possible different Hamiltonian cycles
This is too many to check!

You are told to start at vertex A and you are told to confirm that the route you have found is the optimal solution
This means that it should have the same weight as the lower bound for the problem
(An optimal solution can't be less than the lower bound, so if you find a solution that is equal to the lower bound it must be optimal)

Find a Hamiltonian cycle starting at vertex A

AB (14)
BF (9)
EF (8)
CE (6)
CD (5)
AD (11)

Calculate the total weight of the cycle

14 + 9 + 8 + 6 + 5 + 11 = 53

The route ABFECDA has the same weight (53 minutes) as the lower bound of the problem,
therefore it is an optimal solution

You've read 0 of your 5 free revision notes this week

Sign up now. It’s free!

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Did this page help you?

Naomi C

Author: Naomi C

Expertise: Maths

Naomi graduated from Durham University in 2007 with a Masters degree in Civil Engineering. She has taught Mathematics in the UK, Malaysia and Switzerland covering GCSE, IGCSE, A-Level and IB. She particularly enjoys applying Mathematics to real life and endeavours to bring creativity to the content she creates.