Professional Documents
Culture Documents
2 Search6 Final
2 Search6 Final
Textbook 3.7.3
January 24, 2011
Lecture Overview
Recap from last week
Iterative Deepening
Slide 2
i =1
Heuristic search
Def.:
A search heuristic h(n) is an estimate of the cost of the optimal
(cheapest) path from node n to a goal node.
Estimate: h(n1)
n1
n2
Estimate: h(n2)
n3
Estimate: h(n3)
5
A*
Expands the path with the lowest cost + h value on the
frontier
The frontier is implemented as a priority queue ordered
by f(p) = cost(p) + h(p)
Admissibility of a heuristic
Def.:
Let c(n) denote the cost of the optimal path from node n to any
goal node. A search heuristic h(n) is called
admissible if h(n) c(n) for all nodes n, i.e. if for all nodes it
is an underestimate of the cost to any goal.
Admissibility of A*
A* is complete (finds a solution, if one exists) and
optimal (finds the optimal path to a goal) if:
the branching factor is finite
arc costs are > 0
h is admissible.
12
Optimal
Time
Space
DFS
N
(Y if no cycles)
O(bm)
O(mb)
BFS
O(bm)
O(bm)
LCFS
(when arc costs available)
Y
Costs > 0
Y
Costs 0
O(bm)
O(bm)
Best First
(when h available)
O(bm)
O(bm)
A*
(when arc costs and h
available)
Y
Costs > 0
h admissible
Y
Costs 0
h admissible
O(bm)
O(bm)
13
Lecture Overview
Recap from last week
Iterative Deepening
14
Optimal
Time
Space
DFS
N
(Y if no cycles)
O(bm)
O(mb)
BFS
O(bm)
O(bm)
LCFS
(when arc costs available)
Y
Costs > 0
Y
Costs >=0
O(bm)
O(bm)
Best First
(when h available)
O(bm)
O(bm)
A*
(when arc costs and h
available)
Y
Costs > 0
h admissible
Y
Costs >=0
h admissible
O(bm)
O(bm)
15
depth = 2
depth = 3
...
Total # of paths
at that level
#times created by
BFS (or DFS)
b2
.
.
.
.
.
.
.
.
.
m-1
bm-1
bm
.
.
.
m
m-1
2
1
mb
(m-1) b2
.
.
.
2 bm-1
bm
17
i =1
i =1
= b m ( ib1i ) = b m ( i (b 1 ) i 1 )
2
m b
m
b ( i (b ) ) = b
=
b
O(b )
1
i =0
b 1
1 b
1
i
Geometric progression: for |r|<1: r =
1 r
i =0
d
1
i
i 1
r = ir =
2
dr i =0
(
1
r
)
i =0
m
1 i 1
O(bm)
O(mb)
O(bm)
O(b+m)
Complete? Yes
No
Optimal?
Yes
No
Proof by contradiction
19
Optimal
Time
Space
DFS
N
(Y if no cycles)
O(bm)
O(mb)
BFS
O(bm)
O(bm)
IDS
O(bm)
O(mb)
LCFS
(when arc costs available)
Y
Costs > 0
Y
Costs >=0
O(bm)
O(bm)
Best First
(when h available)
O(bm)
O(bm)
A*
(when arc costs and h
available)
Y
Costs > 0
h admissible
Y
Costs >=0
h admissible
O(bm)
O(bm)
20
21
O(bm)
O(mb)
O(bm)
O(b+m)
22
23
Optimal
Time
Space
DFS
N
(Y if no cycles)
O(bm)
O(mb)
BFS
O(bm)
O(bm)
IDS
O(bm)
O(mb)
LCFS
(when arc costs available)
Y
Costs > 0
Y
Costs >=0
O(bm)
O(bm)
Best First
(when h available)
O(bm)
O(bm)
A*
(when arc costs and h
available)
Y
Costs > 0
h admissible
Y
Costs >=0
h admissible
O(bm)
O(bm)
IDA*
Y (same cond.
as A*)
O(bm)
O(mb)
Y (same cond.
as A*)
O(bm)
O(mb)
Announcements:
New practice exercises are out: see WebCT
Heuristic search
Branch & Bound
Please use these! (Only takes 5 min. if you understood things)
Assignment 1 is out: see WebCT
25