You are on page 1of 23

Traveling Salesperson Tabu Heuristic

Input steps:(See commnet in cell A4) Output steps:(See comments in cells D4, D6, and G3) Check here if sym

Step 1: Nbr of cities= 5 Steps 3a&b: Nbr of iters= 20 Tenure period= [1, 6] Click here to popul

Start 1 5
Step 2: Format input area Steps 4a&b: all Execute heuristic
option: 1 1
Iteration calculations: ON OFF Next move: Best reversal (Best local optimum in red) 2
Start city Tour Length 3
1 1-2-3-4-5-1 780 4
2 2-3-4-1-5-2 750 5
3 3-2-4-1-5-3 735
4 4-1-2-3-5-4 1E+10
5 5-2-3-4-1-5 750
Iteration 1
2-4 3-4-2-1-5-3 1E+10
4-1 3-2-1-4-5-3 725
1-5 3-2-4-5-1-3 810
2-4-1 3-1-4-2-5-3 1E+10
4-1-5 3-2-5-1-4-3 730
2-4-1-5 3-5-1-4-2-3 1E+10
Iteration 2
2-1 3-1-2-4-5-3 825
1-4 3-2-4-1-5-3 735
4-5 3-2-1-5-4-3 1E+10
2-1-4 3-4-1-2-5-3 745
1-4-5 3-2-5-4-1-3 1E+10
2-1-4-5 3-5-4-1-2-3 1E+10
Iteration 3
4-1 3-1-4-2-5-3 1E+10
1-2 3-4-2-1-5-3 1E+10
2-5 3-4-1-5-2-3 750
4-1-2 3-2-1-4-5-3 725
1-2-5 3-4-5-2-1-3 820
4-1-2-5 3-5-2-1-4-3 745
Iteration 4
5-2 3-2-5-1-4-3 730
2-1 3-5-1-2-4-3 785
1-4 3-5-2-4-1-3 795
5-2-1 3-1-2-5-4-3 1E+10
2-1-4 3-5-4-1-2-3 1E+10
5-2-1-4 3-4-1-2-5-3 745
Iteration 5
5-1 3-1-5-2-4-3 830
1-2 3-5-2-1-4-3 745
2-4 3-5-1-4-2-3 1E+10
5-1-2 3-2-1-5-4-3 1E+10
1-2-4 3-5-4-2-1-3 2E+10
5-1-2-4 3-4-2-1-5-3 1E+10
Iteration 6
1-5 3-5-1-2-4-3 785
5-2 3-1-2-5-4-3 1E+10
2-4 3-1-5-4-2-3 2E+10
1-5-2 3-2-5-1-4-3 730
5-2-4 3-1-4-2-5-3 1E+10
1-5-2-4 3-4-2-5-1-3 1E+10
Iteration 7
1-2 3-2-1-5-4-3 1E+10
2-5 3-1-5-2-4-3 830
5-4 3-1-2-4-5-3 825
1-2-5 3-5-2-1-4-3 745
2-5-4 3-1-4-5-2-3 790
1-2-5-4 3-4-5-2-1-3 820
Iteration 8
1-4 3-4-1-5-2-3 750
4-5 3-1-5-4-2-3 2E+10
5-2 3-1-4-2-5-3 1E+10
1-4-5 3-5-4-1-2-3 1E+10
4-5-2 3-1-2-5-4-3 1E+10
1-4-5-2 3-2-5-4-1-3 1E+10
Iteration 9
4-1 3-1-4-5-2-3 790
1-5 3-4-5-1-2-3 780
5-2 3-4-1-2-5-3 745
4-1-5 3-5-1-4-2-3 1E+10
1-5-2 3-4-2-5-1-3 1E+10
4-1-5-2 3-2-5-1-4-3 730
Iteration 10
4-5 3-5-4-1-2-3 1E+10
5-1 3-4-1-5-2-3 750
1-2 3-4-5-2-1-3 820
4-5-1 3-1-5-4-2-3 2E+10
5-1-2 3-4-2-1-5-3 1E+10
4-5-1-2 3-2-1-5-4-3 1E+10
Iteration 11
4-5 3-5-4-2-1-3 2E+10
5-2 3-4-2-5-1-3 1E+10
2-1 3-4-5-1-2-3 780
4-5-2 3-2-5-4-1-3 1E+10
5-2-1 3-4-1-2-5-3 745
4-5-2-1 3-1-2-5-4-3 1E+10
Iteration 12
4-2 3-2-4-5-1-3 810
2-5 3-4-5-2-1-3 820
5-1 3-4-2-1-5-3 1E+10
4-2-5 3-5-2-4-1-3 795
2-5-1 3-4-1-5-2-3 750
4-2-5-1 3-1-5-2-4-3 830
Iteration 13
5-2 3-2-5-4-1-3 1E+10
2-4 3-5-4-2-1-3 2E+10
4-1 3-5-2-1-4-3 745
5-2-4 3-4-2-5-1-3 1E+10
2-4-1 3-5-1-4-2-3 1E+10
5-2-4-1 3-1-4-2-5-3 1E+10
Iteration 14
5-2 3-2-5-1-4-3 730
2-1 3-5-1-2-4-3 785
1-4 3-5-2-4-1-3 795
5-2-1 3-1-2-5-4-3 1E+10
2-1-4 3-5-4-1-2-3 1E+10
5-2-1-4 3-4-1-2-5-3 745
Iteration 15
5-1 3-1-5-2-4-3 830
1-2 3-5-2-1-4-3 745
2-4 3-5-1-4-2-3 1E+10
5-1-2 3-2-1-5-4-3 1E+10
1-2-4 3-5-4-2-1-3 2E+10
5-1-2-4 3-4-2-1-5-3 1E+10
Iteration 16
1-5 3-5-1-2-4-3 785
5-2 3-1-2-5-4-3 1E+10
2-4 3-1-5-4-2-3 2E+10
1-5-2 3-2-5-1-4-3 730
5-2-4 3-1-4-2-5-3 1E+10
1-5-2-4 3-4-2-5-1-3 1E+10
Iteration 17
1-2 3-2-1-5-4-3 1E+10
2-5 3-1-5-2-4-3 830
5-4 3-1-2-4-5-3 825
1-2-5 3-5-2-1-4-3 745
2-5-4 3-1-4-5-2-3 790
1-2-5-4 3-4-5-2-1-3 820
Iteration 18
1-4 3-4-1-5-2-3 750
4-5 3-1-5-4-2-3 2E+10
5-2 3-1-4-2-5-3 1E+10
1-4-5 3-5-4-1-2-3 1E+10
4-5-2 3-1-2-5-4-3 1E+10
1-4-5-2 3-2-5-4-1-3 1E+10
Iteration 19
4-1 3-1-4-5-2-3 790
1-5 3-4-5-1-2-3 780
5-2 3-4-1-2-5-3 745
4-1-5 3-5-1-4-2-3 1E+10
1-5-2 3-4-2-5-1-3 1E+10
4-1-5-2 3-2-5-1-4-3 730
Iteration 20
4-5 3-5-4-1-2-3 1E+10
5-1 3-4-1-5-2-3 750
1-2 3-4-5-2-1-3 820
4-5-1 3-1-5-4-2-3 2E+10
5-1-2 3-4-2-1-5-3 1E+10
4-5-1-2 3-2-1-5-4-3 1E+10
bu Heuristic
Check here if symmeric Enter density: 0.7 (blank cell = infinity)

Click here to populate DISTANCE matrix randomly in the range (1, 100)

1 2 3 4 5
120 220 150 210

120 100 110 130


220 80 160 185
150 160 190
210 130 185
Step 4c: Enter initial tour (if TOUR option is selected in Step 4a):
1 2 3 4 5 1
Search best tour found at iteration 1
Tour length: 725
Tour: 3-2-1-4-5-3

Tabu list by iteration (Tenure period = 3 iterations):


Iteration 1: 2-1, 4-5
Iteration 2: 2-1, 4-5, 3-4, 2-5
Iteration 3: 2-1, 4-5, 3-4, 2-5, 3-5, 4-3
Iteration 4: 3-4, 2-5, 3-5, 4-3, 5-1, 2-4
Iteration 5: 3-5, 4-3, 5-1, 2-4, 3-1, 5-2
Iteration 6: 5-1, 2-4, 3-1, 5-2, 1-2, 5-4
Iteration 7: 3-1, 5-2, 1-2, 5-4, 1-4, 2-3
Iteration 8: 1-2, 5-4, 1-4, 2-3, 3-4, 1-5
Iteration 9: 1-4, 2-3, 3-4, 1-5, 4-5, 1-2
Iteration 10: 3-4, 1-5, 4-5, 1-2, 5-2, 1-3
Iteration 11: 4-5, 1-2, 5-2, 1-3, 4-2, 5-1
Iteration 12: 5-2, 1-3, 4-2, 5-1, 3-5, 4-1
Iteration 13: 4-2, 5-1, 3-5, 4-1, 2-1, 4-3
Iteration 14: 3-5, 4-1, 2-1, 4-3, 5-1, 2-4
Iteration 15: 2-1, 4-3, 5-1, 2-4, 3-1, 5-2
Iteration 16: 5-1, 2-4, 3-1, 5-2, 1-2, 5-4
Iteration 17: 3-1, 5-2, 1-2, 5-4, 1-4, 2-3
Iteration 18: 1-2, 5-4, 1-4, 2-3, 3-4, 1-5
Iteration 19: 1-4, 2-3, 3-4, 1-5, 4-5, 1-2
Iteration 20: 3-4, 1-5, 4-5, 1-2, 5-2, 1-3
Iteration 971: 20-6, 8-2, 19-11, 18-13, 5-15, 10-14, 20-9, 17-12, 11-1, 19-10, 16-1, 6-4
Iteration 972: 19-11, 18-13, 5-15, 10-14, 20-9, 17-12, 11-1, 19-10, 16-1, 6-4, 15-9, 7-20
Iteration 973: 5-15, 10-14, 20-9, 17-12, 11-1, 19-10, 16-1, 6-4, 15-9, 7-20, 2-16, 5-7
Iteration 974: 20-9, 17-12, 11-1, 19-10, 16-1, 6-4, 15-9, 7-20, 2-16, 5-7, 17-4, 9-19
Iteration 975: 11-1, 19-10, 16-1, 6-4, 15-9, 7-20, 2-16, 5-7, 17-4, 9-19, 18-5, 13-15
Iteration 976: 16-1, 6-4, 15-9, 7-20, 2-16, 5-7, 17-4, 9-19, 18-5, 13-15, 1-20, 11-6
Iteration 977: 15-9, 7-20, 2-16, 5-7, 17-4, 9-19, 18-5, 13-15, 1-20, 11-6, 11-8, 6-2
Iteration 978: 2-16, 5-7, 17-4, 9-19, 18-5, 13-15, 1-20, 11-6, 11-8, 6-2, 19-6, 9-2
Iteration 979: 17-4, 9-19, 18-5, 13-15, 1-20, 11-6, 11-8, 6-2, 19-6, 9-2, 11-4, 8-17
Iteration 980: 18-5, 13-15, 1-20, 11-6, 11-8, 6-2, 19-6, 9-2, 11-4, 8-17, 10-3, 14-13
Iteration 981: 1-20, 11-6, 11-8, 6-2, 19-6, 9-2, 11-4, 8-17, 10-3, 14-13, 19-17, 10-8
Iteration 982: 11-8, 6-2, 19-6, 9-2, 11-4, 8-17, 10-3, 14-13, 19-17, 10-8, 18-9, 11-2
Iteration 983: 19-6, 9-2, 11-4, 8-17, 10-3, 14-13, 19-17, 10-8, 18-9, 11-2, 16-11, 1-2
Iteration 984: 11-4, 8-17, 10-3, 14-13, 19-17, 10-8, 18-9, 11-2, 16-11, 1-2, 6-8, 19-14
Iteration 985: 10-3, 14-13, 19-17, 10-8, 18-9, 11-2, 16-11, 1-2, 6-8, 19-14, 10-7, 3-20
Iteration 986: 19-17, 10-8, 18-9, 11-2, 16-11, 1-2, 6-8, 19-14, 10-7, 3-20, 11-6, 4-8
Iteration 987: 18-9, 11-2, 16-11, 1-2, 6-8, 19-14, 10-7, 3-20, 11-6, 4-8, 8-12, 10-3
Iteration 988: 16-11, 1-2, 6-8, 19-14, 10-7, 3-20, 11-6, 4-8, 8-12, 10-3, 2-15, 16-9
Iteration 989: 6-8, 19-14, 10-7, 3-20, 11-6, 4-8, 8-12, 10-3, 2-15, 16-9, 16-18, 9-5
Iteration 990: 10-7, 3-20, 11-6, 4-8, 8-12, 10-3, 2-15, 16-9, 16-18, 9-5, 19-18, 17-9
Iteration 991: 11-6, 4-8, 8-12, 10-3, 2-15, 16-9, 16-18, 9-5, 19-18, 17-9, 19-16, 18-11
Iteration 992: 8-12, 10-3, 2-15, 16-9, 16-18, 9-5, 19-18, 17-9, 19-16, 18-11, 17-20, 9-1
Iteration 993: 2-15, 16-9, 16-18, 9-5, 19-18, 17-9, 19-16, 18-11, 17-20, 9-1, 8-1, 12-2
Iteration 994: 16-18, 9-5, 19-18, 17-9, 19-16, 18-11, 17-20, 9-1, 8-1, 12-2, 15-1, 13-9
Iteration 995: 19-18, 17-9, 19-16, 18-11, 17-20, 9-1, 8-1, 12-2, 15-1, 13-9, 8-11, 4-18
Iteration 996: 19-16, 18-11, 17-20, 9-1, 8-1, 12-2, 15-1, 13-9, 8-11, 4-18, 16-14, 19-13
Iteration 997: 17-20, 9-1, 8-1, 12-2, 15-1, 13-9, 8-11, 4-18, 16-14, 19-13, 11-13, 6-9
Iteration 998: 8-1, 12-2, 15-1, 13-9, 8-11, 4-18, 16-14, 19-13, 11-13, 6-9, 13-10, 19-3
Iteration 999: 15-1, 13-9, 8-11, 4-18, 16-14, 19-13, 11-13, 6-9, 13-10, 19-3, 13-17, 10-12
Iteration 1000: 8-11, 4-18, 16-14, 19-13, 11-13, 6-9, 13-10, 19-3, 13-17, 10-12, 19-10, 14-12

You might also like