Research Article
A Hybrid Cellular Genetic Algorithm for the Traveling Salesman Problem
Algorithm 5
The pseudocode of the dynamic evolution of the cellular space.
| Dynamic evolution of cellular space | | Begin | | Input: An n-th order square matrix N composed of 0 and 1, three cellular automata rules | | for i = 1 to n2 | | Calculate the sum K of 8 neighbors’ states | | if | | if K = 2 or K = 3 # rule 1 | | if K = 1 or K = 2 or K = 3 or K = 4 # rule 2 | | if K = 2 or K = 4 or K = 6 or K = 8 # rule 3 | | | | else | | | | End if | | else | | if K = 3 # rule 1 | | if K = 4 or K = 5 or K = 6 or K = 7 # rule 2 | | if K = 1 or K = 3 or K = 5 or K = 7 # rule 3 | | | | else | | | | End if | | End if | | End for | | Output: New square matrix N | | End |
|