r/programming • • Apr 23 '13

PathFinding algorithm, visually explained

http://qiao.github.io/PathFinding.js/visual/
2.2k Upvotes

230 comments sorted by

View all comments

Show parent comment

4

u/gendulf Apr 24 '13

It's probably using Euclidean distance as the heuristic (as opposed to manhattan distance). It gets closer by going right at that point.

If you look at the shape it takes from the edge of the wall to the end point, it looks like a straight line you would draw in mspaint.

2

u/jadkik94 Apr 24 '13

Oh, interesting. I never thought there would be so many different ways to do this... Last year I tried to do this to solve mazes (rectilinear "roads") without knowing all the theory, I realize now how bad it is...