Research Article
Reducing the Size of Combinatorial Optimization Problems Using the Operator Vaccine by Fuzzy Selector with Adaptive Heuristics
Algorithm 1
Pseudocode for implementing Nonrepeat Nearest Neighbor Distance Matrix. It is easier to save the indexes that refer to the original Distance Matrix.
Require: | (1) DM = GenerateDistanceMatrix() | (2) for ; < DM.Lenght; ; do | (3) Select all distances values for row | (4) Sort all values ascending, keep track of each index | (5) Take first elements from the sorted indexes | (6) if Elements are not in NNNDM then | (7) Add the pair row index, column index to NNNDM | (8) else | (9) Go back to taking first elements from the sorted indexes and repeat the check | (10) end if | (11) end for | (12) return NNNDM |
|