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.)