Genetic Algorithms
Presented By: Mudit Verma
Motivation
Initial States – Poor Solutions
Desired States – Better Solutions
Introduction
• A Search Heuristic & optimization solution
• Natural Evolution
 Inheritance - Hereditary
 Crossover – exchange of characteristics
 Biological Mutation – Gene Alteration
 Natural Selection - Survival of the Fittest
How it Works
• Five key phases
Initial Population
Fitness Function
Crossover
Mutation
Selection
Initial Population
• Population of Strings encoding characteristics
• Chromosome are represented in binary as strings of 0s and 1s.
 other encodings are also possible
• Initial Population may already be known or randomly generated
X1 X2 X3 X4 X5 … … … Xn
Chromosome or Genome
Individual Characteristics of a chromosome
Fitness Function
• A deterministic evaluation of a solution.
• Objective function to determine the merit of a solution.
• More fitness -> Better solution -> More probability to survive
0010 0101 1100 1000 1010
0110 0001 1101 0110 1111
0010 0111 1000 0011 1011
0000 1101 1101 0100 1110
10
14
4
1
Fitness
Value
Crossover
X1 X2 X3 X4 X5 X6 X7 X8 X9
Y1 Y2 Y3 Y4 Y5 Y6 Y7 Y8 Y9
X1 X2 X3 X4 X5 X6 Y7 Y8 Y9
Y1 Y2 Y3 Y4 Y5 Y6 X7 X8 X9
Previous Generation
Next Generation
Crossover point
10
7
13
4
Selection
• In every generation fitness values chromosomes are sorted.
Most fit chromosomes survive to reproduce.
Rest are dropped from the population.
Survival of The Fittest
0010 0101 1100 1000 1010
0110 0001 1101 0110 1111
0010 0111 1000 0011 1011
0000 0111 1101 0110 1110
20
14
13
8
0010 1111 1000 0111 1010
0000 1101 1101 0101 1110
4
1
Mutation
• Mutation to maintain genetic diversity
• Mutation may happen
at one more or more places in chromosome
In many chromosomes in a generation
• Probabilistic
1 0 1 0 0 1 0
↓
1 0 1 0 1 1 0
Algorithm
1. Choose the initial population
2. Evaluate the fitness of each individual
3. Repeat until time limit, sufficient fitness achieved,
saturation etc.
Select the best-fit individuals for reproduction
Breed new individuals through crossover and
mutation operations to give birth to offspring
Evaluate the individual fitness of new individuals
Replace least-fit population with new individuals
Source: www.eis.uva.es/elena/newcomersGAs.htm
Evaluation
• Varies from Problem to Problem.
• Careful about
Encoding
Fitness Function
Mutation Probability
When to stop
Conclusion
• A tool for optimization & solution search problems.
• Applying real life evolution to engineering problems.
• Applications in
 Bioinformatics
Computational Science
Gaming
Applied Physics
Economics & Finance
Chemistry
Manufacturing
Thank You !!

Genetic algorithm

  • 1.
  • 2.
    Motivation Initial States –Poor Solutions Desired States – Better Solutions
  • 3.
    Introduction • A SearchHeuristic & optimization solution • Natural Evolution  Inheritance - Hereditary  Crossover – exchange of characteristics  Biological Mutation – Gene Alteration  Natural Selection - Survival of the Fittest
  • 4.
    How it Works •Five key phases Initial Population Fitness Function Crossover Mutation Selection
  • 5.
    Initial Population • Populationof Strings encoding characteristics • Chromosome are represented in binary as strings of 0s and 1s.  other encodings are also possible • Initial Population may already be known or randomly generated X1 X2 X3 X4 X5 … … … Xn Chromosome or Genome Individual Characteristics of a chromosome
  • 6.
    Fitness Function • Adeterministic evaluation of a solution. • Objective function to determine the merit of a solution. • More fitness -> Better solution -> More probability to survive 0010 0101 1100 1000 1010 0110 0001 1101 0110 1111 0010 0111 1000 0011 1011 0000 1101 1101 0100 1110 10 14 4 1 Fitness Value
  • 7.
    Crossover X1 X2 X3X4 X5 X6 X7 X8 X9 Y1 Y2 Y3 Y4 Y5 Y6 Y7 Y8 Y9 X1 X2 X3 X4 X5 X6 Y7 Y8 Y9 Y1 Y2 Y3 Y4 Y5 Y6 X7 X8 X9 Previous Generation Next Generation Crossover point 10 7 13 4
  • 8.
    Selection • In everygeneration fitness values chromosomes are sorted. Most fit chromosomes survive to reproduce. Rest are dropped from the population. Survival of The Fittest 0010 0101 1100 1000 1010 0110 0001 1101 0110 1111 0010 0111 1000 0011 1011 0000 0111 1101 0110 1110 20 14 13 8 0010 1111 1000 0111 1010 0000 1101 1101 0101 1110 4 1
  • 9.
    Mutation • Mutation tomaintain genetic diversity • Mutation may happen at one more or more places in chromosome In many chromosomes in a generation • Probabilistic 1 0 1 0 0 1 0 ↓ 1 0 1 0 1 1 0
  • 10.
    Algorithm 1. Choose theinitial population 2. Evaluate the fitness of each individual 3. Repeat until time limit, sufficient fitness achieved, saturation etc. Select the best-fit individuals for reproduction Breed new individuals through crossover and mutation operations to give birth to offspring Evaluate the individual fitness of new individuals Replace least-fit population with new individuals Source: www.eis.uva.es/elena/newcomersGAs.htm
  • 11.
    Evaluation • Varies fromProblem to Problem. • Careful about Encoding Fitness Function Mutation Probability When to stop
  • 12.
    Conclusion • A toolfor optimization & solution search problems. • Applying real life evolution to engineering problems. • Applications in  Bioinformatics Computational Science Gaming Applied Physics Economics & Finance Chemistry Manufacturing
  • 13.