0% found this document useful (0 votes)
525 views5 pages

Contoh Soal A Star Search PDF

1. This document provides an example of an A* search algorithm to find the optimal path from node A to node G in a graph. 2. The algorithm iteratively expands the closest nodes, tracking the cost f(n) = g(n) + h(n) of each node, where g(n) is the cost to reach the node and h(n) is the heuristic estimate to reach the goal. 3. After expanding all neighboring nodes, the optimal path found is A-C-H-I-J-G, with a total cost of 50.

Uploaded by

Master Sang Pb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
525 views5 pages

Contoh Soal A Star Search PDF

1. This document provides an example of an A* search algorithm to find the optimal path from node A to node G in a graph. 2. The algorithm iteratively expands the closest nodes, tracking the cost f(n) = g(n) + h(n) of each node, where g(n) is the cost to reach the node and h(n) is the heuristic estimate to reach the goal. 3. After expanding all neighboring nodes, the optimal path found is A-C-H-I-J-G, with a total cost of 50.

Uploaded by

Master Sang Pb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

1.

Contoh soal A* search

K
D 10

20 10 A 10

10 H
A C J
10 5

20 L 40 10
G
B
20 30
E
20
F

h(A)= 40 h(G)= 0
h(B)= 20 h(H)= 30
h(C)= 40 h(I)= 20
h(D)= 50 h(J)= 10
h(E)= 30 h(K)= 60
h(F)= 40 h(L)= 10

Penyelesaian:
Dari A tujuan ke G
Rumus A* search :𝑓(𝑛) = 𝑔(𝑛) + ℎ(𝑛)

A
Close: {A}
Open: {B,C,D}

B C D
f(B)= 20+20 f(C)= 10+40 f(D)= 20+50
= 40 = 50 = 70
A
Close: {A,B}
Open: {C,D,E}

B C D
f(C)= 10+40 f(D)= 20+50
= 50 = 70

E
f(E)= 40+30
= 70

Close: {A,B,C}
Open: {D,E,H,L} B C D
f(D)= 20+50
= 70

E L
H
f(E)= 40+30 f(L)= 15+10
= 70 = 25 f(H)= 20+30
= 50
A
Close: {A,B,C,L}
Open: {D,E,G,H}

B C D
f(D)= 20+50
= 70

E L
H
f(E)= 40+30
= 70 f(H)= 20+30
= 50

G
f(G)= 55+0
= 55

Close: {A,B,C,L,H}
Open: {D,E,G,I} B C D
f(D)= 20+50
= 70

E L
H
f(E)= 40+30
= 70

G I
f(G)= 55+0 f(D)= 30+20
= 55 = 50
Close: {A,B,C,L,H,I}
A
Open: {D,E,G,J}

B C D
f(D)= 20+50
= 70

E L
H
f(E)= 40+30
= 70

G I
f(G)= 55+0
= 55

J
f(J)= 40+10
= 50
A

Close: {A,B,C,L,H,I,G}
Open: {D,E,J}
B C D
f(D)= 20+50
= 70

E L
H
f(E)= 40+30
= 70

G I
f(G)= 55+0
= 55

G
f(G)= 50+0
= 50

Jadi, solusi yang didapatkan untuk mencapai tujuan adalah dari A ke G yaitu : (A-C-H-I-J-G)

You might also like