Monday, June 19, 2017

Lin-Kernighan algorithm basics – part 7

Now we can make a break and check out progress made so far. Suppose that we want to stop constructing starting LK move, and even more: stop constructing LK implementation. Then we would obtain code for sequential 4-opt optimization. This would need only small piece of code:

const
  OPT_5_IMPLEMENTED = false
proc LK_5Move(...): bool =
  result = false

Implementation of 4-opt sequential optimization obtained this way gives better resulting tours than simple implementation 3-opt with neighbor lists and DLB shown before. Moreover, it is much faster, although it does not use DLB (which can be easily added).

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 sequential 4-opt, both with neighbor lists. (Note that this 3-opt implementation uses slower method of applying moves than that in 4seq-opt.) Random planar problems, N=100.
Problem # Method Time Best Avg Worst
1NN100100.00110.42125.14
NN + 3opt-ND(24)439394.1495.3498.10
NN + 4seq-opt-ND(24)68194.1494.9196.41
2NN100100.00108.10121.20
NN + 3opt-ND(24)439386.6888.6490.28
NN + 4seq-opt-ND(24)126886.6887.7691.14
3NN100100.00109.51118.10
NN + 3opt-ND(24)449390.2591.8093.73
NN + 4seq-opt-ND(24)116889.6690.8892.49
4NN100100.00109.58118.16
NN + 3opt-ND(24)449388.7890.5593.41
NN + 4seq-opt-ND(24)185088.7890.1591.85
5NN100100.00111.02122.46
NN + 3opt-ND(24)410090.4291.9794.34
NN + 4seq-opt-ND(24)107490.4291.3892.17
6NN100100.00111.49125.67
NN + 3opt-ND(24)458787.9189.8291.69
NN + 4seq-opt-ND(24)117487.8888.6690.99
7NN100100.00108.23121.77
NN + 3opt-ND(24)449392.8293.8496.40
NN + 4seq-opt-ND(24)116892.7193.7395.80
8NN100100.00106.07119.49
NN + 3opt-ND(24)458786.0087.7490.74
NN + 4seq-opt-ND(24)146285.7786.7588.27
9NN100100.00111.77124.00
NN + 3opt-ND(24)449393.2594.1896.55
NN + 4seq-opt-ND(24)195092.8493.8295.23
10NN100100.00110.89117.01
NN + 3opt-ND(24)429390.2391.0294.77
NN + 4seq-opt-ND(24)136890.1690.6592.93

No comments:

Post a Comment