0

I am trying to code a way to traverse an visit all the nodes with k different paths such that I visit all nodes once. It is possible to reach every node from every another node and we are all starting from the same starting location with non discreet ending location. We just want to visit all the nodes in the minimum amount of time.

Its kind of like the traveling salesman with k salesman and no constraint on returning to where we started

Any thoughts or direction would be helpful

1 Answers1

0

This is probably NP-hard so optimial solutions are going to take a very long time to run.

I would also probably just go with a randomized greedy solution which tend to work decently well:

  1. Randomly pick K starting points, mark them as visited.
  2. Jump to the next closest unvisited point across the start/end points of all paths (in either direction). Mark that point as visited.
  3. Repeat step 2 until no unvisited points remain. Note the paths used and the total distance.
  4. Repeat 1-3 X times, return the paths that used the short total distance across X runs.

Likely there is some post-processing optimizations that could be done on #3 to improve performance. IE: Run the algorithm again (1-3), but using the end points for each path as the starting points.

Nuclearman
  • 5,029
  • 1
  • 19
  • 35