2. WHAT IS TRAVELLING SALESMAN
PROBLEM?
The concept of Travelling
Salesman Problem TSP
is simple,
• It reflects a salesman's
problems that has to pass
through all the cities given
and return to its origin
with the shortest distance
to be travel.
Symmetric TSP with 4 cities
Asymmetric TSP with 4 cities
3. EXAMPLE
Is there a route that takes you through every city
and back to the start point ‘A’ for less than 520?
5. EXAMPLE
A B C D E
A - 2 5 7 1
B 6 - 3 8 2
C 8 7 - 4 7
D 12 4 6 - 5
E 1 3 2 8 -
6. THE MOST IMPORTANT RULES
1. No city is to be visited twice before the tour
of all cities in completed.
2. Going to city i to i, is not permitted.
• E.g.: A->B->A
(no visiting can be repeated)
A B
7. STEP-BY-STEP RULES
STEP# 1: The row reduction:
In every row, we will find a minimum value and then we will minus
the rest of the values of that particular row, by that minimum value.
A B C D E
A - 1 4 6 0
B 4 - 1 6 0
C 4 3 - 0 3
D 8 0 2 - 1
E 0 2 1 7 -
A B C D E
A - 2 5 7 1
B 6 - 3 8 2
C 8 7 - 4 7
D 12 4 6 - 5
E 1 3 2 8 -
THE QUESTION ONE THE ROW REDUCTIVE ONE
8. STEP-BY-STEP RULES(CONTINUED)
STEP# 2: The column reduction:
In, the updated row reduction table’s every column, we will find a
minimum value and then we will minus the rest of the values of
that particular column, by that minimum value.
A B C D E
A - 1 4 6 0
B 4 - 1 6 0
C 4 3 - 0 3
D 8 0 2 - 1
E 0 2 1 7 -
A B C D E
A - 1 3 6 0
B 4 - 0 6 0
C 4 3 - 0 3
D 8 0 1 - 1
E 0 2 0 7 -
THE ROW REDUCTIVE ONE THE COLUMN REDUCTIVE ONE
9. STEP-BY-STEP RULES(CONTINUED)
Now we will have the modified Matrix.
STEP# 3: Next, we will see the zeros of every row and make them assigned [].
STEP# 4: We will now see if the rows containing zero’s columns has another
zero below it, then that zero will be crossed.
STEP# 5: Same goes for the columns too.
(This will be repeated until all the zeros aren't assigned or crossed)
A B C D E
A - 1 3 6 [0]
B 4 - [0] 6 0
C 4 3 - [0] 3
D 8 [0] 1 - 1
E [0] 2 0 7 -
THE COLUMN REDUCTIVE ONE
A B C D E
A - 1 3 6 0
B 4 - 0 6 0
C 4 3 - 0 3
D 8 0 1 - 1
E 0 2 0 7 -
THE ASSIGNED & CROSSED ONE
10. STEP-BY-STEP RULES(CONTINUED)
• STEP# 6: We will see if the matrix is an optimal
solution for the TSP or not.
(And it is not an optimal solution for TSP)
A B C D E
A - 1 3 6 [0]
B 4 - [0] 6 0
C 4 3 - [0] 3
D 8 [0] 1 - 1
E [0] 2 0 7 -
THE ASSIGNED & CROSSED ONE
11. STEP-BY-STEP RULES(CONTINUED)
STEP# 7: (For rows)
• We will prefer zero’s next highest and assign it and we’ll cross the extra zero in that
row.
• Now we will cross the zero of that assigned number’s column.
• Two zeroes in a row will be neglected.
• Next we will come to other rows. But there we will assign the zero.
• If there isn’t any zero then our priority will be one.
A B C D E
A - 1 3 6 [0]
B 4 - [0] 6 0
C 4 3 - [0] 3
D 8 [0] 1 - 1
E [0] 2 0 7 -
A B C D E
A - [1] 3 6 0
B 4 - 0 6 0
C 4 3 - [0] 3
D 8 0 1 - 1
E 0 2 0 7 -
THE PREVIOUS ONE THE NEW ONE
12. STEP-BY-STEP RULES(CONTINUED)
STEP# 8: (For column)
• The first zero will be assigned.
• And the rest of the zero in that row or the
assigned zero, will be crossed.
A B C D E
A - [1] 3 6 0
B 4 - 0 6 0
C 4 3 - [0] 3
D 8 0 1 - 1
E 0 2 0 7 -
A B C D E
A - [1] 3 6 0
B 4 - [0] 6 0
C 4 3 - [0] 3
D 8 0 1 - [1]
E [0] 2 0 7 -
THE PREVIOUS ONE THE NEW ONE
13. FINAL ROUTES
• In the final route, we have;
A->B, B->C, C->D, D->E, E->A
A B C D E
A - [1] 3 6 0
B 4 - [0] 6 0
C 4 3 - [0] 3
D 8 0 1 - [1]
E [0] 2 0 7 -
THE FINAL ROUTE ONE
14. CALCULATION OF THE COST
• A->B = 2
• B->C = 3
• C->D = 4
• D->E = 5
• E->A = 1
• TOTAL= 15 Rs/-
A B C D E
A - 2 5 7 1
B 6 - 3 8 2
C 8 7 - 4 7
D 12 4 6 - 5
E 1 3 2 8 -
THE QUESTION ONE
15. APPLICATIONS OF TSP
Transportation:
• School bus routes
• Service calls
• Delivering meals
Manufacturing:
• An industrial robot that drills holes in printed
circuit boards VLSI (microchip).
Layout communication:
• Planning new telecommunication
networks.