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

Please follow and like us:

3 thoughts on “Sketch of Simple Program Genetic Algorithm”

Leave a Reply

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