Pathfinding Visualizer

Draw walls and terrain, place teleport portals, and watch six pathfinding algorithms search a grid in real time — BFS, Greedy Best-First, Dijkstra, A*, bidirectional BFS, and bidirectional Dijkstra.

Draw walls, layer in sand/mud/water (costs 3, 5, and 10), link two cells with a teleport portal, and optionally allow diagonal movement — then race six algorithms against each other on the same board: BFS, Greedy Best-First Search, Dijkstra, A*, bidirectional BFS, and bidirectional Dijkstra. BFS and greedy best-first ignore terrain cost; the other four respect it and route around expensive terrain instead of cutting straight through. The comparison table shows exactly how many cells each one visits to find its answer — and whether that answer is actually optimal.

brush:
pick an algorithm and hit visualize
start end wall sand, cost 3 mud, cost 5 water, cost 10 portal (tap "place portal", then two cells) visited path
pick a brush above, then drag on the grid to paint it — works the same with mouse or finger. drag the start/end dots to move them. portals teleport for a flat cost of 1, whatever the geometric distance between them. toggle "diagonal movement" to allow 8-directional moves (diagonal steps cost √2× the destination's terrain cost).