Professional Documents
Culture Documents
Pertemuan 3 Revisi Update 2016
Pertemuan 3 Revisi Update 2016
Year : 2013
LECTURE 03
Searching: Informed Search I
Learning Outcomes
Systematic Generate-And-Test
» While generating complete solutions and generating
random solutions are the two extremes there exists
another approach that lies in between. The approach is
that the search process proceeds systematically but
some paths that unlikely to lead the solution are not
considered. This evaluation is performed by a heuristic
function.
» Depth-first search tree with backtracking can be used to
implement systematic generate-and-test procedure. As
per this procedure, if some intermediate states are likely
to appear often in the tree, it would be better to modify
that procedure to traverse a graph rather than a tree.
T0264 - Artificial Intelligence 9
Generate And Test
C 6
D
05/01/2020 12
T0264 - Artificial Intelligence
Pelacakan Heuristik
» Implementasi:
QueueingFn = masukkan suksesor dalam penurunan orde
dari yang diinginkan
» Kasus khusus:
greedy search
A* search
05/01/2020 14
T0264 - Artificial Intelligence
05/01/2020 T0264 - Artificial Intelligence 15
05/01/2020 T0264 - Artificial Intelligence 16
05/01/2020 T0264 - Artificial Intelligence 17
Romania dengan langkah costs dalam km
374
253
329
05/01/2020 18
T0264 - Artificial Intelligence
Greedy search
» Fungsi perkiraan:
h(n) = perkiraan biaya dari n ke goal (heuristic)
» Contoh:
hSLD(n) = jarak garis lurus dari n ke Bucharest
05/01/2020 19
T0264 - Artificial Intelligence
05/01/2020 T0264 - Artificial Intelligence 20
05/01/2020 T0264 - Artificial Intelligence 21
Algoritma : Greedy Best - First
Search
» Optimal ? Tidak.
05/01/2020 25
T0264 - Artificial Intelligence
Best First Search
(Greedy)
Step 1 Step 2 Step 3
A A A
Step 4 A Step 5 A
E (4) F (6)
B C (5) D B C (5) D
I (2) J (1)
E (3+2)
F (3+3)
E (2+2)
F (1+3)
G (0+4)
Fungsi evaluasi :
f(n) = h(n) + g(n)
dimana :
f(n) = fungsi evaluasi
g(n) = biaya yang sudah dikeluarkan
dari state awal sampai state n.
h(n) = estimasi biaya untuk sampai
pada suatu tujuan mulai dari n.
S
(3.0)
(1.0)
(2.0)
C (7.0)
A (2.0)
(1.0)
D (20.0) E (9.0)
(3.0) F
(5.0)
(1.0)
G (0.0)
S
frontier = [S], explored = []
Evaluasi S, frontier = [A(2), B(5), C(7)],
(7.0) C
A (2.0) explored = [S]
Evaluasi A, frontier = [B(5), C(7), E(9), D(20)],
B (5.0)
explored = [S,A]
Evaluasi B, frontier = [F(3), C(7), E(9), D(20)],
D (20.0) E (9.0)
explored = [S,A,B]
(3.0) F Evaluasi F, frontier = [G(0), C(7), E(9), D(20)],
explored = [S,A,B]
Evaluasi G = goal ,STOP, frontier = [],
explored = [S,A,B]
Jadi urutan node yang dievaluasi : [S,A, B]
dengan jalur solusi : S-B-F-G.
G (0.0)
G (0.0)
Path = S-B-F-G.
C (3.0)
Evaluasi A, frontier = [B(2),C(3),E(3),D(6)], explored =
A (1.0) [S,A]
Evaluasi B, frontier = [C(3),E(3),F(3),D(6)], explored =
B (2.0)
[S,A,B]
Evaluasi C, frontier = [E(3),F(3),D(6)], explored =
D(6.0) E (3.0) [S,A,B,C]
F (3.0) Evaluasi E, frontier = [F(3),D(6),G(8)], explored =
[S,A,B,C,E]
Evaluasi F, frontier = [G(5),D(6),G(8)], explored =
[S,A,B,C,E,F]
Evaluasi G = goal ,STOP, frontier = [], explored =
[S,A,B,C,E,F]
G (5.0)
(8.0)
Jadi urutan node yang dievaluasi : [S,A,B,C,E,F]
dengan jalur solusi : S-B-F-G.
G (4.0)
End of Session 03
Good Luck