← back to portfolio

Pathfinding Visualizer

How does an automated guided vehicle find its way through a factory hall? Draw obstacles, mark slow zones and watch Dijkstra, A* and Greedy Best-First search for a route from start to goal.

Algorithm
Draw
Speed
Layouts

Click & drag to draw · drag the start / goal to move them · after a run, edits update the route live

Visited nodes
–
Path length
–
Path cost
–
Compute time
–
> ready

Compare all three

AlgorithmVisitedLengthCostTime
Run all three algorithms on the current layout.

Legend

Start
Goal
Wall (blocked)
Slow zone (cost 5)
Visited (old → new)
Final route

Moving through a normal cell costs 1, a slow zone (e.g. a pedestrian walkway) costs 5. Movement is 4-directional.

Dijkstra

Expands nodes strictly in order of their distance from the start, like a wave. It knows nothing about where the goal is, so it explores in every direction.

optimal routemany visited nodes O((V + E) log V)

A*

Dijkstra plus a heuristic: it ranks nodes by f = g + h, the cost so far plus the estimated (Manhattan) distance to the goal. The estimate never overshoots, so the route stays optimal.

optimal routefocused search O((V + E) log V)

Greedy Best-First

Only looks at the heuristic and always heads for whatever seems closest to the goal. Very fast, but it ignores what the route has already cost.

few visited nodesnot optimal O((V + E) log V)