ISE 421 - Section 02
Term 121
TSP Project
TRAVELLING SALESMAN PROBLEM
A traveler wants to travel across eight cities with minimum time. He wants to visit each city exactly once and then return to the the starting city. Your task is to generate the best tour for him. Following are the travel times it takes to move from any city i to another city j.
0 | 10 | 12 | 5 | 17 | 9 | 13 | 7 | 10 | 0 | 9 | 20 | 8 | 11 | 3 | 6 | 12 | 9 | 0 | 14 | 4 | 10 | 1 | 16 | 5 | 20 | 14 | 0 | 20 | 5 | 28 | 10 | 17 | 8 | 4 | 20 | 0 | 21 | 4 | 9 | 9 | 11 | 10 | 5 | 21 | 0 | 2 | 3 | 13 | 3 | 1 | 28 | 4 | 2 | 0 | 2 | 7 | 5 | 16 | 10 | 9 | 3 | 2 | 0 |
i) Start by solving the corresponding assignment problem to get the starting solution. Then use Branch and Bound to eliminate any sub-tours.
Solution:
The Hungarian assignment algorithm was implemented using excel:
The following table was the input: | City 1 | City 2 | City 3 | City 4 | City 5 | City 6 | City 7 | City 8 | City 1 | 100 | 10 | 12 | 5 | 17 | 9 | 13 | 7 | City 2 | 10 | 100 | 9 | 20 | 8 | 11 | 3 | 5 | City 3 | 12 | 9 | 100 | 14 | 4 | 10 | 1 | 16 | City 4 | 5 | 20 | 14 | 100 | 20 | 5 | 28 | 10 | City 5 | 17 | 8 | 4 | 20 | 100 | 21 | 4 | 9 | City 6 | 9 | 11 | 10 | 5 | 21 | 100 | 2 | 3 | City 7 | 13 | 3 | 1 | 28 | 4 | 2 | 100 | 2 | City 8 | 7 | 5 | 16 | 10 | 9 | 3 | 2 | 100 |
Note: Cost of travelling from a city to the same city was penalized by 100.
Solving Assignment Problem using Excel Solver: 1) An table containing the assignments is made (see A1-I9). This table is initially empty. An assignment is made if the cell is equal to 1, otherwise 0 – this will be solved by “solver”. Call this the “binary table”. 2) Another table containing the costs of travelling from one city to another is written into the spreadsheet. 3) A cell which determines the total cost is needed (see B12). The function used