Академический Документы
Профессиональный Документы
Культура Документы
410/413
Principles of Autonomy and Decision Making
Lecture 14: Informed Search
Emilio Frazzoli
Aeronautics and Astronautics
Massachusetts Institute of Technology
November 1, 2010
E. Frazzoli (MIT)
November 1, 2010
1 / 46
Outline
Optimal search
Dynamic Programming
E. Frazzoli (MIT)
November 1, 2010
2 / 46
A step back
We have seen how we can discretize collision-free trajectories into a
finite graph.
Searching for a collision-free path can be converted into a graph search.
Hence, we can solve such problems using the graph search algorithms
discussed in Lectures 2 and 3 (Breadth-First Search, Depth-First Search,
etc.).
E. Frazzoli (MIT)
November 1, 2010
3 / 46
A step back
We have seen how we can discretize collision-free trajectories into a
finite graph.
Searching for a collision-free path can be converted into a graph search.
Hence, we can solve such problems using the graph search algorithms
discussed in Lectures 2 and 3 (Breadth-First Search, Depth-First Search,
etc.).
However, roadmaps are not just generic graphs.
Some paths are much more preferable with respect to others
(e.g., shorter, faster, less costly in terms of fuel/tolls/fees, more stealthy,
etc.).
Distances have a physical meaning.
Good guesses for distances can be made, even without knowing optimal
paths.
E. Frazzoli (MIT)
November 1, 2010
3 / 46
A step back
We have seen how we can discretize collision-free trajectories into a
finite graph.
Searching for a collision-free path can be converted into a graph search.
Hence, we can solve such problems using the graph search algorithms
discussed in Lectures 2 and 3 (Breadth-First Search, Depth-First Search,
etc.).
However, roadmaps are not just generic graphs.
Some paths are much more preferable with respect to others
(e.g., shorter, faster, less costly in terms of fuel/tolls/fees, more stealthy,
etc.).
Distances have a physical meaning.
Good guesses for distances can be made, even without knowing optimal
paths.
November 1, 2010
3 / 46
E. Frazzoli (MIT)
November 1, 2010
4 / 46
November 1, 2010
5 / 46
Uniform-Cost Search
Q hstarti ;
// Initialize the queue with the starting node
while Q is not empty do
Pick (and remove) the path P with lowest cost g = w (P) from the queue Q ;
if head(P) = goal then return P ;
// Reached the goal
foreach vertex v such that (head(P), v ) E , do
//for all neighbors
add hv , Pi to the queue Q ;
// Add expanded paths
return FAILURE ;
E. Frazzoli (MIT)
November 1, 2010
6 / 46
Uniform-Cost Search
Q hstarti ;
// Initialize the queue with the starting node
while Q is not empty do
Pick (and remove) the path P with lowest cost g = w (P) from the queue Q ;
if head(P) = goal then return P ;
// Reached the goal
foreach vertex v such that (head(P), v ) E , do
//for all neighbors
add hv , Pi to the queue Q ;
// Add expanded paths
return FAILURE ;
E. Frazzoli (MIT)
November 1, 2010
6 / 46
c
3
Q:
path
hsi
cost
0
E. Frazzoli (MIT)
start
November 1, 2010
7 / 46
Q:
path
ha, si
hb, si
start
E. Frazzoli (MIT)
cost
2
5
November 1, 2010
8 / 46
Q:
state
hc, a, si
hb, si
hd, a, si
cost
4
5
6
start
E. Frazzoli (MIT)
November 1, 2010
9 / 46
Q:
state
hb, si
hd, a, si
hd, c, a, si
cost
5
6
7
start
E. Frazzoli (MIT)
November 1, 2010
10 / 46
Q:
state
hd, a, si
hd, c, a, si
hg , b, si
cost
6
7
10
start
E. Frazzoli (MIT)
November 1, 2010
11 / 46
Q:
state
hd, c, a, si
hg , d, a, si
hg , b, si
cost
7
8
10
start
E. Frazzoli (MIT)
November 1, 2010
12 / 46
Q:
state
hg , d, a, si
hg , d, c, a, si
hg , b, si
cost
8
9
10
start
E. Frazzoli (MIT)
November 1, 2010
13 / 46
Remarks on UCS
E. Frazzoli (MIT)
November 1, 2010
14 / 46
E. Frazzoli (MIT)
November 1, 2010
15 / 46
Q hstarti;
// Initialize the queue with the starting node
while Q is not empty do
Pick the path P with minimum heuristic cost h(head(P)) from the queue Q;
if head(P) = goal then return P ;
// We have reached the goal
foreach vertex v such that (head(P), v ) E , do
add hv , Pi to the queue Q;
return FAILURE ;
E. Frazzoli (MIT)
November 1, 2010
16 / 46
c
1
3
Q:
path
hsi
cost
0
h
10
a
2
E. Frazzoli (MIT)
g
0
start
d
4
s
10
b
3
November 1, 2010
17 / 46
c
1
Q:
path
ha, si
hb, si
cost
2
5
h
2
3
a
2
d
4
g
0
start
E. Frazzoli (MIT)
s
10
b
3
November 1, 2010
18 / 46
c
1
Q:
path
hc, a, si
hb, si
hd, a, si
cost
4
5
6
h
1
3
4
a
2
d
4
g
0
start
E. Frazzoli (MIT)
s
10
b
3
November 1, 2010
19 / 46
c
1
Q:
path
hb, si
hd, a, si
hd, c, a, si
cost
5
6
7
h
3
4
4
a
2
d
4
g
0
start
E. Frazzoli (MIT)
s
10
b
3
November 1, 2010
20 / 46
c
1
Q:
path
hg , b, si
hd, a, si
hd, c, a, si
cost
10
6
7
h
0
4
4
a
2
d
4
g
0
start
E. Frazzoli (MIT)
s
10
b
3
November 1, 2010
21 / 46
E. Frazzoli (MIT)
November 1, 2010
22 / 46
Outline
Optimal search
A search
Dynamic Programming
E. Frazzoli (MIT)
November 1, 2010
23 / 46
E. Frazzoli (MIT)
November 1, 2010
24 / 46
November 1, 2010
24 / 46
A Search
Q hstarti;
// Initialize the queue with the starting node
while Q is not empty do
Pick the path P with minimum estimated cost f (P) = g (P) + h(head(P))
from the queue Q;
if head(P) = goal then return P ;
// We have reached the goal
foreach vertex v such that (head(P), v ) E , do
add hv , Pi to the queue Q;
return FAILURE ;
E. Frazzoli (MIT)
November 1, 2010
25 / 46
c
1
3
Q:
path
hsi
g
0
h
10
f
10
a
2
E. Frazzoli (MIT)
g
0
start
d
5
s
10
b
3
November 1, 2010
26 / 46
c
1
Q:
path
ha, si
hb, si
g
2
5
h
2
3
f
4
8
a
2
d
5
g
0
start
E. Frazzoli (MIT)
s
10
b
3
November 1, 2010
27 / 46
c
1
Q:
path
hc, a, si
hb, si
hd, a, si
g
4
5
6
h
1
3
5
f
5
8
11
a
2
d
5
g
0
start
E. Frazzoli (MIT)
s
10
b
3
November 1, 2010
28 / 46
c
1
Q:
path
hb, si
hd, a, si
hd, c, a, si
g
5
6
7
h
3
5
5
f
8
11
12
a
2
d
5
g
0
start
E. Frazzoli (MIT)
s
10
b
3
November 1, 2010
29 / 46
c
1
Q:
path
hg , b, si
hd, a, si
hd, c, a, si
g
10
6
7
h
0
5
5
f
10
11
12
a
2
d
5
g
0
start
E. Frazzoli (MIT)
s
10
b
3
November 1, 2010
30 / 46
E. Frazzoli (MIT)
November 1, 2010
31 / 46
c
1
3
Q:
path
hsi
g
0
h
10
f
10
a
2
E. Frazzoli (MIT)
g
0
start
d
1
s
6
b
3
November 1, 2010
32 / 46
c
1
Q:
path
ha, si
hb, si
g
2
5
h
2
3
a
2
d
1
g
0
start
E. Frazzoli (MIT)
f
4
8
s
6
b
3
November 1, 2010
33 / 46
c
1
Q:
path
hc, a, si
hd, a, si
hb, si
g
4
6
5
h
1
1
3
f
5
7
8
a
2
d
1
g
0
start
E. Frazzoli (MIT)
s
6
b
3
November 1, 2010
34 / 46
c
1
Q:
path
hd, a, si
hb, si
hd, c, a, si
g
6
5
7
h
1
3
1
f
7
8
8
a
2
d
1
g
0
start
E. Frazzoli (MIT)
s
6
b
3
November 1, 2010
35 / 46
c
1
Q:
path
hg , d, a, si
hb, si
hd, c, a, si
g
8
5
7
h
0
3
1
f
8
8
8
a
2
d
1
g
0
start
E. Frazzoli (MIT)
s
6
b
3
November 1, 2010
36 / 46
By contradiction
Assume that A returns P, but w (P) > w
(w is the optimal path weight/cost).
Find the first unexpanded node on the optimal path P , call it n.
f (n) > w (P), otherwise we would have expanded n.
f (n) = g (n) + h(n) by definition
= g (n) + h(n) because n is on the optimal path.
g (n) + h (n) because h is admissible
= f (n) = W because h is admissible
Hence W f (n) > W , which is a contradiction.
E. Frazzoli (MIT)
November 1, 2010
37 / 46
Admissible heuristics
How to find an admissible heuristic? i.e., a heuristic that never
overestimates the cost-to-go.
E. Frazzoli (MIT)
November 1, 2010
38 / 46
Admissible heuristics
How to find an admissible heuristic? i.e., a heuristic that never
overestimates the cost-to-go.
Examples of admissible heuristics
h(v ) = 0: this always works! However, it is not very useful, and in
this case A = UCS.
h(v ) = distance(v , g ) when the vertices of the graphs are physical
locations.
h(v ) = kv g kp , when the vertices of the graph are points in a
normed vector space.
E. Frazzoli (MIT)
November 1, 2010
38 / 46
Admissible heuristics
How to find an admissible heuristic? i.e., a heuristic that never
overestimates the cost-to-go.
Examples of admissible heuristics
h(v ) = 0: this always works! However, it is not very useful, and in
this case A = UCS.
h(v ) = distance(v , g ) when the vertices of the graphs are physical
locations.
h(v ) = kv g kp , when the vertices of the graph are points in a
normed vector space.
A general method
Choose h as the optimal cost-to-go function for a relaxed problem, that is
easy to compute.
(Relaxed problem: ignore some of the constraints in the original problem)
E. Frazzoli (MIT)
November 1, 2010
38 / 46
Initial state:
1
2
7
6
4
5
3
8
Goal state:
1
4
7
2
5
8
3
6
E. Frazzoli (MIT)
November 1, 2010
39 / 46
Initial state:
1
2
7
6
4
5
3
8
Goal state:
1
4
7
2
5
8
3
6
E. Frazzoli (MIT)
November 1, 2010
39 / 46
Initial state:
1
2
7
6
4
5
3
8
Goal state:
1
4
7
2
5
8
3
6
E. Frazzoli (MIT)
November 1, 2010
39 / 46
Initial state:
1
2
7
6
4
5
3
8
Goal state:
1
4
7
2
5
8
3
6
E. Frazzoli (MIT)
November 1, 2010
39 / 46
November 1, 2010
40 / 46
Consistent heuristics
An additional useful property for A heuristics is called consistency
A heuristic h : X R0 is said consistent if
h(u) w (e = (u, v )) + h(v ),
(u, v ) E .
November 1, 2010
41 / 46
Outline
Optimal search
Dynamic Programming
E. Frazzoli (MIT)
November 1, 2010
42 / 46
Dynamic Programming
The optimality principle
Let P = (s, . . . , v , . . . g ) be an optimal path (from s to g ). Then, for any
v P, the sub-path S = (v , . . . , g ) is itself an optimal path (from v to g ).
Using the optimality principle
Essentially, optimal paths are made of optimal paths. Hence, we can
construct long complex optimal paths by putting together short
optimal paths, which can be easily computed.
Fundamental formula in dynamic programming:
h (u) = min [w ( (u, v ) ) + h (v )] .
(u,v )E
November 1, 2010
43 / 46
h(v
+ w (e)} {Relax costs}
Recovering optimal paths
The output of Dijkstras algorithm is in fact the optimal cost-to-go
function, h .
From any vertex, we can compute the optimal outgoing edge via the
dynamic programming equation.
E. Frazzoli (MIT)
November 1, 2010
44 / 46
Inf
Inf
0
Inf
0
4
November 1, 2010
45 / 46
Concluding remarks
A optimal and very effective in many situations. However, in some
applications, it requires too much memory. Some possible approaches
to address this problem include
Branch and bound
Conflict-directed A
Anytime A
November 1, 2010
46 / 46
MIT OpenCourseWare
http://ocw.mit.edu
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms .