0

I am struggling with a special case of TSP (traveling salesmen problem).

The context:

I have blocks with geographic extension. A block has several entry and exit points. The task is to visit all blocks exactly once by entering a selected entry point and exiting on a picked exit point. The distance of the blocks depends on which entry and exit points we select. (We don't care the travel time between the entry and exit points of a block.)

The problem:

To rephrase and simplify the problem: I have a B1..Bn set of nodes. I am looking for the sequence of Bx(y) where x is a permutation of 1..n and y is the selected node from the set Bx. This is a TSP with alternative, mutually exclusive targets (pick one of many).

By default, TSP solvers provides solution by visiting all targets.

Could this problem be transformed to a simple TSP?

(The code is in Kotlin, so a solution for Java/Kotlin would be the best.)

Balage1551
  • 1,037
  • 1
  • 10
  • 28
  • Can't you just, for each pair of Bi, Bj, determine the best pair of entry/exit nodes to minimize the travel time, then use those for all the distances between blocks? (Especially if the travel time within the block, from entry to exit, does not matter.) – tobias_k Sep 28 '21 at 13:53
  • Yes, you are right. I can do it. It would give a little sub-optimal solution: because, although I wrote the in-block distance is ignored, it is still there, and depends on the selected entry and exit points, but it is a manageable downgrade. Also, if I think it over, I could altogether eliminate the exit nodes and define the distance to the next block as the sum of the inter-block distance and the intra-block distance. It would even more simplify my problem space. I will test it. – Balage1551 Sep 28 '21 at 14:41
  • @Balage1551 it sounds like you might be able to express your problem as a "Generalized TSP", which is to find the shortest tour that visits exactly one node per set in a partition of nodes. Charles E. Noon is a researcher that has published extensively about GTSP. His work might provide some insights. – Tom Sep 28 '21 at 15:20
  • According to my limited reading, the GTSP can be solved by transforming it to a TSP and using any number of TSP solvers on the transformed problem. – Tom Sep 28 '21 at 15:28
  • Yes, Tom. GTSP is exactly what I was looking for. Thanks for pointing it out. I'll read about it and will come back the results. Funny I haven't find this on my research, it is so obvious and even have a Wiki page: https://en.wikipedia.org/wiki/Set_TSP_problem – Balage1551 Sep 28 '21 at 21:16

0 Answers0