You are on page 1of 16

The Traveling Salesman Problem

There are “m” places (nodes) to be visited,


each place only once
Starting from any place all the places must
be visited only once but in any order.
The cost of travel or the distance between
pairs of places or time required are usually
given.
The objective is to minimize the total cost,
or distance or time
A company executive has to
visit five offices each only once
starting from any office but has
to return to the office from
where he started. The distances
between the offices are given in
the Table. Determine the
sequence that results in the
lowest total distance.
Offic Offic
e2 e3

Offic Offic
e1 e4

Offic
e5
Time of travel between offices

Office 1 Office 2 Office 3 Office 4 Office 5


Office 1
- 25 50 50 30
Office 2 25 - 40 40 45
Office 3 50 40 - 35 65
Office 4 50 40 35 - 80
Office 5 30 45 65 80 -
Solving as an assignment problem
we get

∞ 25 50 50 30
25 ∞ 40 40 45
50 40 ∞ 35 65
50 40 35 ∞ 80
30 45 65 80 ∞
∞ 0 25 25 5
0 ∞ 15 15 20
35 5 ∞ 0 30
15 5 0∞ 45 ∞ 0 25 25 0
0 15 35 50 ∞ 0 ∞ 15 15 15
35 5 ∞ 0 25
15 5 0∞ 40
0 15 35 50 ∞
- 25 50 50 30
25 - 40 40 45
50 40 - 35 65
50 40 35 - 80
30 45 65 80 -

Solving as an
assignment
problem we get
- 25 50 50 30
25 - 40 40 45
50 40 - 35 65
50 40 35 - 80
30 45 65 80 -
- 25 50 50 30 1 5 30
25 - 40 40 45 2 1 25
50 40 - 35 65 3 4 35
50 40 35 4 3 35
- 80
30 45 65 80 - 5 2 45
Total 170

15 2 1
Not feasible
3 4 3

Feasible 2 1 5  3  4  2 = 195
In a machine shop the set up times are
dependent on the job presently on the job
and the one coming up next. The set up
cost based on this time is given for four
jobs in the Table. Obtain the sequence of
jobs to minimize the total set up cost.
A B C D
A - 4 7 3
B 4 - 6 3
C 7 6 - 7
D 3 3 7 -
A B C D
A ∞ 4 7 3
B 4 ∞ 6 3
C 7 6 ∞ 7
A B C D
D 3 3 7 ∞ A ∞ 1 4 0
B 1 ∞ 3 0
Solving as an
assignment C 1 0 ∞ 1
problem D 0 0 4 ∞
A B C D
A ∞ 1 1 0
B 1 ∞ 0 0
C 1 0 ∞ 1
D 0 0 1 ∞
A B C D
A 0
B 0 0
C 0
D 0 0 A B C D
A 0
B 0 X
0
C 0
D 0 X
0
A B C D
A 0
B 0 X
0
C 0
D 0 X
0

A D A – Not feasible
A D  B C  A
Minimum total set up cost
=3+3+6+7= 19
A B C D A C 7
A - 4 7 3 B D 3
B 4 - 6 3 C B 6
C 7 6 - 7 D A 3
D 3 3 7 - Total 19

A C  B  D  A
Minimum total set up cost = 19
A B C D E
A - 16 18 13 20
B 21 - 16 27 14
C 12 14 - 15 21
D 11 18 19 - 21
E 16 14 17 12 -

You might also like