Search Tree Simulator
Compare BFS, DFS, uniform cost and greedy heuristic search on one search tree.
Breadth First Search: start with S in the frontier. Goal is G.
step 1 of 16
expandingin frontierexpandedundiscoverededge numbers are step costs
Breadth First Search
FIFO queue. Finds the shallowest goal, which is only cheapest when every step costs the same.
- Optimal?
- Only with uniform step costs
- Nodes expanded
- 0
Queue (FIFO)
| Node | g | h | f |
|---|---|---|---|
| S | 0 | 7 | 7 |
g = cost so far, h = estimate remaining, f = g + h
Your problem
| Node | step cost | h |
|---|---|---|
| S | ||
| A | ||
| C | ||
| D | ||
| Ggoal | ||
| B | ||
| E | ||
| F |
Change the numbers and run all five strategies on the same tree. Inflate a heuristic past the real remaining cost and A* stops being optimal — that is what “admissible” means, and you can break it here.
← → to step, or use the buttons above.