0% found this document useful (0 votes)
246 views

Forum 2

The document discusses two examples: 1) A Multistage Graph problem to find the shortest path from node S to T going through nodes A, B, or C. The shortest path is S-A-E-T with a total cost of 9. 2) A Traveling Salesman Problem to find the shortest route between nodes A, B, C, and D. The shortest route is A-B-C-D-A with a total cost of 35.

Uploaded by

bertrand harahap
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
246 views

Forum 2

The document discusses two examples: 1) A Multistage Graph problem to find the shortest path from node S to T going through nodes A, B, or C. The shortest path is S-A-E-T with a total cost of 9. 2) A Traveling Salesman Problem to find the shortest route between nodes A, B, C, and D. The shortest route is A-B-C-D-A with a total cost of 35.

Uploaded by

bertrand harahap
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

 

Multistage Graph dan Traveling Salesman Problem


cari contoh dari internet untuk Multistage Graph dan Traveling Salesman Problem,
kemudian tentukan bagaimana menentukan jalur terpendeknya!

 Multistage Graph

cost(4,T) = 0

cost(3,D) = min{c(D,T) + cost(4,T)} = { 8 + 0 }=8

cost(3,E) = min{c(E,T) + cost(4,T)}= { 2 + 0 }=2

cost(2,A) = min{c(A,D) + cost(3,D) | min{c(A,E) + cost(3,E) } = { 3 + 8 | 6 + 2} = 8

cost(2,B) = min{c(B,D) + cost(3,D) | min{c(B,E) + cost(3,E)} = { 4 + 8 | 10 + 2} = 12

cost(2,C) = min{c(C,E) + cost(3,E) | min{c(C,T) + cost(4,T)} } = { 3 + 2 | 10 + 0}= 5

cost(i,j) = min{c(S,A) + cost(2,A)| min{c(S,B) + cost(2,B)| min{c(S,C) + cost(2,C) }

= { 1 + 8 | 2 + 12 | 7 + 5 } = 9

Jalur terpendek adalah : S-A-E-T = { 1 + 6 + 2} = 9


Traveling Salesman Problem

A B

D C

A B C D
A 10 20 15
B 5 ∞ 10 9
C 8 8 ∞ 9
D 6 13 12 ∞

p(B, Ǿ)=c(A,B)=10

p(C, Ǿ)=c(A,C)=20

p(D, Ǿ)=c(A,D)=15

p(B{C})=c(C,B)+p(C, Ǿ)8+20=28

p(B{D})=c(D,B)+p(D, Ǿ)=13+15=28

p(C{B})=c(B,C)+p(B ,Ǿ)=10+10=20

p(C{D})=c(D,C)+p(D ,Ǿ)=12+15=27

p(D{B})=c(B,D)+p(B ,Ǿ)=9+10=19

p(D{C})=c(C,D)+p(C ,Ǿ)=9+20=29

p(B{C,D})=min[c(C,B)+p(C ,{D}|c(D,B)+P(D{C}]= [8+27|13+29]=35

p(C{B,D})=min[c(B,C)+p(B,{D}|c(D,C)+P(D{B}]= [10+28|12+19]=31

p(D{B,C})=min[c(B,D)+p(B,{C}|c(C,D)+P(C{B}]= [9+28|9+20]=29

p(A,{B,C,D})= min[c(B,A)+p(B,{C,D}) | c(C,A)+p(C,{B,D}) | c(D,A)+p(D,{B,C})]

= min[5+35 | 8+31 | 6+29]

= 35 ( Jalur terpendek)

You might also like