Greedy Best-First vs A* Search
Same maze, same speed, first to the exit wins. On this maze Greedy Best-First gets there first and turns gold.
The numbers
- Greedy explored
- 622 cells
- Greedy path
- 421 steps
- A* explored
- 931 cells
- A* path
- 201 steps
Greedy Best-First
Greedy Best-First Search always moves to the cell that looks closest to the exit, ignoring how far it has already come. More on Greedy Best-First.
A* Search
A* search explores the cells that look closest to the exit first, while still guaranteeing the shortest path. More on A* Search.
FAQ
Which is faster in a maze, Greedy Best-First or A* Search?
On this maze Greedy Best-First reached the exit first, after exploring 622 cells to 931. On other mazes the result can flip; tap the shuffle button for another race.
How is the race fair?
Both solvers run on the same maze and explore the same number of cells per frame. Whoever explores fewer cells before reaching the exit finishes first and turns gold.
Which one finds the shorter path?
A* Search: 201 steps to 421. Exploring fewer cells and finding the shorter path are different things.