Sie sind auf Seite 1von 6

EXERCISE

A salesman plans to travel to several places where the


distance between two places are given as follows:
From To Distance (km)
A B 6
A C 2
B A 5
B D 5
C A 4
C B 3
C D 3
D A 4
D C 7

If the salesman departs from A, and he wants to pass


each place only once and return to A, please determine
the shortest path for his travel using Branch and Bound
method

Bina Nusantara
Tabel A B C D
A ∞ 6 2 ∞
B 5 ∞ ∞ 5
C 4 3 ∞ 3
D 4 ∞ 7 ∞

5
A B
6

5
4 3 4
2

3
C D

7
Baris dlu , cari lowest number

Tabel A B C D
A ∞ 6 2 ∞
B 5 ∞ ∞ 5
C 4 3 ∞ 3
D 4 ∞ 7 ∞

Jadi begini
Tabel A B C D
A ∞ 4 0 ∞
B 0 ∞ ∞ 0
C 1 0 ∞ 0
D 0 ∞ 3 ∞

R nya = 2 + 3 + 5 + 4 = 14
Kolom , cari lowest number

Tabel A B C D
A ∞ 4 0 ∞
B 0 ∞ ∞ 0
C 1 0 ∞ 0
D 0 ∞ 3 ∞

Jadi begini
Tabel A B C D
A ∞ 4 0 ∞
B 0 ∞ ∞ 0
C 1 0 ∞ 0
D 0 ∞ 3 ∞

R nya = 14 + 0 + 0 + 0+ 0 = 14
Branch & bound
R = 14
A ∞ 4 0 ∞
AB AD 0 ∞ ∞ 0
AC 1 0 ∞ 0
0 ∞ 3 ∞
B C D

R = 14 + 0 + 0 = 14
∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞
∞ ∞ ∞ 0 0 ∞ ∞ 0 0 ∞ ∞ ∞
1 ∞ ∞ 0 ∞ 0 ∞ 0 1 0 ∞ ∞
0 ∞ 3 ∞ 0 ∞ ∞ ∞ 0 ∞ 0 ∞

R = 14 + 4(A,B) +3 =21 R = 14 R=∞


∞ ∞ ∞ ∞
A 0 ∞ ∞ 0
AB=21 ∞ ∞ ∞ ∞ R = 14
AD
AC(14) 0 ∞ ∞ ∞

D ∞ ∞ ∞ ∞
B C
0 ∞ ∞ ∞
∞ ∞ ∞ ∞ R = 14
CB CD ∞ ∞ ∞ ∞

B D
∞ ∞ ∞ ∞
∞ ∞ ∞ ∞
∞ ∞ ∞ ∞ R = 14
0 ∞ ∞ ∞
D

Route : A – C – B – D – A Dengan Cost = 14

Das könnte Ihnen auch gefallen