Ever wanted to know the fastest way to get somewhere, but Apple Maps keeps telling you to drive off of a cliff? Here’s how to do it yourself… For just how the algorithm works: skip to 2:56!

Part 2, which will cover the black magics of A* search, is here! https://www.youtube.com/watch?v=5hrfAefUflY&lc=Ugy34gFhr1XtmPdmZ8J4AaABAg

Let me know in the comments if there’s any other algorithms/concepts I should cover!
Facebook: https://www.facebook.com/llamaexplains/

Play around in this awesome path-finding comparison site here: https://qiao.github.io/PathFinding.js/visual/

Pseudocode for Dijkstra’s:

S = start node
S.path = S
Add S to frontier
Repeat:
Remove node N with smallest cost C from frontier
Add N to explored
If isEnd(N) : return N.path
For each edge E of N:
Get adjacent node N’
If N’ not already in explored:
N’.path = N.path + N’
Update frontier with N’ which has cost C+E.cost