0. Individual: has at least two fields: - chromosome (a string of genes, such as an array of Boolean or a String of bits) and - fitness (a scalar value, such as a real number) 1. Create an initial population POP of POPSIZE individuals Gen Num := 0 2. Evaluate each individual in POP (suing BlackBox objective function). 3. Apply SELECTION to attain a NEWPOP. Can use Tournament Selection: For i = 1 to POSIZE by 1 { Select two individuals A and B at random, from POP. Compare the fitnesses of A and B. Put a COPY of the higher fit individual into NEWPOP. If a tie, select winner at random. } POP := NEWPOP 4. Apply CROSSOVER to obtain NEWPOP. Use single point crossover: For i = 1 to POSIZE by 2 { Select two individuals A and B at random, from POP. With probability p_c, cross them as follows: Pick a random crossover pt. CPbetween 0 and chrom_length. Copy bits before CP from parent A into child A' and from parent B into child B' Copy bits after CP from parent A into child B' and from parent B into child A' (so with prob. 1-p_c, do not cross. Just copy A to A', and B to B') } POP := NEWPOP 5. Apply MUTATION to obtain NEWPOP. Use single bit flip: For i = 1 to POSIZE by 1 { Select one individuals A at random, from POP. For(j = 0 to chrom_length by 1) { With probability p_m, mutate chromosome[j] by flipping 0 to 1 or 1 to 0. } } POP := NEWPOP 6. Gen_Num ++ 7. If (Gen_Num < MAX_GENS) goto (1.)