What is the best algorithm to find a short path from start position to destination? Speed of search is most important. i.e. It doesn't need to find the absolute minimum path, as long as it find a reasonable path quickly.
I've been trying first of all to set up a kind of wave front. First calculating where the destination is in relation to S and then doing this:
1st iteration: -> Destination is somewhere this way ->
1 2 3
n1
S n2
n3
1 2 3 4 5 6
2nd
h11
n1 n12
S n2 n22
n3 n31
n32
And deleting paths which hit obstacles. This seems to be a very expensive search though. :S
Efficiency is very important though. A* does a lot of checks to find the shortest solution. However, I am willing to sacrifice definitely finding the fastest route to improve efficiency.
you have to connect open cells together, and modify the find() function so that find(start) pushs the route to queue A, and find(end) pushs the route to stack B, and if they are connected then join the route from queue B and stack A together.
This was just a quick example code. The real situation will always have a possible path (usually several). Never seen union-find before. Will have to read up on that!