Research Article
A Hybrid Cellular Genetic Algorithm for the Traveling Salesman Problem
Algorithm 2
The pseudocode of genetic algorithm (GA) for solving TSP.
| Genetic algorithm (GA) for solving TSP | | Begin | | Input: city coordinates: , . selection probability Ps, crossover probability Pc, mutation probability Pm, the maximum number of iterations (Maxiter) | | Initialization: using ordinal coding to generate the initial population, number of iteration k = 1 | | while k ≤ Maxiter | | Selection | | Crossover | | Mutation | | New population | | Save the optimal result in the iteration | | k = k + 1 | | End while | | Output: the optimal result: | | End |
|