2-opt as a sequential move
Let us consider 2-opt move described in the following way:
- Step 0:
- Start from certain city
c1
on tour.
- Start from certain city
- Step 1:
- Remove link between
c1
and one of its tour neighbors,c2
. - Add link between
c2
and some other cityc3
.
- Remove link between
- Step 2:
- Remove link between
c3
and its tour neighborc4
. - Add link between
c4
and the first cityc1
, to close the tour.
- Remove link between
Note that steps 1 and 2 have the same scheme: remove a link between a city and its tour neighbor and then add link between this neighbor and some other city. Each step exchanges two links.
Example of 3-opt sequential move
We can extend 2-opt move to 3-opt move using the same scheme. Step 1 would be the same as in 2-opt move, so we show the procedure from step 2. Note that the only difference is in part B of this step:
- Step 2:
- Remove link between
c3
and its tour neighborc4
. - Add link between
c4
and the some other cityc5
.
- Remove link between
- Step 3:
- Remove link between
c5
and its tour neighborc6
. - Add link between
c6
and the first cityc1
, to close the tour.
- Remove link between
Example of 4-opt sequential move
- Step 3:
- Remove link between
c5
and its tour neighborc6
. - Add link between
c6
and the some other cityc7
.
- Remove link between
- Step 4:
- Remove link between
c7
and its tour neighborc8
. - Add link between
c8
and the first cityc1
, to close the tour.
- Remove link between
General scheme of a sequential move
As we can see the general scheme of sequential move is as follows:
- Step 1
- Remove link between
c1
and its tour neighborc2
. - Add link between
c2
and somec3
.
- Remove link between
- Step 2
- Remove link between
c3
and its tour neighborc4
. - Add link between
c4
and somec5
.
- Remove link between
- ...
- Last step can close the tour this way:
- Remove link between
c_2k1
and its tour neighborc_2k
. - Add link between
c_2k
and the first cityc1
, to close the tour.
The result of all steps is:
remove: (c1,c2) (c3,c4) (c5,c6) ... (c_2k1, c_2k) add: (c2,c3) (c4,c5) (c6,c7) ... (c_2k, c1)
No comments:
Post a Comment