Anda di halaman 1dari 14

ALGORITMA DIJKSTRA

 Algoritma Dijkstra. Edsger Dijkstra. adalah sebuah algoritma dalam memecahkan permasalahan jarak terpendek (shortest path problem) untuk sebuah graf berarah (directed graph) dengan bobot-bobot sisi (edge weights) yang bernilai tak-negatif  Namun. dinamai menurut penemunya. algoritma ini juga benar untuk graf tak berarah .

bila simpuldari sebuah graf melambangkan kota-kota dan bobot sisi (edge weights) melambangkan jarak antara kota-kota tersebut. Misalnya. . maka algoritma Dijkstra dapat digunakan untuk menemukan jarak terpendek antara dua kota.

.

c) (a.d) (a.c.d.e.d.c.c.c.d) (a.c.e) (a.b.c.c .b) (a.Ite Sampul Linta rasi yg dipilih san 1 a a S D a b c d e z 1 0 0 0 0 0 a b c 4 2 d e z (a.e) (a.c.c .e) (a.d.c.b.b) (a.d.c.e ) (a.e) (a.z) 2 c a.e.d .c.c.d.z) 4 d a.c 1 0 1 0 0 0 3 2 10 12 (a.d) (a.b) (a.c.d 1 1 1 1 0 0 3 2 8 10 14 (a.c.c.z) 5 e a.b) (a.c.b) (a.c.d)(a.d.b.) (a.b.c.e.c.c.d) (a.b.c.z 1 1 1 1 1 1 3 2 8 10 13 (a.) (a.c.b.b 1 1 1 0 0 0 3 2 8 12 (a.e) (a.z) 3 b a.b) (a.c.b.z) .b.) (a.e 1 1 1 1 1 0 3 2 8 10 13 (a.b.c.) (a.z ) 6 z a.b.c.b.d.b.d) (a.b.c.) (a.

b.d) (a.c) (a.) (a.d.d.Ite Sampul Linta rasi yg dipilih san 1 a a S D a b c d e z 1 0 0 0 0 0 a b c 4 2 d e z (a.c.e.e) (a.c.c.e) (a.b.c.d .c .d.d) (a.c.b) (a.c.d.) (a.z) 2 c a.e.z ) 6 z a.) (a.c.b.c.e ) (a.b.e) (a.b) (a.d) (a.d)(a.) (a.z) 5 e a.b.d.c.c.c .c.e) (a.b) (a.c.c.d.c.b.c 1 0 1 0 0 0 3 2 10 12 (a.z 1 1 1 1 1 1 3 2 8 10 13 (a.d 1 1 1 1 0 0 3 2 8 10 14 (a.c.b.b) (a.) (a.b.d.c.c.c.z) 3 b a.c.e) (a.b.c.b) (a.b.c.c.b 1 1 1 0 0 0 3 2 8 12 (a.d) (a.e.b.c.e 1 1 1 1 1 0 3 2 8 10 13 (a.d) (a.b.c.z) 4 d a.c.z) .b) (a.b.

) (a.e) (a.b.e) (a.d .c.) (a.b.e) (a.b.b) (a.b.b.c.c.c.c) (a.b.d.b.d.d) (a.c.b) (a.c.z) 2 c a.c 1 0 1 0 0 0 3 2 10 12 (a.b.e 1 1 1 1 1 0 3 2 8 10 13 (a.b.c.b) (a.b) (a.c.e) (a.e.c.d) (a.c.b) (a.c.c .b.c.c.c.b.z) 3 b a.c.c.d) (a.Ite Sampul Linta rasi yg dipilih san 1 a a S D a b c d e z 1 0 0 0 0 0 a b c 4 2 d e z (a.) (a.e) (a.b.b) (a.d)(a.c.c.z) .e.c.d) (a.) (a.) (a.c.c.c.d 1 1 1 1 0 0 3 2 8 10 14 (a.d.d.z) 4 d a.e ) (a.c .z ) 6 z a.d.c.d.d.c.b.d) (a.b 1 1 1 0 0 0 3 2 8 12 (a.z 1 1 1 1 1 1 3 2 8 10 13 (a.c.z) 5 e a.e.

b.c.c.b) (a.b.e.c.c.z) 5 e a.d.b.c.d.c.d)(a.c.b.c.) (a.e ) (a.c.c.c.c.b) (a.z 1 1 1 1 1 1 3 2 8 10 13 (a.c.d.e) (a.e.) (a.c) (a.z ) 6 z a.c.d) (a.d.b.z) 3 b a.z) .) (a.c.e) (a.b.d 1 1 1 1 0 0 3 2 8 10 14 (a.b.c.c .e) (a.e.d .z) 2 c a.c.Ite Sampul Linta rasi yg dipilih san 1 a a S D a b c d e z 1 0 0 0 0 0 a b c 4 2 d e z (a.b.) (a.e) (a.c.c.b) (a.b.b 1 1 1 0 0 0 3 2 8 12 (a.d.c.c.b.d) (a.c.d.b) (a.z) 4 d a.c .d) (a.c.d) (a.b.d) (a.b) (a.b) (a.c.) (a.b.e) (a.d.e 1 1 1 1 1 0 3 2 8 10 13 (a.c.b.c 1 0 1 0 0 0 3 2 10 12 (a.

z) 3 b a.c) (a.e ) (a.b.b) (a.z) 4 d a.d.b 1 1 1 0 0 0 3 2 8 12 (a.e) (a.c.c.c.z 1 1 1 1 1 1 3 2 8 10 13 (a.c.c .) (a.b.d.b.d) (a.d.b) (a.b.d.e) (a.d.e.d) (a.z ) 6 z a.b.e 1 1 1 1 1 0 3 2 8 10 13 (a.d) (a.c.c.e) (a.e.) (a.c.b) (a.b) (a.d.e.b.b.c.c.b.b.c.c.d) (a.c.c.c .c.b) (a.) (a.d 1 1 1 1 0 0 3 2 8 10 14 (a.b.b) (a.c.c 1 0 1 0 0 0 3 2 10 12 (a.Ite Sampul Linta rasi yg dipilih san 1 a a S D a b c d e z 1 0 0 0 0 0 a b c 4 2 d e z (a.b.c.z) 2 c a.d .c.d.z) .b.) (a.c.) (a.z) 5 e a.c.c.d) (a.d)(a.c.e) (a.c.e) (a.c.b.c.c.

c.b.c.b) (a.d) (a.e) (a.d.e 1 1 1 1 1 0 3 2 8 10 13 (a.c.d.d) (a.d) (a.z) 2 c a.c.z) .c.b) (a.c.d.d.b.c.z) 4 d a.e) (a.z 1 1 1 1 1 1 3 2 8 10 13 (a.c.b 1 1 1 0 0 0 3 2 8 12 (a.) (a.c) (a.e.) (a.b.c.d)(a.e.b.b.e) (a.c.b.b.c 1 0 1 0 0 0 3 2 10 12 (a.b.c .c.e.c.c.c.d.) (a.c .c.d) (a.b.) (a.c.c.c.c.b.d.d .b) (a.) (a.z) 5 e a.e ) (a.d 1 1 1 1 0 0 3 2 8 10 14 (a.d) (a.c.b) (a.c.d.b) (a.c.Ite Sampul Linta rasi yg dipilih san 1 a a S D a b c d e z 1 0 0 0 0 0 a b c 4 2 d e z (a.e) (a.b.c.b.e) (a.c.c.z ) 6 z a.b) (a.z) 3 b a.b.

.

A 3 B 2 4 C 3 4 D .

TERIMA KASIH .