(1) Encode the parameters for the partitioning problem; |
(2) Initialize the first generation ; |
(3) Calculate the fitness of each individual in ; |
(4) Copy the individual with the highest fitness to the solution; |
(5) while (termination conditions) do |
(6) while (number of individuals generation size) do |
(7) Select two individuals ; |
(8) Perform crossover on ; |
(9) if (max{fitness(), fitness()} max{fitness(), fitness()}) then |
(10) Reject the crossover with ; |
(11) else |
(12) Accept the crossover; |
(13) end if |
(14) Perform mutation on to produce ; |
(15) if (fitness() fitness()) then |
(16) Reject the mutation, ; |
(17) else |
(18) Accept the mutation; |
(19) end if |
(20) Perform the above steps on to produce ; |
(21) end while |
(22) Calculate the fitness of each individual; |
(23) if (the highest fitness fitness(solution)) then |
(24) Copy the individual with the highest fitness; |
(25) end if |
(26) increase the generation number; |
(27) end while |
(28) return solution: , ; |