-3

In a study project my project group is working on a robot which drives on a 5x5 with mines. We don't know the locations of the mines nor can we drive over the mines (only the sensor is allowed to sense it).

Our goal is to scan this matrix (as fast as possible) for mines with a starting point located below matrix point (1,5). We decided that the edges and the starting point of this matrix will be our vertices for the TSP problem, but we are stuck at finding a good algorithm which can (if needed) cross an edge mutiple times if this is faster.

The only thing we have at the moment is a 41x41 matrix with all possible ways to go from an edge to another edge (which can be altered to infinte if a mine is detected) and a backup plan to predefine a route and if a mine is detected send it to the next point.

What is the fastest algorithm which can tackle our problem and can you also provide an example c code or idea how to create it?

1 Answers1

0

To answer the general question (how do you solve TSP with vertices that can be visited more than once): Just run the Floyd-Warshall algorithm before running a standard TSP solver.

To answer your specific question: since you don't know where the mines are at the start of the game you'll have to recompute your route each time you discover that your route is blocked.

Jeremy List
  • 1,706
  • 9
  • 16