Pathfinding Lab

Draw walls, move nodes, then watch algorithms search in real time.

← Back to Portal

Ready to visualize A* Search

Draw mode

How to read the search

1. Frontier

The frontier is the algorithm's to-do list. These are cells it has discovered but has not fully explored yet.

2. Visited

Visited cells have already been processed. Once a cell is visited, the algorithm usually does not need to check it again.

3. Previous pointers

When a cell is discovered, it remembers which cell found it. At the end, the yellow path is built by following those breadcrumbs backward.

4. Heuristics

A heuristic is an educated guess. A* and Greedy use Manhattan distance: how many grid steps away the target looks if there were no walls.

5. Guarantees

BFS, Dijkstra, and A* can find shortest paths in this grid. DFS and Greedy can be fast or interesting, but they can choose poor routes.

Try this

  • Generate a maze and compare A* vs DFS.
  • Draw a wall trap and watch Greedy get fooled.
  • Lower speed delay to see the full search shape.