An overview of Genetic Algorithm
By David Beasley, David R. Bull and Ralph R. Martin

                    090070T – T.P.K. Dahanayakage
                    090150N – K.M.T.V. Ganegedara
Introduction


 Population Evolves
   Natural Selection
   Survival of the fittest


 Applications?
   Computer, Bridges, Garment, etc.
Analogy




 Think about successive generations
Analogy (ctd)




             Super-fit
 Evolve according to environment
Basic Concept


 Set of solutions for a problem
   Each solution – fitness score
 Reproduce a new set of solutions by
  “Cross-breeding”
   Most-fit: get selected
   Least-fit: not selected – die out
 Result?
   Offsprings with characteristics from most-
    fit
What just happened?


 Good characteristics of a generation
  was spread in a successive
  generation
 Most promising areas of solution
  space are searched
Algorithm

BEGIN
      Generate population
      Calculate fitness for each individual
      WHILE NOT CONVERGED DO
      BEGIN
            FOR population_size/2 DO
            BEGIN
                  Select 2 parents for mating
                  Combine and produce an offspring
                  Calculate the fitness for the new individual
                  Insert the offspring to the new generation
            END
      END
END
Lesson on Biology


 Chromosome
   Organized collection of coiled DNA

                      DNA
Fitness function


 Must represent the “fitness to the
  environment” or “ability” of a
  chromosome’s

 Issues of fitness range
   Premature convergence
   Slow finishing
Reproduction


 Selection of parents
   Random
   Favors the fittest


 Crossover
   Single point crossover
      Cut 2 chromosomes at a random point
      Swap over tails to create 2 new chromosomes
Reproduction (ctd)


 Crossover is not the only case!
   0.6 - 1.0 chance
   Otherwise replicate the parent


 Mutation
   Alter the genes of crossover-ed with a
    small probability
Example


 0101001100              1011001001




 0101001001               1011001100


   Before mutation: 0 1 0 1 0 0 1 0 0 1
   After mutation:    0101101001
Convergence


 Fitness of the BEST and AVERAGE
  moves to a global optimum

 Gene is said to have converged
   95% of the population has converged
 Population is said to have converged
   All the genes have converged
Other techniques
“Schemata” and “Scheme”


 Definition of Schema
    Pattern of gene
    String comprise {0,1,#}

 Ex: Chromosome 0110 contains following
  “Schemata”
    #110, #1#0, 01##, etc.

 A chromosome is said to contain a schema if
  it matches a particular schemata
 Order of schema – Number of non-#
  symbols
 Length of schema – Distance
  between outer most non-# symbols.

 Ex: #1#0
Schema Theorem


 Individuals in a population are given reproductive
  trials
 Number of trials α Fitness of an individual
 Higher fitness value -> Good schemata


 Good Schemata receives
  exponentially increasing number of
  trials in successive generations!
Building Block Hypothesis


 Definition
   Schemata short in length and tend to
    improve performance when incorporated
    to an individual

 Properties of a successful coding
  scheme
   Related genes close together
   Little interaction between genes
Exploration and Exploitation


 Exploration
    Exploring unknown areas
 Exploitation
    Utilizing already-learnt to find better solutions

 Tradeoff
    Ex: Random search and Hill climbing

 GA combines both in an optimal way!
Practical Aspects of GA
Parent selection


 Individuals are copied to a “mating
  pool”
   Highly fit – more copies
   Less fit – lesser copies

 How to determine number of copies?
   Explicit fitness remapping
   Implicit fitness remapping
Explicit fitness remapping


      Individual’s fitness
  Average fitness of population

 Issue: Number of copies should be an
  integer
 Solution:
   Fitness scaling
   Fitness windowing
Implicit fitness remapping


 Tournament selection
   2 random individuals
   Copy the one with higher fitness value
    to the mating pool
   Continue until the pool is full
Generation gaps and
steady-state replacement

 Generation gap
   Proportion of individuals in a population
    replaced in each generation

 Steady-state replacement
   Only few individuals are replaced in a
    generation
   Considerations:
      Parent selection – Random, Fitness
      Replacement – Random, Inverse fitness
Thank you


 Q & A Session

Genetic Algorithm

  • 1.
    An overview ofGenetic Algorithm By David Beasley, David R. Bull and Ralph R. Martin 090070T – T.P.K. Dahanayakage 090150N – K.M.T.V. Ganegedara
  • 2.
    Introduction  Population Evolves  Natural Selection  Survival of the fittest  Applications?  Computer, Bridges, Garment, etc.
  • 3.
    Analogy  Think aboutsuccessive generations
  • 4.
    Analogy (ctd) Super-fit  Evolve according to environment
  • 5.
    Basic Concept  Setof solutions for a problem  Each solution – fitness score  Reproduce a new set of solutions by “Cross-breeding”  Most-fit: get selected  Least-fit: not selected – die out  Result?  Offsprings with characteristics from most- fit
  • 6.
    What just happened? Good characteristics of a generation was spread in a successive generation  Most promising areas of solution space are searched
  • 7.
    Algorithm BEGIN Generate population Calculate fitness for each individual WHILE NOT CONVERGED DO BEGIN FOR population_size/2 DO BEGIN Select 2 parents for mating Combine and produce an offspring Calculate the fitness for the new individual Insert the offspring to the new generation END END END
  • 8.
    Lesson on Biology Chromosome  Organized collection of coiled DNA DNA
  • 9.
    Fitness function  Mustrepresent the “fitness to the environment” or “ability” of a chromosome’s  Issues of fitness range  Premature convergence  Slow finishing
  • 10.
    Reproduction  Selection ofparents  Random  Favors the fittest  Crossover  Single point crossover  Cut 2 chromosomes at a random point  Swap over tails to create 2 new chromosomes
  • 11.
    Reproduction (ctd)  Crossoveris not the only case!  0.6 - 1.0 chance  Otherwise replicate the parent  Mutation  Alter the genes of crossover-ed with a small probability
  • 12.
    Example 0101001100 1011001001 0101001001 1011001100 Before mutation: 0 1 0 1 0 0 1 0 0 1 After mutation: 0101101001
  • 13.
    Convergence  Fitness ofthe BEST and AVERAGE moves to a global optimum  Gene is said to have converged  95% of the population has converged  Population is said to have converged  All the genes have converged
  • 14.
  • 15.
    “Schemata” and “Scheme” Definition of Schema  Pattern of gene  String comprise {0,1,#}  Ex: Chromosome 0110 contains following “Schemata”  #110, #1#0, 01##, etc.  A chromosome is said to contain a schema if it matches a particular schemata
  • 16.
     Order ofschema – Number of non-# symbols  Length of schema – Distance between outer most non-# symbols.  Ex: #1#0
  • 17.
    Schema Theorem  Individualsin a population are given reproductive trials  Number of trials α Fitness of an individual  Higher fitness value -> Good schemata  Good Schemata receives exponentially increasing number of trials in successive generations!
  • 18.
    Building Block Hypothesis Definition  Schemata short in length and tend to improve performance when incorporated to an individual  Properties of a successful coding scheme  Related genes close together  Little interaction between genes
  • 19.
    Exploration and Exploitation Exploration  Exploring unknown areas  Exploitation  Utilizing already-learnt to find better solutions  Tradeoff  Ex: Random search and Hill climbing  GA combines both in an optimal way!
  • 20.
  • 21.
    Parent selection  Individualsare copied to a “mating pool”  Highly fit – more copies  Less fit – lesser copies  How to determine number of copies?  Explicit fitness remapping  Implicit fitness remapping
  • 22.
    Explicit fitness remapping Individual’s fitness Average fitness of population  Issue: Number of copies should be an integer  Solution:  Fitness scaling  Fitness windowing
  • 23.
    Implicit fitness remapping Tournament selection  2 random individuals  Copy the one with higher fitness value to the mating pool  Continue until the pool is full
  • 24.
    Generation gaps and steady-statereplacement  Generation gap  Proportion of individuals in a population replaced in each generation  Steady-state replacement  Only few individuals are replaced in a generation  Considerations:  Parent selection – Random, Fitness  Replacement – Random, Inverse fitness
  • 25.
    Thank you  Q& A Session

Editor's Notes

  • #5 Two parentsAttract matesOther hunting foodChild both characteristicsSuperfit
  • #10 There should not be too many local maximasThere shouldn’t be a single global maximumTherefore better chromosomes must be closely related.Problem: Preparing a time table.Invalid chromosomes must guide towards valid chromosomes, using fitness valueBetter to invest sub-goals rewarded going for the ultimate goalPremature convergence: Set of highly fit individuals come to dominate the population, making a local maxima. Which in turn make it difficult to converge to more effective solutionSlow finishing: Population might have converged, but might not have found a global maxima
  • #12 Passing the genes without disruption of crossoverProbability 0.001
  • #18 Better individuals -> more of their genes to next generationGood schemata - Likelihood of better solution increase
  • #19 Power of GA – Finding good building blocksInteraction – In a chromosome, contribution of a gene to the fitness value depends on values of other genesIssues: Might not allow closely related genes to be placed togetherInteraction between genes can become high (specially in multi-dimensional data)
  • #20 AssumptionsPopulation is infiniteFitness function accurately shows the effectiveness of a solutionGenes in a chromosome don’t interact significantlyGenetic drift, mutation rate