7

For those not familiar with the problem, here is the Wiki article; it can be understood by anyone. I am in particular interested in the nearest neighbor algorithm, also known as the greedy algorithm, which essentially says "pick the nearest unvisited city".

Wikipedia states that there exist examples where this is the worst possible strategy, and this is what I am after, since the idea seems somewhat counterintuitive. I have visited the referenced article but it is way above my head. My questions are:

  • What is the smallest example of such a construction? (it need only be the worst strategy given a starting city, if that narrows things down)
  • If the aformentioned example is not too complex, can someone provide an explicit construction of one?
TSP
  • 133

1 Answers1

5

The article you linked to deals with the asymmetric travelling salesman problem. The authors have a subsequent paper which deals with the more usual symmetric TSP: Gutin and Yeo, "The Greedy Algorithm for the Symmetric TSP" (2007). An explicit construction of a graph on which "the greedy algorithm produces the unique worst tour" is given in the proof of Theorem 2.2. The smallest nontrivial case is $n=4$, for which the edge costs are as follows: $$\begin{array}{cccc} c(AB)=200, && c(AC)=201, && c(AD)=400, \\ && c(BC)=200, && c(BD)=201, \\ && && c(CD)=300. \end{array}$$ (There's a free parameter $M>n$ in their construction, which I've set to $M=100$ for clarity.)

The greedy algorithm starting from $A$ yields the tour $ABCDA$ whose cost $c(ABCDA)=200+200+300+400=1100$ is worse than that of both other tours, $c(ABDCA)=902$ and $c(ACBDA)=1002$.

  • Thank you Rahul, this is great. Out of curiosity, are you aware of an example (necessarily $n>4$) where the opposite of the greedy algorithm (picking the furthest unvisited city) is a better strategy than the NN? (in the example above they are equally bad) – TSP Sep 17 '14 at 22:24
  • Sorry, no idea. –  Sep 17 '14 at 22:36
  • No problem, I'll post as a new question. – TSP Sep 17 '14 at 22:37