0

this might be a slightly foolish question, but what is the exact diffrence in solving TSP and ATSP.

I've always thought that in ATSP you need to compute the way back(since the input matrix is assymetric).

So the path for ATSP is twice as long as TSP. Am i correct?

I do understand this is a very simple question, but doubt has gotten into my mind. Thank you.

Greenmachine
  • 292
  • 1
  • 15

1 Answers1

2

An ATSP is a TSP with asymmetric distances.

Given a TSP with locations A, B, C, D, E for which the distance for A to B is 100, then the distance for B to A will be 100 too. For an ATSP this doesn't hold true: the distance from B to A might be 120 instead.

A real wold TSP using a car or truck is always an ATSP because driving on the wrong side of the road is illegal. Treating an ATSP as a TSP and solving that TSP optimially, will not result in the optimal solution for that ATSP.

enter image description here

Geoffrey De Smet
  • 26,223
  • 11
  • 73
  • 120
  • Thank you for your answer, could you please advise on whats the diffrence in the work of a simple greedy algorithm? For example. lets say we have a matrix like X 2 3 5 X 6 2 1 X. And a symmetrical matrix of the upper corner. what would the diffrence be? – Greenmachine Jan 13 '16 at 21:32
  • 1
    Most greedy algorithms don't rely on the TSP being symmetrical, so no difference, as long as your code clearly separates `a.getDistanceTo(b)` from `a.getDistanceFrom(b)`. – Geoffrey De Smet Jan 14 '16 at 07:50