proc Make_5opt_Move(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10: City_Number;
tourOrder: int) =
case tourOrder # all 148 cases of sequential 5-opt move
of TO_129A347856, TO_12569A3478, TO_129A785634, TO_12569A7834:
ExchangeLinks(c1, c2, c9, c10)
ExchangeLinks(c1, c9, c7, c8)
ExchangeLinks(c1, c7, c5, c6)
ExchangeLinks(c1, c5, c3, c4)
ExchangeLinks(c1, c3, c10, c2)
of TO_12A9347856, TO_129A563487, TO_12A9784356, TO_129A874356:
ExchangeLinks(c8, c7, c9, c10)
ExchangeLinks(c1, c2, c10, c7)
ExchangeLinks(c2, c7, c5, c6)
ExchangeLinks(c2, c5, c3, c4)
of TO_129A348756, TO_129A346587, TO_129A873465, TO_129A875634,
TO_1243A97856, TO_12439A8756, TO_1256439A87:
ExchangeLinks(c8, c7, c9, c10)
ExchangeLinks(c1, c2, c10, c7)
ExchangeLinks(c2, c7, c3, c4)
ExchangeLinks(c4, c7, c5, c6)
of TO_12A9348756, TO_12A9346587, TO_1278A93465, TO_12A9783465,
TO_12A9657834, TO_1243A96578:
ExchangeLinks(c1, c2, c10, c9)
ExchangeLinks(c2, c9, c3, c4)
ExchangeLinks(c4, c9, c7, c8)
ExchangeLinks(c4, c7, c5, c6)
of TO_1278349A56:
ExchangeLinks(c1, c2, c9, c10)
ExchangeLinks(c3, c4, c6, c5)
ExchangeLinks(c1, c9, c7, c8)
ExchangeLinks(c1, c7, c3, c6)
ExchangeLinks(c1, c3, c10, c2)
of TO_127834A956, TO_12A9784365:
ExchangeLinks(c1, c2, c10, c9)
ExchangeLinks(c6, c5, c7, c8)
ExchangeLinks(c2, c9, c3, c4)
ExchangeLinks(c4, c9, c5, c8)
of TO_1287349A56:
ExchangeLinks(c7, c8, c10, c9)
ExchangeLinks(c3, c4, c6, c5)
ExchangeLinks(c1, c2, c10, c7)
ExchangeLinks(c2, c7, c3, c6)
of TO_128734A956, TO_12657834A9:
ExchangeLinks(c1, c2, c10, c9)
ExchangeLinks(c3, c4, c6, c5)
ExchangeLinks(c2, c9, c7, c8)
ExchangeLinks(c2, c7, c3, c6)
of TO_129A347865:
ExchangeLinks(c3, c4, c6, c5)
ExchangeLinks(c8, c7, c9, c10)
ExchangeLinks(c1, c2, c10, c7)
ExchangeLinks(c2, c7, c3, c6)
of TO_12A9347865, TO_12A9785634, TO_125643A978, TO_12568743A9:
ExchangeLinks(c1, c2, c10, c9)
ExchangeLinks(c2, c9, c3, c4)
ExchangeLinks(c4, c9, c5, c6)
ExchangeLinks(c6, c9, c7, c8)
of TO_12783465A9, TO_12438756A9:
ExchangeLinks(c1, c2, c10, c9)
ExchangeLinks(c5, c6, c8, c7)
ExchangeLinks(c2, c9, c5, c8)
ExchangeLinks(c2, c5, c3, c4)
of TO_1278349A65:
ExchangeLinks(c6, c5, c7, c8)
ExchangeLinks(c1, c2, c4, c3)
ExchangeLinks(c1, c4, c8, c5)
ExchangeLinks(c1, c8, c10, c9)
of TO_12873465A9, TO_127856A934, TO_12437856A9:
ExchangeLinks(c1, c2, c10, c9)
ExchangeLinks(c4, c3, c5, c6)
ExchangeLinks(c3, c6, c8, c7)
ExchangeLinks(c2, c9, c3, c8)
of TO_1287349A65:
ExchangeLinks(c7, c8, c10, c9)
ExchangeLinks(c1, c2, c4, c3)
ExchangeLinks(c1, c4, c6, c5)
ExchangeLinks(c1, c6, c10, c7)
of TO_12879A3465, TO_12879A6534:
ExchangeLinks(c7, c8, c10, c9)
ExchangeLinks(c6, c5, c7, c10)
ExchangeLinks(c1, c2, c10, c5)
ExchangeLinks(c2, c5, c3, c4)
of TO_1256349A78:
ExchangeLinks(c1, c2, c9, c10)
ExchangeLinks(c5, c6, c8, c7)
ExchangeLinks(c1, c9, c5, c8)
ExchangeLinks(c1, c5, c3, c4)
ExchangeLinks(c1, c3, c10, c2)
of TO_125634A978, TO_1256A93478, TO_12875634A9, TO_12874356A9:
ExchangeLinks(c1, c2, c10, c9)
ExchangeLinks(c5, c6, c8, c7)
ExchangeLinks(c3, c4, c8, c5)
ExchangeLinks(c2, c9, c3, c8)
of TO_129A563478:
ExchangeLinks(c1, c2, c9, c10)
ExchangeLinks(c2, c10, c3, c4)
ExchangeLinks(c1, c9, c7, c8)
ExchangeLinks(c1, c7, c5, c6)
ExchangeLinks(c1, c5, c10, c4)
of TO_12A9563478, TO_12A9653487, TO_12784356A9:
ExchangeLinks(c1, c2, c10, c9)
ExchangeLinks(c2, c9, c3, c4)
ExchangeLinks(c5, c6, c8, c7)
ExchangeLinks(c4, c9, c5, c8)
of TO_12563487A9, TO_12569A3487, TO_12659A3478, TO_12659A7834,
TO_1243A95687, TO_1243659A78, TO_12657843A9:
ExchangeLinks(c5, c6, c8, c7)
ExchangeLinks(c1, c2, c10, c9)
ExchangeLinks(c2, c9, c3, c4)
ExchangeLinks(c4, c9, c5, c8)
of TO_1256349A87, TO_125687A943, TO_126578A943:
ExchangeLinks(c5, c6, c8, c7)
ExchangeLinks(c1, c2, c4, c3)
ExchangeLinks(c1, c4, c8, c5)
ExchangeLinks(c1, c8, c10, c9)
of TO_1278569A34:
ExchangeLinks(c1, c2, c9, c10)
ExchangeLinks(c4, c3, c5, c6)
ExchangeLinks(c1, c9, c7, c8)
ExchangeLinks(c1, c7, c3, c6)
ExchangeLinks(c1, c3, c10, c2)
of TO_1287569A34:
ExchangeLinks(c7, c8, c10, c9)
ExchangeLinks(c4, c3, c5, c6)
ExchangeLinks(c1, c2, c10, c7)
ExchangeLinks(c2, c7, c3, c6)
of TO_1287A95634, TO_12A9568734, TO_128743A956, TO_127843A965:
ExchangeLinks(c1, c2, c10, c9)
ExchangeLinks(c2, c9, c3, c4)
ExchangeLinks(c6, c5, c7, c8)
ExchangeLinks(c4, c9, c5, c8)
of TO_1256A97834, TO_127865A943:
ExchangeLinks(c1, c2, c10, c9)
ExchangeLinks(c4, c3, c5, c6)
ExchangeLinks(c2, c9, c3, c6)
ExchangeLinks(c6, c9, c7, c8)
of TO_12568734A9, TO_12658743A9:
ExchangeLinks(c1, c2, c10, c9)
ExchangeLinks(c2, c9, c7, c8)
ExchangeLinks(c3, c4, c6, c5)
ExchangeLinks(c2, c7, c3, c6)
of TO_125687A934, TO_126578A934:
ExchangeLinks(c1, c2, c10, c9)
ExchangeLinks(c6, c5, c7, c8)
ExchangeLinks(c4, c3, c5, c8)
ExchangeLinks(c2, c9, c3, c8)
of TO_12569A8734:
ExchangeLinks(c5, c6, c8, c7)
ExchangeLinks(c1, c2, c10, c9)
ExchangeLinks(c4, c3, c5, c8)
ExchangeLinks(c2, c9, c3, c8)
of TO_1265349A78, TO_12A9435687, TO_12A9436578:
ExchangeLinks(c5, c6, c8, c7)
ExchangeLinks(c1, c2, c10, c9)
ExchangeLinks(c2, c9, c5, c8)
ExchangeLinks(c2, c5, c3, c4)
of TO_126534A978, TO_1265879A34, TO_12786534A9, TO_1278659A34,
TO_12785643A9:
ExchangeLinks(c4, c3, c5, c6)
ExchangeLinks(c1, c2, c10, c9)
ExchangeLinks(c2, c9, c3, c6)
ExchangeLinks(c6, c9, c7, c8)
of TO_1265A93478, TO_1256A94378:
ExchangeLinks(c1, c2, c10, c9)
ExchangeLinks(c2, c9, c7, c8)
ExchangeLinks(c4, c3, c5, c6)
ExchangeLinks(c2, c7, c3, c6)
of TO_129A653478:
ExchangeLinks(c5, c6, c8, c7)
ExchangeLinks(c1, c2, c4, c3)
ExchangeLinks(c1, c4, c10, c9)
ExchangeLinks(c4, c9, c5, c8)
of TO_12A9653478, TO_12653487A9, TO_126587A934, TO_12436587A9:
ExchangeLinks(c1, c2, c10, c9)
ExchangeLinks(c2, c9, c7, c8)
ExchangeLinks(c2, c7, c5, c6)
ExchangeLinks(c2, c5, c3, c4)
of TO_1265349A87, TO_1278A96534, TO_1278569A43, TO_1278A95643:
ExchangeLinks(c4, c3, c5, c6)
ExchangeLinks(c1, c2, c6, c3)
ExchangeLinks(c1, c6, c8, c7)
ExchangeLinks(c1, c8, c10, c9)
of TO_1265A93487, TO_128756A943:
ExchangeLinks(c1, c2, c10, c9)
ExchangeLinks(c5, c6, c8, c7)
ExchangeLinks(c4, c3, c5, c8)
ExchangeLinks(c2, c9, c3, c8)
of TO_129A658734:
ExchangeLinks(c8, c7, c9, c10)
ExchangeLinks(c1, c2, c10, c7)
ExchangeLinks(c4, c3, c5, c6)
ExchangeLinks(c2, c7, c3, c6)
of TO_12A9658734, TO_12A9564378:
ExchangeLinks(c4, c3, c5, c6)
ExchangeLinks(c1, c2, c10, c9)
ExchangeLinks(c2, c9, c7, c8)
ExchangeLinks(c2, c7, c3, c6)
of TO_129A786534:
ExchangeLinks(c6, c5, c7, c8)
ExchangeLinks(c8, c5, c9, c10)
ExchangeLinks(c1, c2, c10, c5)
ExchangeLinks(c2, c5, c3, c4)
of TO_1287A96534, TO_124378A956, TO_1278A94356, TO_124387A965:
ExchangeLinks(c1, c2, c10, c9)
ExchangeLinks(c6, c5, c7, c8)
ExchangeLinks(c2, c9, c5, c8)
ExchangeLinks(c2, c5, c3, c4)
of TO_12439A5687:
ExchangeLinks(c1, c2, c4, c3)
ExchangeLinks(c8, c7, c9, c10)
ExchangeLinks(c1, c4, c10, c7)
ExchangeLinks(c4, c7, c5, c6)
of TO_129A435687, TO_129A437856, TO_12879A4356, TO_124365A978,
TO_12437865A9, TO_12874365A9, TO_129A564378, TO_129A568743,
TO_12879A5643, TO_12659A4387, TO_1265879A43, TO_1278659A43:
ExchangeLinks(c1, c2, c4, c3)
ExchangeLinks(c1, c4, c10, c9)
ExchangeLinks(c4, c9, c5, c6)
ExchangeLinks(c6, c9, c7, c8)
of TO_1243879A56, TO_1278439A56:
ExchangeLinks(c1, c2, c4, c3)
ExchangeLinks(c6, c5, c7, c8)
ExchangeLinks(c1, c4, c10, c9)
ExchangeLinks(c4, c9, c5, c8)
of TO_12A9438756:
ExchangeLinks(c1, c2, c10, c9)
ExchangeLinks(c3, c4, c6, c5)
ExchangeLinks(c2, c9, c3, c6)
ExchangeLinks(c6, c9, c7, c8)
of TO_12439A6578, TO_12439A7865, TO_1243879A65, TO_1278439A65:
ExchangeLinks(c1, c2, c4, c3)
ExchangeLinks(c1, c4, c6, c5)
ExchangeLinks(c1, c6, c10, c9)
ExchangeLinks(c6, c9, c7, c8)
of TO_129A436578, TO_12569A4378, TO_129A785643, TO_1287569A43:
ExchangeLinks(c1, c2, c4, c3)
ExchangeLinks(c1, c4, c10, c9)
ExchangeLinks(c4, c9, c7, c8)
ExchangeLinks(c4, c7, c5, c6)
of TO_1243659A87, TO_129A436587, TO_124378A965, TO_129A874365,
TO_12569A4387, TO_12569A8743:
ExchangeLinks(c1, c2, c4, c3)
ExchangeLinks(c1, c4, c6, c5)
ExchangeLinks(c1, c6, c8, c7)
ExchangeLinks(c1, c8, c10, c9)
of TO_1243A96587, TO_128743A965:
ExchangeLinks(c1, c2, c10, c9)
ExchangeLinks(c3, c4, c6, c5)
ExchangeLinks(c3, c6, c8, c7)
ExchangeLinks(c2, c9, c3, c8)
of TO_12A9437865, TO_12564387A9, TO_1287A95643:
ExchangeLinks(c1, c2, c10, c9)
ExchangeLinks(c2, c9, c7, c8)
ExchangeLinks(c2, c7, c3, c4)
ExchangeLinks(c4, c7, c5, c6)
of TO_129A784365, TO_12569A7843, TO_12659A8743:
ExchangeLinks(c1, c2, c4, c3)
ExchangeLinks(c1, c4, c10, c9)
ExchangeLinks(c6, c5, c7, c8)
ExchangeLinks(c4, c9, c5, c8)
of TO_1287A94365:
ExchangeLinks(c1, c2, c10, c9)
ExchangeLinks(c6, c5, c7, c8)
ExchangeLinks(c3, c4, c8, c5)
ExchangeLinks(c2, c9, c3, c8)
of TO_1256439A78:
ExchangeLinks(c1, c2, c4, c3)
ExchangeLinks(c5, c6, c8, c7)
ExchangeLinks(c1, c4, c10, c9)
ExchangeLinks(c4, c9, c5, c8)
of TO_12A9564387:
ExchangeLinks(c1, c2, c10, c9)
ExchangeLinks(c5, c6, c8, c7)
ExchangeLinks(c2, c9, c3, c4)
ExchangeLinks(c4, c9, c5, c8)
of TO_1256A97843, TO_129A658743:
ExchangeLinks(c8, c7, c9, c10)
ExchangeLinks(c1, c2, c4, c3)
ExchangeLinks(c1, c4, c6, c5)
ExchangeLinks(c1, c6, c10, c7)
of TO_1265A94387, TO_1265A97843:
ExchangeLinks(c1, c2, c10, c9)
ExchangeLinks(c4, c3, c5, c6)
ExchangeLinks(c2, c9, c7, c8)
ExchangeLinks(c2, c7, c3, c6)
of TO_129A657843:
ExchangeLinks(c1, c2, c4, c3)
ExchangeLinks(c1, c4, c10, c9)
ExchangeLinks(c5, c6, c8, c7)
ExchangeLinks(c4, c9, c5, c8)
else:
echo "Unknown 5-opt move: ", tourOrder
quit 1
Some simple statistics
Relative time, best length, average length and worst length for all tours created by NN heuristic and improved by 3-opt and simple Lin-Kernighan algorithm implementation with sequential 5-opt starting move.
Neighbor lists size=24, LK breadth=(5, 5, 5, 5, 3, 3), LK depth=55.
Random planar problems, N=100.
Problem # | Method | Time | Best | Avg | Worst |
1 | NN | 100 | 100.00 | 104.58 | 111.49 |
3opt-ND(24) | 4981 | 82.10 | 84.07 | 87.66 |
LK 5+2 | 4687 | 81.89 | 82.51 | 84.62 |
2 | NN | 100 | 100.00 | 105.94 | 113.41 |
3opt-ND(24) | 5862 | 88.05 | 89.30 | 91.10 |
LK 5+2 | 5268 | 87.87 | 88.32 | 89.12 |
3 | NN | 100 | 100.00 | 110.21 | 118.39 |
3opt-ND(24) | 5862 | 88.69 | 89.22 | 92.23 |
LK 5+2 | 3025 | 88.69 | 88.74 | 90.17 |
4 | NN | 100 | 100.00 | 110.71 | 121.43 |
3opt-ND(24) | 4981 | 88.49 | 90.36 | 94.79 |
LK 5+2 | 5174 | 88.22 | 88.94 | 91.08 |
5 | NN | 100 | 100.00 | 106.48 | 112.81 |
3opt-ND(24) | 6249 | 83.91 | 86.88 | 91.43 |
LK 5+2 | 11518 | 83.36 | 83.96 | 85.16 |
6 | NN | 100 | 100.00 | 107.73 | 119.37 |
3opt-ND(24) | 6637 | 89.29 | 90.93 | 94.26 |
LK 5+2 | 3906 | 89.29 | 89.66 | 91.21 |
7 | NN | 100 | 100.00 | 111.26 | 124.70 |
3opt-ND(24) | 5275 | 94.92 | 97.82 | 103.58 |
LK 5+2 | 3025 | 94.92 | 95.47 | 98.97 |
9 | NN | 100 | 100.00 | 106.52 | 117.51 |
3opt-ND(24) | 5662 | 87.42 | 89.30 | 91.69 |
LK 5+2 | 6837 | 87.33 | 88.43 | 90.56 |
9 | NN | 100 | 100.00 | 105.63 | 112.79 |
3opt-ND(24) | 5368 | 85.57 | 87.72 | 90.64 |
LK 5+2 | 5374 | 85.57 | 86.04 | 87.80 |
10 | NN | 100 | 100.00 | 107.49 | 119.01 |
3opt-ND(24) | 4687 | 91.04 | 92.89 | 94.33 |
LK 5+2 | 4006 | 90.79 | 91.50 | 93.80 |
No comments:
Post a Comment