Revision:The Travelling Salesman Problem - The Student Room
The Student Room

Revision:The Travelling Salesman Problem

TSR Wiki > Study Help > Subjects and Revision > Revision Notes > Mathematics > The Travelling Salesman Problem



A Hamiltonian cycle is a tour that contains every node precisely once. Therefore, the classic travelling salesman problem is to find the Hamiltonian cycle of minimum weight - i.e. the shortest route passing through each node once.

As the number of nodes increases the number of possible Hamiltonian cycles increases very rapidly. For n nodes the number of Hamiltonian cycles is \frac{(n - 1)!}{2}.

The method of evaluating all Hamiltonian cycles therefore has exponential order. A 600MHz processor evaluating cycles for 20 nodes takes about 3 years. Testing each of these cycles to find the optimal solution is generally too time consuming to be feasible for most problems, so finding a reasonably good solution with the Nearest Neighbour algorithm suffices.

Contents

The Nearest Neighbour algorithm

  1. Choose any starting node
  2. Consider the arcs which join the previously chosen node to nodes not yet chosen. Choose the arc with minimum weight and add this node to the tour.
  3. Repeat 2 until all nodes have been added
  4. Add the arc which joins the last node to the first.

Disadvantages

  • The algorithm does not necessarily give the best solution - it chooses the best route at each node without considering future problems
  • It may lead to an incomplete tour.

The Lower Bound algorithm

This finds the lower weight limit of a Hamiltonian cycle. If the Nearest Neighbour algorithm gives an answer which is significantly higher than the lower bound, it suggests there is a better solution. If the NN algorithm gives an answer which equals the lower bound, the tour is optimum.

  1. Choose any node, X. Find the total of the 2 smallest weight arcs joined to X.
  2. Consider the network obtained by ignoring X and any arcs that join to X. Find the total weight of the minimum connector for this network.
  3. The sum of the two totals is the lower bound.

\mathrm{lower\ bound} \leq \mathrm{optimum\ solution} \leq \mathrm{nearest\ neighbour\ solution}

Tour Improvement

This algorithm attempts to improve the best solution found so far.

  • Let 1, 2, 3 ... n be the successive nodes of a Hamiltonian tour (NB n+1=1, n+2=2, n+3=3)
  • Let d(V,W) be the weight of the arcs between V and W
  1. Let i =1
  2. If d(i, i+2) + d(i+1, i+3) < d(i, i+1) + d(i+2, i+3) then swap i + 1 and i + 2. (I.e. for i=1, if the weight between node 1 and the node 3 plus the weight between node 2 and node 4 is less than the weight between node 1 and node 2 plus the weight between node 3 and node 4, swap the second and third nodes.)
  3. Replace i by i + 1
  4. If i \leq n then go to step 2. (I.e. repeat until i is greater than the number of nodes in the tour.)

Also See

See the other D1 notes:

  1. Algorithms
  2. Sorting algorithms
  3. Packing algorithms
  4. Graphs and networks
  5. Minimum connector problems
  6. The shortest path
  7. Route inspection
  8. The travelling salesman problem
  9. Linear programming
  10. The simplex algorithm

Comments

Discussions Toggle
What to wear? :)
started by: amy19
forum: Fashion and Beauty
replies: 7
last post: 2 Minutes Ago
LOTR Middle Earth Society.
started by: SmuUsh
forum: Books, Literature & Poetry
replies: 850
last post: 2 Minutes Ago
I have become nocturnal
started by: Jim_Reid
forum: Health
replies: 23
last post: 2 Minutes Ago
Top 5 regrets of the dying
started by: Raving_Hippy
forum: Advice on Everyday Issues
replies: 3
last post: 5 Minutes Ago
Who are your idols from history?
started by: Gurmeet.Kapoor
forum: History
replies: 61
last post: 6 Minutes Ago
Are atheists good people?
started by: Lizzeraptor
forum: Religion
replies: 39
last post: 6 Minutes Ago
How to ask someone to live with you
started by: laparisienne
forum: Student Accommodation
replies: 14
last post: 8 Minutes Ago
What is your dream job?
started by: Roberto-MOr
forum: Careers sectors and Employment
replies: 100
last post: 10 Minutes Ago
pharmacy interview at keele
started by: ambrin ox
forum: Pharmacy
replies: 38
last post: 10 Minutes Ago
Squat problems.
started by: The99Call
forum: Fitness
replies: 0
last post: 11 Minutes Ago
Help new phone
started by: miss katie
forum: Mobile Phones
replies: 7
last post: 14 Minutes Ago
Truth or Feelings?
started by: ckingalt
forum: Society
replies: 0
last post: 16 Minutes Ago
Too nervous to try counselling again because I can't open up properly
started by: Anonymous
forum: Mental Health
replies: 9
last post: 16 Minutes Ago
The Arsenal Thread XI
started by: Colonel.
forum: Football
replies: 4185
last post: 17 Minutes Ago
London 2012 Retail Job Interview
started by: RYNLPZ
forum: Part-Time and Temporary Employment
replies: 31
last post: 19 Minutes Ago
Good experiences with Citalopram?
started by: AJ2890
forum: Mental Health
replies: 16
last post: 21 Minutes Ago
The Cricket Society II
started by: Deshi
forum: Sport
replies: 9905
last post: 23 Minutes Ago
The "I have an offer from Edinburgh" thread
started by: oxymoronic
forum: University of Edinburgh
replies: 84
last post: 23 Minutes Ago
TSR Economics society
started by: Nuheen
forum: Economics, Business and Management
replies: 962
last post: 23 Minutes Ago
Cambridge Postgraduate applicants 2012
started by: HippyVann
forum: Postgraduate
replies: 2030
last post: 23 Minutes Ago
Article Updates Toggle
Contact Us | Site Rules | Staying Safe on TSR | Advertising | Staff Blog | Essays & Coursework | Terms & Conditions | Top
Customise your TSR | Life Advice | Hobbies and Interests | Debate and Current Affairs | Study Help | University and University courses
Universities and HE Colleges | Careers, Employment and Gap Years | General Discussion

Customise your TSR