views:

444

answers:

2

Is there a good way to do a multithreaded A* search? Single threaded is fairly easy, as given in (for example) Artificial Intelligence: A Modern Approach, but I have not come across a good multithreaded version.

Assume a sane language like Java or C# or Lisp where we have thread pools and work blocks, and of course garbage collection.

A: 

I hear what you are saying but I am not sure that you would want to. In an A* search you want to take the most optimal path and you don't want to do any calculations for the same path twice.

Look at the facts:

  • The 'best' squares to choose are all next to eachother
  • Calculating for any other square other than the 'best' choice is premature computation. The point of A* is that it's choices are efficient.

If you threaded the application you would need:

  • a 'Waiter' in order to make sure that no thread touched the same square and to give them new squares to caclulate. They would all be working in such a tight knit area that they would be fighting for the path resources because all of the 'best' squares are next to eachother.

This problem is procedural and has no nice way of breaking it up into separate parts and thus is not a good choice for threading. In short nobody has done it because it is not a desirable thing to do. I hope this helps.

Robert Massaioli
It's true you might do extra work, but I could imagine an algorithm where you do sufficiently little wasted work that you can benefit from the many hardware threads that exist these days, especially if your search space is big or you have a poor heuristic.
Adam Goode
Yes but all the 'best' squares are next to eachother. This would only help if your goal was not a single point. If your goal was say get to any wall of a room then threading would be nice because you could make one thread for each wall fo the room and run to it and then take the result of the best thread. But for single point A* search this is not a good idea.
Robert Massaioli
There is not just the matter of wasted work, there also is the overhead incurred by coordinating threads.
meriton
Well, that's not really true. If you look into the literature this has been done a few times.
BobbyShaftoe
+4  A: 

I recommend reading this paper:

"Parallel bidirectional A* search on a symmetry multiprocessor"

There is also another paper, also at IEEE called:

"Parallel Astar search on message-passing architectures"

Both papers find novel methods for gaining quite a bit of speedup.

BobbyShaftoe