Skip to content

Sketch of Simple Program Genetic Algorithm


For almost 3 weeks I have been learning about Genetic Algorithm (GA), especially NSGA-2. So, I write this posting to help me to understand a little bit about GA. I found a good reference for beginners who learn about GA. A David A. Coley book, An Introduction to Genetic Algorithms for Scientists and Engineers. 
This is just a sketch of the program, not a real code.
Generation = 1
Create initial population   /* Build a population of strings at random */
Find unknown                 /* Decode the new population to integers then real numbers */
Find fitness                      /* Find the fitness of each member of population */
FOR Generation = 2 TO maximum number of generations
FOR NewIndividual = 1 to PopulationSize STEP 2 /* Loop over the population choosing pairs of mates */
           Select a mate
           Select other mate
           Perform Crossover      /* Pass individuals to the temporary population */
NEXT NewIndividual
Perform Mutate   /* Mutate the temporary population */
Replace               /* Replace the old population by the new one */
Find unknowns   /* Decode the new population to integers then real numbers */
Find fitness         /* Find the fitness of each member of population */
NEXT Generation

3 thoughts on “Sketch of Simple Program Genetic Algorithm”

Leave a Reply

Your email address will not be published. Required fields are marked *