Professional Documents
Culture Documents
Spring 2017
Informed Search
Cesare Tinelli
a These notes were originally developed by Stuart Russell and are used with permission. They are
copyrighted material and may not be used in other course settings outside of the University of Iowa in their
current or modified form without the express written consent of the copyright holders.
They are almost always more efficient than uninformed searches and
often also optimal
I.e., the right choice of nodes is not always the one suggested by f
I.e., the right choice of nodes is not always the one suggested by f
Note: There are problems that do not satisfy one or more of these
assumptions
Special cases:
• greedy search
• A* search
Special cases:
• greedy search
• A* search
Typically, strategies use estimates of the cost of reaching the goal and
try to minimize it
Typically, strategies use estimates of the cost of reaching the goal and
try to minimize it
Straight−line distance
Oradea to Bucharest
71
Neamt Arad 366
Bucharest 0
Zerind 87
75
151 Craiova 160
Iasi Dobreta 242
Arad
140
Eforie 161
92 Fagaras 178
Sibiu Fagaras
99 Giurgiu 77
118 Hirsova 151
Vaslui
80 Iasi 226
Rimnicu Vilcea Lugoj
Timisoara 244
Mehadia 241
142
111 Pitesti 211 Neamt 234
Lugoj 97 Oradea 380
70 98 Pitesti 98
85 Hirsova
Mehadia 146 101 Urziceni Rimnicu Vilcea 193
86 Sibiu 253
75 138 Bucharest Timisoara 329
Dobreta 120 Urziceni
90
80
Craiova Eforie Vaslui 199
Giurgiu Zerind 374
Arad
366
Arad
Arad
Arad
Sibiu Bucharest
253 0
Time complexity?
Space complexity?
Optimal?
Time complexity?
Space complexity?
Optimal?
Space complexity?
Optimal?
Optimal?
Optimal? No
Optimal? No
A* search
• combines the two by minimizing f (n) = g(n) + h(n)
• is, under reasonable assumptions, optimal and complete, and
also informed
Arad
366=0+366
Arad
Arad
Arad
Arad
Arad
5 40 real cost = 1
G
3 5 0
Note:
• Consistent ⇒ admissible
• Most consistent heuristics are also admissible
CS:4420 Spring 2017 – p.18/31
A* Search
Let h be any admissible heuristic function
G G2
N
Z
I
A
380 S
F
V
400
T R
L P
H
M U
B
420
D
E
C
G
Time complexity?
Space complexity?
Optimal?
Time complexity?
Space complexity?
Optimal?
Space complexity?
Optimal?
Optimal?
However, there are some general techniques that work reasonably well
across several domains
7 2 4 5
1 2 3
5 6 4 5 6
8 3 1 7 8
• h1 (Start) =
• h2 (Start) =
7 2 4 5
1 2 3
5 6 4 5 6
8 3 1 7 8
• h1 (Start) = 7
• h2 (Start) =
7 2 4 5
1 2 3
5 6 4 5 6
8 3 1 7 8
• h1 (Start) = 7
• h2 (Start) = 4+0+3+3+1+0+2+1 = 14
xd + xd−1 + · · · + x2 + x + 1 − N = 0
Original problem: Find the shortest tour visiting n cities exactly once
Complexity: NP-complete
Relaxed problem: Find a tree with the smallest cost that connects the
n cities (minimum spanning tree)
Complexity: O(n2 )
Cost of tree is a lower bound on the shortest (open) tour.
• Pattern databases
• Learning