Lecture 3 - Informed Search
Lecture 3 - Informed Search
Chapter 3
Informed Search
Today: Course Objectives
Informed Search
Heuristics
Greedy Search
A* Search
Graph Search
Recap: Search
Recap: Search
Search problem:
States (configurations of the world)
Actions and costs
Successor function (world dynamics)
Start state and goal test
Search tree:
Nodes: represent plans for reaching states
Plans have costs (sum of action costs)
Search algorithm:
Systematically builds a search tree
Chooses an ordering of the fringe (unexplored nodes)
Optimal: finds least-cost plans
Example: Pancake Problem
4
2 3
2
3
4
3
4 2
3 2
2
4
3
General Tree Search
The bad:
Explores options in every “direction”
No information about goal location Start Goal
10
5
11.2
Example: Heuristic Function
h(x)
Example: Heuristic Function
Heuristic: the number of the largest pancake that is still out of place
3
4
h(x)
3
4
3 0
4
4 3
4
4 2
3
Greedy Search
Example: Heuristic Function
h(x)
Greedy Search
Expand the node that seems closest…
A common case:
Best-first takes you straight to the (wrong) goal b
…
UCS Greedy
A*
Combining UCS and Greedy
Uniform-cost orders by path cost, or backward cost g(n)
Greedy orders by goal proximity, or forward cost h(n)
8 g=0
S h=6
h=1 g=1
e a
1 h=5
1 3 2 g=2 g=9
S a d G
h=6 b d g=4 e h=1
h=6 h=5 h=2
1 h=2 h=0
1 g=3 g=6
c b g = 10
h=7 c G h=0 d
h=2
h=7 h=6
g = 12
A* Search orders by the sum: f(n) = g(n) + h(n) G h=0
2 A 2
S h=3 h=0 G
2 B 3
h=1
Uniform-Cost A*
b b
… …
UCS vs A* Contours
366
15
A S (0+2)
1
1
S h=4
C
h=1 A (1+4) B (1+1)
h=2 1
2
3 C (2+1) C (3+1)
B
h=1
G (5+0) G (6+0)
G
h=0
Consistency of Heuristics
Main idea: estimated heuristic costs ≤ actual costs
Graph search:
A* optimal if heuristic is consistent
UCS optimal (h = 0 is consistent)