### ｹﾂｶ制

```(
)
.
1
Online
2
•
.
•
.
3
A*
IDA*
RBFS
SMA* MA*
4
.
.
.
.
-
.
.
“
”
5
.
•
.
•
•
•
.
.
•
.
:
).
(.
g
.
)
(.
.
:
.
h(n) .
n
.
h
h(n)=0
n
:
:
:
)
B A
=h(n)
n
(.
.
h
h
.
.
Greedy best-first search; using hSLD
10
:
Greedy best-first search solution
GBFS: 140 + 99 + 211 = 450
Optimal: 140+80+97+101 = 418
12
-
A
3
1
1
B
C
1
2
D
2
3
3
P
3
3
1
2
3
2
3
Q
1
R
2
S
2
T
J
F
1
2
K
L 3
M
3
2
1
U
1
V
1
2
N
1
W
2
2
G
2
0
1
1
3
E
I 3
H
1
3
5
1
2
1
X
0
3
1
O
2
Y
2
3
3
Z
1
13
-
A
1
1
3
1
2
B
C
2
3
5
D
2
1
E
1
1
3
F
G
1
4
N
1
X
0
23
3
1
O
3
5
14
-
A
2
1
1
B
C
1
1
D
2
3
3
P
3
3
1
2
3
2
3
Q
1
R
2
S
2
T
J
F
1
2
K
L 3
M
3
2
1
U
1
V
1
2
N
1
W
2
3
G
3
0
1
1
3
E
I 3
H
1
1
5
1
4
1
X
0
3
1
O
2
Y
2
3
3
Z
1
15
-
A
1
2
1
1
B
4
C
1
1
1
5
D
E
3
1
J
2
3
3
K
0
16
-
-
(
)
.
.
.
.
).
(
loop
Greedy best-first search
150
Iasi to Fargaras
170
250
19
m
O(b^m)
.
.
h
20
:
h = h*
h = h*
:
:
O(b m )
O(bd )
h = h*
O(b m ) :
O(bd )
h = h*
21
-
A*
.
.
h(n)
h(n)
g(n)
A*
.
:
f(n) = g(n) + h(n)
.
n
:g(n)
:h(n)
n
.
:
f(n) = n
h(n)
22
: g(n)
n
: h(n)
n
: h*(n)
n
: f(n)
n
f(n): g(n) + h(n)
f*(n): g(n) + h*(n)
n
: f*(n)
23
A*
Arad
Bucharest
f(Arad) = g(Arad)+h(Arad)=0+366=366
24
A*
:
f(n)
Arad
f(Sibiu)=c(Arad,Sibiu)+h(Sibiu)=140+253=393
f(Timisoara)=c(Arad,Timisoara)+h(Timisoara)=118+329=447
f(Zerind)=c(Arad,Zerind)+h(Zerind)=75+374=449
Sibiu
25
A*
:
f(n)
Sibiu
f(Arad)=c(Sibiu,Arad)+h(Arad)=280+366=646
f(Fagaras)=c(Sibiu,Fagaras)+h(Fagaras)=239+179=415
f(Oradea)=c(Sibiu,Oradea)+h(Oradea)=291+380=671
f(Rimnicu Vilcea)=c(Sibiu,Rimnicu Vilcea)+ h(Rimnicu Vilcea)=220+192=413
Rimnicu Vilcea
26
A*
:
f(n)
Rimnicu Vilcea
f(Craiova)=c(Rimnicu Vilcea, Craiova)+h(Craiova)=360+160=526
f(Pitesti)=c(Rimnicu Vilcea, Pitesti)+h(Pitesti)=317+100=417
f(Sibiu)=c(Rimnicu Vilcea,Sibiu)+h(Sibiu)=300+253=553
Fagaras
27
A*
:
f(n)
Fagaras
f(Sibiu)=c(Fagaras, Sibiu)+h(Sibiu)=338+253=591
f(Bucharest)=c(Fagaras,Bucharest)+h(Bucharest)=450+0=450
Pitesti !!!
28
A*
:
f(n)
Pitesti
f(Bucharest)=c(Pitesti,Bucharest)+h(Bucharest)=418+0=418
Bucharest !!!
29
:
)
.(
).
.
h
(.
:
:
A
A
1
1
1
1 B
1
3 B
1
C 2
1
1
C 4
1
2 D
E 1
2 D
E 1
1
1
1
1
1 F
G
0
1 F
1
1
0 H
0 H
h
h*
G
0
h 31/ h*
-A*
A/5
2
1
B/4
1
C/4
1
1
D/5
1
H/2
3
P/3
E/1
3
3
2
3
Q/1
R/2
2
S/2
F/3
3
J/1
I/3
1
K/0
3
T/1
1
L/3
3
U/1
G/2
2
1
M/2
N/1
2
1
1
V/2
W/1
X/0
3
O/3
2
Y/2
3
Z/1
32
-A*
A/5
2
1
51
6
B/4
C/4
1
5
1
F/3
G/2
1
42
3
3
N/1
4
O/3
8
1
X/0
4
33
-A*
:
.
a
A*
n’
n’
n
n
n
.
n’
:
f
h(n)
n’
G
(.
.
h
).
n
h(n)
(hSLD
)
f(n)
h
.
h(n)
A*
.(
A*
)
- A*
G2 .
f*
G
g(G2) > f*
h(G2)=0
.
f(G2)=g(G2)
G2
.
G2 A*
.
- A*
)
G
n
G
n
f*
)
f
.
f*
h
f
f(n)
):
f(n)
(
(.
f(G2)
G2
(
n
f(n)
f(G2)
- A*
:
f*
f(G2)
f(G2) = g(G2)
f*
h(G2) = 0
g2
g(G2)
A*
G2
.
- A*
f
f*
A*
.
f(n)
.(
.
)
)
:
-1
-2
A*
.
(
A*
:
.
:
h
O (b m )
O(bd )
O(b m )
O(bd )
:
.
h = h*
:
h = h*
41
IDA*
.
A*
IDA*
.
f(g+h)
.
A*
IDA*
.
f-cost
f-cost
.
IDA*
42
Bound := f(StartNode);
SolutionFound := false;
Repeat
perform depth-first search from StartNode, so that
a node N is expanded only if f(N)
Bound;
if this depth-first search encounters a goal node with f
Bound
then SolutionFound = true
else
compute new bound as:
Bound = min { f(N) | N generated by this search, f(N) > Bound
}
until solution found.
43
IDA*
.
.
.
bd
.
.
.
.
A*
IDA*
.
IDA*
.
A*
A*
IDA*
.
f
44
IDA*
45
RBFS
Recursive best first search
.
f
.
f
RBFS
O(bd)
.
46
RBFS
.
IDA*
.
.
.
.
RBFS
RBFS IDA*
RBFS IDA*
f
IDA*
RBFS
.
RBFS IDA*
47
.
48
49
50
SMA*
.
(
.
f
A*
.
) SMA*
.
.
IDA*
SMA*
RBFS 51
SMA*
).
IDA*
(.
.
.
52
SMA*
SMA*
.
A*
SMA*
.
.
(
) A*
SMA*
.
.
53
8
).
.
-
3
20
320
3.5 109
A*
20
(
.
54
8
-
h1
h1
8
(
)
h1
h
h*
.
.
h
55
8
-
h2
h2
3 1 2 2 2 3 3 2 18
.
.
,
56
8
-
h2
h2
.
.
26
57
b*
N
A*
d
b*
d
N
N
1 b * (b*) 2 ... (b*) d
b*
1
.
b*
58
)
(
h2 h1
A* IDS
59
h2(n) >= h1(n) :
:
n
h1
h1
h2
h2
.
A*
h1
.
f(n)<f*
h2(n)>=h1(n)
.
.
h2
A*
h1
H1
h2
60
.
.
.
61
-8
B
A
B
A
.
B
:
.
B
A
B
A
.
H2
B
.
.
B
A
B
A
H1
62
h1..hm
.
h1..hm
.(hn=max(h1(n),…hm(n)))
h .
h
63
```