Skip to content

Latest commit

 

History

History

genetic-algorithms

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Genetic algorithms

Genetic algorithms (GAs) are algorithms inspired by the process of natural selection and evolution, used to find approximate solutions to complex problems by evolving a population of candidate solutions over multiple generations. Genetic algorithms are particularly useful when searching for solutions in large and complex solution spaces. The representation of the problem is crucial.

Steps:

  1. Initialize: Begin by creating an initial population of candidate solutions (often referred to as "chromosomes"). Each chromosome represents a potential solution to the problem.

  2. Evaluate: A fitness function measures how well each solution solves the problem. It quantifies the quality of each solution in terms of the problem's objectives.

  3. Select: Choose chromosomes based on fitness to act as parents for the next generation.

  4. Crossover (Recombination): Pair selected parent chromosomes, and perform crossover to create new child chromosomes.

  5. Mutate: Apply mutation operators to some of the child chromosomes. Mutation introduces small, random changes to individual chromosomes, to introduce diversity and prevent premature convergence.

  6. Replacement: Create a new population of chromosomes for the next generation. This may involve replacing some or all of the current population with the offspring created through crossover and mutation.

  7. Repeat for multiple generations, until a termination condition is met.

  8. End: Extract the best solution from the final population.