Beruflich Dokumente
Kultur Dokumente
Heuristic Search
Best-First Search
Best-First Example
Arad
h=366
Arad
Sibiu
h=253
Timisoara
h=329
Zerind
h=374
Arad
Sibiu
Timisoara
h=329
Arad
Fagaras
Oradea
h=366
h=178
h=380
Zerind
h=374
Arad
Rimnicu
h=193
Sibiu
Timisoara
h=329
Oradea
71
Neamt
Zerind
87
151
75
Iasi
Arad
140
Sibiu
92
99
Fagaras
118
Vaslui
80
Rimnicu Vilcea
Timisoara
111
Lugoj
142
211
Pitesti
97
70
98
Mehadia
75
Dobreta
146
85
101
Hirsova
Urziceni
86
138
Bucharest
120
Craiova
90
Giurgiu
Eforie
Straightline distance
to Bucharest
Arad
366
Bucharest
0
Craiova
160
Dobreta
242
Eforie
161
Fagaras
178
Giurgiu
77
Hirsova
151
Iasi
226
Lugoj
244
Mehadia
241
Neamt
234
Oradea
380
Pitesti
98
Rimnicu Vilcea 193
Sibiu
253
Timisoara
329
Urziceni
80
Vaslui
199
Zerind
374
Arad
Fagaras
h=366
Sibiu
h=253
Zerind
h=374
Oradea
Rimnicu
h=380
h=193
Bucharest
h=0
Best-First Properties
Beam Search
Space and time complexity of storing and sorting the complete
Focuses search more but may eliminate solution even for finite
Worst case time complexity is still O(bm) where m is the
maximum depth.
seach graphs
Sibiu
h=253
Timisoara
h=329
Zerind
h=374
Arad
Sibiu
Timisoara
Zerind
h=329
Arad
Fagaras
Oradea
h=366
h=178
h=380
h=374
Arad
Rimnicu
h=193
Sibiu
Timisoara
h=329
Arad
Fagaras
h=366
Sibiu
h=253
Zerind
h=374
Oradea
Rimnicu
h=380
h=193
Bucharest
h=0
Hill-Climbing
evaluation
current
state
A* Example
Arad
f=0+366
=366
Sibiu
f=140+253
=393
Optimality of A*
If h is admissible, A* will always find a least cost path to the
Arad
goal.
Timisoara
f=118+329
=447
Zerind
f=75+374
=449
Sibiu
Arad
Timisoara
f=118+329
=447
Zerind
Proof by contradiction:
f=75+374
=449
Arad
Fagaras
Oradea
Rimnicu
f=220+193
f=146+380
f=239+178
f=280+366
=413
=526
=417
=646
Arad
Sibiu
Timisoara
Zerind
f=118+329
f=75+374
=447
=449
Arad
Fagaras
Oradea
Rimnicu
f=280+366
f=239+178
f=146+380
=646
=417
=526
Craiova
Pitesti
Sibiu
f=366+160
f=317+98
f=300+253
=526
=415
=553
Therefore:
f* >= f(G2)
Since G2 is a goal state, h(G2)=0, therefore
f(G2) = g(G2)
f* >= g(G2)
Therefore G2 is optimal.
Contradiction.
Q.E.D.
10
Other Properties of A*
Heuristic Functions
A* is complete as long as
-Branching factor is always finite
-Every operator adds cost at least > 0
5
1
88
6
8
22
Admissible Heuristics:
-Number of tiles out of place (h1): 7
-City-block (Manhattan) distance (h2):
12
3
84
Goal State
Start State
2+3+3+2+4+2+0+2=18
11
4
2
25
Heuristic Performance
Quality of Heuristics
IDS
A*(h1 )
A*(h2 )
IDS
A*(h1 )
A*(h2 )
2
4
6
8
10
12
14
16
18
20
22
24
10
112
680
6384
47127
364404
3473941
6
13
20
39
93
227
539
1301
3056
7276
18094
39135
6
12
18
25
39
73
113
211
363
676
1219
1641
2.45
2.87
2.73
2.80
2.79
2.78
2.83
1.79
1.48
1.34
1.33
1.38
1.42
1.44
1.45
1.46
1.47
1.48
1.48
1.79
1.45
1.30
1.24
1.22
1.24
1.23
1.25
1.26
1.27
1.28
1.26
13
Inventing Heuristics
For 8-puzzle:
A tile can move from square A to B if A is adjacent to B and
B is blank
(a) A tile can move from square A to B if A is adjacent to B.
(b) A tile can move from square A to B if B is blank.
(c) A tile can move from square A to B.
15
14