Skip to content

Maze

BFS, DFS, Dijkstra, A* and Greedy solve the same maze — watch how each one explores and compare what it costs.

View code on GitHub (opens in a new tab)

Maze ready. Press Solve to race the five algorithms.

Race

BFS

Not solved yet

DFS

Not solved yet

Dijkstra

Not solved yet

A*

Not solved yet

Greedy

Not solved yet

  • explored
  • frontier
  • path
  • mud (cost 5)
  • start
  • goal
How the algorithms compare
AlgorithmExploredPath lengthPath costTimeMax frontier
BFS—————
DFS—————
Dijkstra—————
A*—————
Greedy—————