Skip to main content
. 2020 Aug 25;142:102060. doi: 10.1016/j.tre.2020.102060
Algorithm 2: First neighborhood operator
Notations:
NSN Number of demand nodes (Number of columns).
RAIN A random integer number in the range of[1,NSN].
NOR Number of rows in a solution (nor=1,2,,NOR).
RNP1 First random position number.
RNP2 Second random position number (RNP1RNP2).
NUCnor Number of used (non-empty) cells on the north row.
VALnorRNP1 The value on the RNP1 column and nor row.
VALnorRNP2 The value on the RNP2 column and nor row.
STR A set to store random numbers.
1. Generate an integer random number (RAIN) on the [1,NSN];
2. Preserve the first RAIN columns;
3. Fornor=1toNORdo
4.  Empty the set STR;
5.  Choose a random position (RNP1) in the range [RAIN+1,NUCnor];
6.  Add RNP1 to the set STR;
7.  Choose a random position (RNP2) in the range [RAIN+1,NUCnor];
8.  IfRNP2STRdo
9.   Swap the VALnorRNP1 and VALnorRNP2;
10.  End if
11. End For
Output: A new feasible solution.