3

I am currently studying pathfinding and I came across A* algorithm from this site https://github.com/qiao/PathFinding.js

I tried to test A* with bi-directional and it is working great.

An a* path

What I wanna do now is increase the path that it can make without adding more nodes in the openlist.

For example is that the algorithm was able to find a path but as you look at the results it can still generate one more path without touching the other path.

two distinct paths

Any ideas?

Macross
  • 41
  • 4

1 Answers1

5

For finding

one more path without touching the other path

just remove the squares of the first path (except the start and ending square) from the map and run A* again.

Doc Brown
  • 199,015
  • 33
  • 367
  • 565
  • meaning make it like blockable? though.. if you will run the pathfinder again.. isnt it using too much resources? there is really no other way? – Macross Mar 13 '14 at 23:08
  • @Macross: yes, you have to block the squares you want to exclude from your second search. No, I don't think there's a better way, since when squares become blocked, this can change the whole topology of your search graph. – Doc Brown Mar 14 '14 at 04:39
  • well, I guess you are right... I tried to apply it and it also gives gives quite some good results. Thank you... – Macross Mar 14 '14 at 17:46