Tree and graph search
Runs breadth-first, depth-first, depth-limited, iterative deepening, uniform-cost, greedy best-first, A*, and weighted A* search on a graph, one step at a time, with the state space, the search tree, and the frontier side by side.
- Lecture reference: Solving Problems by Searching · slides 27–43
- Lecture reference: Uninformed Search · slides 3–44
- Lecture reference: Informed Search · slides 7–38
Problem 20 states · 23 edges
- Start
- Arad
- Goal
- Bucharest
- h(n)
- Straight-line distance to Bucharest
A* search example. f(n) = g(n) + h(n) under every node, from 366=0+366 at Arad to 418=418+0 at Bucharest.
Lecture reference: Informed Search · slides 17–22Edit graph
Strategy A* search
State space with h(n)
Search tree
Frontier
1 node Priority queue ordered by f(n) = g(n) + h(n)- next Arad 366=0+366
Expansion order
0 of 6 nodes taken off the frontier
With focus in the tool: ← → previous and next step, Home End first and last step, Space play or pause.
Result
Solution Solution: Arad → Sibiu → Rimnicu Vilcea → Pitesti → Bucharest (cost 418). 6 nodes taken off the frontier, 5 expanded, 16 generated.
- Taken off the frontier
- 6
- Expanded
- 5
- Generated
- 16
- Largest frontier
- 11
Cheapest path This is a cheapest path (cost 418).
Questions from the slides
Properties of depth-first search: complete?
Lecture reference: Uninformed Search · slide 32Show answer
How can we fix the greedy problem?
Lecture reference: Informed Search · slide 15Show answer
A* gone wrong?
Lecture reference: Informed Search · slide 27