bgrins / javascript-astar

A* Search / Pathfinding Algorithm in Javascript
https://briangrinstead.com/blog/astar-search-algorithm-in-javascript-updated/
MIT License
1.35k stars 323 forks source link

Reversed A Star? #68

Open Bobingstern opened 3 years ago

Bobingstern commented 3 years ago

Is it possible to reverse the algorithm to get the longest path?

seamuskills commented 3 years ago

interesting idea but with the way it values the cells, the path would just go backward and never arrive at your destination.

Bobingstern commented 3 years ago

Actually it would eventually reach the destination filling the whole grid and result in the worst possible path :)