r/programming • u/hazadess • Apr 23 '13
PathFinding algorithm, visually explained
http://qiao.github.io/PathFinding.js/visual/
2.2k
Upvotes
r/programming • u/hazadess • Apr 23 '13
View all comments
Show parent comment
3
u/babada Apr 24 '13
I think the animation is just highlighting the path comparisons. It doesn't need to compare paths for each cell; all it needs to know is that the cell is "empty".
Or, in other words, the trick to JPS is that it splits things into two phases: (a) find the next jump point; (b) compare the path. (a) is a trivial algorithm that simply scans through cells looking for either a blocked cell or the end of a "rectangle".
How that relates to the animation is confusing and non-intuitive. It would have been handy to see it scanning the cells and which cells/paths are getting compared.