replace the notion of one favorable swaps by a search of a favorable sequence of swaps
do not search for the entire set of sequences but build one incrementally.In fact,it's a process from 2-opt to 3-opt to 4-opt to···and then stop and compare all of these costs and find the best opt.
find a good k dynamically at a fraction of the cost
explore a sequence of swaps of increasing sizes
![](https://img-blog.csdnimg.cn/img_convert/269b1f7f2f69de4471d0ca40b1c9008a.png)
steps:
choose a vertex
and its edge
=(
,
) (cause this edge is long)
![](https://img-blog.csdnimg.cn/img_convert/ee0764080620b9e9f0564c686bea4377.png)
choose an edge
=(
,
) with d(
)<d(
)
![](https://img-blog.csdnimg.cn/img_convert/b22a72aba2aa4b18b52cdf2d14b6ce59.png)
if none exist,restart with another vertex
else,we have a solution by removing the edge (
,
) and connecting (
,
)
![](https://img-blog.csdnimg.cn/img_convert/1aeaeb1a3b5a79cc60377a06dddb8f5f.png)
compute the cost but do not connect (still, (
,
) is long)
instead, we restart the above process with
and its pretended edge (
,
)
![](https://img-blog.csdnimg.cn/img_convert/9f45168a86889a1636b07f039bbe43bb.png)
now it's like 3-opt, but still we don't want to stop here.do the above process (i.e. the k-opt algorithm) again and again and again···
![](https://img-blog.csdnimg.cn/img_convert/fc47fd727c71b1c2822631f8f36eeefd.png)
now it's like 4-opt. And we can stop here to get a good sequence because we can't find a shorter edge from
.
OK,so now we have done our first iteration, we can then choose another vertex and start the second iteration···