| Algorithm 4 Crossover | |
| Input | Population, mutation population, crossover parameter: cr |
| Output | New population |
| 1 | Initial Psnull |
| 2 | Randomly generate jrand and a real number r of size (np, cl) between 0 and 1. |
| 3 | fori < np do |
| 4 | for j < cl do |
| 5 | if r(i,j) < cr or j=jrand then |
| 6 | |
| 7 | else |
| 8 | |
| 9 | end if |
| 10 | Ps |
| 11 | end for |
| 12 | end for |
| 13 | return crossover population |