Path Finding

Legend

Empty
Source
Destination
Explored
Path

Algorithms

  • BFS (Breath First Search): Will get the shortest path but explores a lot of unnecessary locations. Like exploring in each direction equally. Implemented with a queue.
  • DFS (Depth First Search): Might not get the shortest path and might also explore a lot more or a lot less unnecessary locations than BFS. Like picking a route and sticking to it until it runs out. Implemented with recursion.
  • A* Search Algorithm: Will get the shortest path and with the right heuristic function will explore minimal locations. Like exploring with a compass. Implemented with a priority queue.

These are some interesting single source shortest path algorithms on a homogeneous distance grid. Click on the cells to remove terrain and see the pathfinding algorithms in action.

Note: no mobile support for this yet.