views:

83

answers:

1

What is a good path finding algorithm when you care the amount of time it takes but not how long the path is.

Also is there a faster algorithm if you don't care about the path at all but just want to check reachability.

(Is Flood Fill a good algorithm for this sort of stuff?)

+3  A: 

What kind of graph are you finding a path on? Is it a grid? Is it a weight graph?

These things all matter.

Some algorithms that may be helpful include

  • Breadth First Search
  • Depth First Search
  • Dijkstra's Algorithm
  • A* (A Star)
  • Floyd Warshall's Algorithm
  • The Bellman Ford Algorithm
Jamie Wong
+1. Blanket answer, blanket answer :-)
pst
Depending on how many possible states and possible paths exist in your problem, you might consider a variant on A* using a bloom filter (instead of a set) to record previously observed states. This worked well for me in a couple toy tests. FWIW, I called this A^.
TomMD