Research Article

Dynamic Reduction-Expansion Operator to Improve Performance of Genetic Algorithms for the Traveling Salesman Problem

Pseudocode 2

Pseudo-code of the sequencing process (nearest neighbor strategy).
= current node;
Initialization:
route_min_cost = [p] % TSP route of minimum cost starts at node 1
Sequencing:
while ≠ ⌀
closest_node =  node in R with the minimum distance to p. If more than one node comply with this
requirement, then it is randomly selected from the complying set of nodes.
;
route_min_cost = [route_min_cost closest_mode];  % closest_node is inserted at the right side of
current route_min_cost
p=closest_node; % current node is updated with the closest node
end
route_min_cost = [route_min_cost 1]; %the TSP route ends at node 1