0

I have some set of points, and there is subset of points, marked as "static". So I need to solve TSP, which will create best path including marked points in static positions. How can I to solve it?

May be my problem can be solved in another way: points have two main characteristics - distance between each other and time, where salesman must be in point. Is there are some class of problems which solve this logistics task?

UPD I dont understand, how TSP for non-static points can be merged with TSP for static points?

Guy Fawkes
  • 2,313
  • 2
  • 22
  • 39

2 Answers2

0

If I understand your question correctly, it is just another traveling salesman problem defined by your static, non-static locations and your distance/time matrix. If your origin problem is very big, it might make sense to solve the TSP for the origin problem first (and only once). The yielded solution can then be used to specify your new initial solution considering your "non-static" or user defined locations, e.g. just by a simple best insertion. Then you can improve this initial solution with for example a k-opt heuristic as developed and applied by Lin-Kernighan (http://en.wikipedia.org/wiki/Lin%E2%80%93Kernighan_heuristic).
If your origin problem is small, just solve another TSP (considering both your "static" and "non-static" locations).

Stefan Schröder
  • 1,037
  • 7
  • 13
0

There are basically three approaches to TSP:

  1. Brute force
  2. Heuristics
  3. Approximating

Using brute force can be an option for small numbers of nodes. It involves generating all (n-1)! permutations and just computing their length. Adapted to your problem, all you have to change is the algorithm to generate the possible roundtrips to exclude those where the static points are not at their assigned locations.

Using heuristics (like e.g. simulated annealing), you can compute TSP for much larger problems, but you are not guaranteed a perfect roundtrip, only a good one. These often take an existing solution and derive a random different solution (or multiple solutions) from it. Adapted to your problem, you just discard derived solutions if they violate the requirement that the static points are at their assigned locations.

The third variant uses algorithms that give you a roundtrip in polynomial time, like e.g. walking along a minimum spanning tree, sweeping in one direction or greedily traversing them. Those offer good timing, but in a tradeoff for the quality of the resulting roundtrip. I don't have a clear idea how to adapt these to a solution that requires certain points to be at a certain position. Due to their simplicity, they are not easily adjusted to these additional requirements.

Ulrich Eckhardt
  • 16,572
  • 3
  • 28
  • 55