Research Article
Genetic Algorithm for Traveling Salesman Problem with Modified Cycle Crossover Operator
Algorithm 1
Pseudo-code of proposed algorithm CX2.
← No. of Edges | ← Population Size | ← No. of Generations | ← Random Population | For each | | For each | | Distance ← square-root | | | For each | | | | For each 1 ≤ generation ≤ G | | For each | | Sum1 ← Distance | For each | | | | ← Sum1 + Sum2 | | ← Sort | | | Length ← Length | For each | | C1 ← zeros() | C2 ← zeros() | | | St1 ← 0 | St2 ← 0 | Where (Length(C1) ~= Length(P1)) | | (St1) ←(St1) | While () | | Ind1 ← find(P1 == C1(St1)) | Val1 ←P2(Ind1) | (St2) ← Val1 | St1 ← St1 + 1 | Ind2 ← find(P2 == C2(St2)) | Val2 ←(Ind2) | C1(St1) ← Val2 | St2 ← St2 + 1 | | | | | For each | | Sum1 ← Distance | For each | | Sum2 ← Distance | | | R← Sort() | ←() | ← | | | |
|