Research Article

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

Pseudocode 1

Pseudo-code of the clustering and coding processes.
= % All nodes
= ⌀ % Set of coded nodes
= -coordinate of node i
= -coordinate of node i
= 1 % index for coded nodes
for = 1:N
for = + 1:
if
coded_nodes(r,1) = % node i is stored for clustering
coded_nodes(r,2) = % node j is stored for clustering
coded_nodes(r,3) = % x-coordinate of equivalent coded node for (i,j)
coded_nodes(r,4) = % y-coordinate of equivalent coded node for (i,j)
U = U% U is updated (i and j are removed from U)
R = % R is updated (equivalent coded node added to R)
r = r + 1
end
end
end
% Now, U contains the remaining nodes i that were not clustered or coded. These are added
to R as follows:
for= 1:
coded_nodes(r,1) = % node i is stored for assignment of new index r
coded_nodes(r,2) = - % there is no node j for non-clustered nodes
coded_nodes(r,3) = % -coodinate of node
coded_nodes(r,4) = % -coodinate of node
r = r + 1
end