GENETIC
ALGORITHM
Submitted by…
Pratheeban R
Register Number
103478165
Date
03/11/2012
Event
Seminar 1
Agenda
 Introduction
 Biological Background
 Search Space
 Genetic Algorithm
 Outline of Basic GA
 Operators of GA
 Crossover
 Mutation
 Parameters of GA
 Recommendations
 Application of GA
 Advantage & DisAdvantage
Introduction
 Inspired by Darwin's theory about Evolution
 Part of Evolutionary Computing
 Rapid growing area of AI
 EA Idea – I. Rechenberg – 1960 - “Evolution Strategies”
 GA Invent & Develop – John Holland team – “Adaption and Artificial
Systems” - 1975
 John Koza – 1992 – GA to evolve programs to perform certain task –
“Genetic Programming”
Biological Background
 CHROMOSOMES
 Each Cell – same set of chromosomes
 String of DNA & serves as model for whole organism
 Consist of Genes, blocks of DNA
 TRAIT - each Gene encodes a particular protein. E.g. Eye Color
 ALLELES - possible settings for Trait (e.g. blue, brown)
 LOCUS - each Gene’s own position in chromosome
 GENOME – complete set of genetic material
 GENOTYPE – particular set of genes in genome
 PHENOTYPE – genotype’s physical and mental characteristics (eye
color, intelligence)
 REPRODUCTION
 CROSSOVER (RECOMBINATION) – 1st occurs during reproduction
 Genes from parents form in some way the whole new chromosome (OFFSPRING) & can be
Mutated
 MUTATION – elements of DNA are a bit change
 This changes mainly caused by errors in copying genes from parents.
 FITNESS – measured by success of the organism in life
Search Space
 Space of all feasible solutions
 Each point in the search space represent one feasible solution
 Each feasible solution can be "marked" by its value or fitness for the
problem
 Considered as good solution (not often possible to prove what is real
optimum)
Genetic Algorithm
 Solution to a problem solved by genetic algorithms, is evolved
 Algorithm is started with a set of solutions (represented
by chromosomes) called Population
 Solutions from one population are taken and used to form a new
population for a better one.
 Solutions which are selected to form new solutions (offspring) are
selected according to their fitness - the more suitable they are the more
chances they have to reproduce
 Repeated until some condition is satisfied.
Outline of the Basic Genetic Algorithm
1. [Start] Generate random population of n chromosomes (suitable solutions
for the problem)
2. [Fitness] Evaluate the fitness f(x) of each chromosome x in the population
3. [New population] Create a new population by repeating following steps
until the new population is complete
1. [Selection] Select two parent chromosomes from a population according to their
fitness (the better fitness, the bigger chance to be selected)
2. [Crossover] With a crossover probability cross over the parents to form a new
offspring (children). If no crossover was performed, offspring is an exact copy of
parents.
3. [Mutation] With a mutation probability mutate new offspring at each locus
(position in chromosome).
4. [Accepting] Place new offspring in a new population
4. [Replace] Use new generated population for a further run of algorithm
5. [Test] If the end condition is satisfied, stop, and return the best solution in
current population
6. [Loop] Go to step 2
Operators of GA
Crossover + Mutation
 Encoding of a Chromosome
 represent chromosome in Binary String
 each chromosome has one binary string
 each bit in this string can represent some characteristic of the
solution
(OR)
 whole string can represent a number
 many ways to Encode – Depends on solved problem
Chromosome 1 1101100100110110
Chromosome 2 1101111000011110
Crossover
 Selects genes from parent chromosomes
 Creates a new offspring
 Depends on encoding of chromosome
 Specific crossover - specific problem – performance improvement of
GA
 New chromosomes will have good parts of old chromosomes & better
Chromosome 1 11011 | 00100110110
Chromosome 1 11011 | 00100110110
Offspring 1 11011 | 11000011110
Offspring 2 11011 | 00100110110
Mutation
 Prevents falling all solutions in population into a local optimum of
solved problem (local extreme)
 Changes randomly the new offspring
 for binary encoding, switch random chosen bit from 0 to 1 / 1 to 0
 Depends on encoding & crossover
 Should not occur very often, else GA will change to Random Search
Original offspring 1 1101111000011110
Original offspring 2 1101100100110110
Mutated offspring 1 1100111000011110
Mutated offspring 2 1101101100110110
Parameters of GA
Probability of Crossover & Mutation
 Crossover Probability
 crossover performation
 no crossover – offspring is exact copy of parents
 if crossover – offspring is made from parts of parents
 100 % - all offsprings made by crossover
 0 % - exact copies of old population
 Mutation Probability
 chromosome mutation
 no mutation – offspring crossover without any change
 if mutation - part of chromosome is changed
 100 % - whole chromosome change
 0 % - no change
Recommendations
 Crossover rate
 should be high ~ 80% - 95%.
 for some problems ~ 60% is the best
 Mutation rate
 mutation rate should be very low.
 best rates reported - 0.5% - 1%.
 Population size
 best population size depends on size of encoded string
 very big population size usually does not improve performance of GA
 good population size is about 20-30
 sometimes sizes 50-100 are reported as best
 32 bits chromosome – population 32
 16 bits chromosome - two times more than the best population size
 Selection
 basic roulette wheel selection
 rank selection can be better
 simulated annealing – sophisticated methods
 elitism should be used
 try steady state selection.
 Encoding
 Encoding depends on the problem & size of instance of the problem.
 Crossover and mutation type
 Operators depend on encoding & problem.
Applications of GA
 Nonlinear dynamical systems - predicting, data analysis
 Designing neural networks, both architecture and weights
 Robot trajectory
 Evolving LISP programs (genetic programming)
 Strategy planning
 Finding shape of protein molecules
 TSP and sequence scheduling
 Functions for creating images
Advantage & DisAdvantage
 Advantage
 parallelism
 travelling in a search space with more individuals so they are less
likely to get stuck in a local extreme like some other methods
 easy to implement
 have some GA, just write new chromosome to solve another
problem
 same encoding - change the fitness function
 DisAdvantage
 computational time
 slower than some other methods
 choosing encoding and fitness function can be difficult
 But with today’s computers it is not so big problem
Reference
 Rechenberg, Ingo (1973). Evolutionsstrategie. Stuttgart:
Holzmann-Froboog. ISBN 3-7728-0373-3.
 Srinivas. M and Patnaik. L, "Adaptive probabilities of crossover
and mutation in genetic algorithms," IEEE Transactions on
System, Man and Cybernetics, vol.24, no.4, pp.656–667, 1994.
 http://www.obitko.com/tutorials/genetic-algorithms/ga-basic-
description.php
Thank
You!

Genetic Algorithm

  • 1.
    GENETIC ALGORITHM Submitted by… Pratheeban R RegisterNumber 103478165 Date 03/11/2012 Event Seminar 1
  • 2.
    Agenda  Introduction  BiologicalBackground  Search Space  Genetic Algorithm  Outline of Basic GA  Operators of GA  Crossover  Mutation  Parameters of GA  Recommendations  Application of GA  Advantage & DisAdvantage
  • 3.
    Introduction  Inspired byDarwin's theory about Evolution  Part of Evolutionary Computing  Rapid growing area of AI  EA Idea – I. Rechenberg – 1960 - “Evolution Strategies”  GA Invent & Develop – John Holland team – “Adaption and Artificial Systems” - 1975  John Koza – 1992 – GA to evolve programs to perform certain task – “Genetic Programming”
  • 4.
    Biological Background  CHROMOSOMES Each Cell – same set of chromosomes  String of DNA & serves as model for whole organism  Consist of Genes, blocks of DNA  TRAIT - each Gene encodes a particular protein. E.g. Eye Color  ALLELES - possible settings for Trait (e.g. blue, brown)  LOCUS - each Gene’s own position in chromosome  GENOME – complete set of genetic material  GENOTYPE – particular set of genes in genome  PHENOTYPE – genotype’s physical and mental characteristics (eye color, intelligence)  REPRODUCTION  CROSSOVER (RECOMBINATION) – 1st occurs during reproduction  Genes from parents form in some way the whole new chromosome (OFFSPRING) & can be Mutated  MUTATION – elements of DNA are a bit change  This changes mainly caused by errors in copying genes from parents.  FITNESS – measured by success of the organism in life
  • 5.
    Search Space  Spaceof all feasible solutions  Each point in the search space represent one feasible solution  Each feasible solution can be "marked" by its value or fitness for the problem  Considered as good solution (not often possible to prove what is real optimum)
  • 6.
    Genetic Algorithm  Solutionto a problem solved by genetic algorithms, is evolved  Algorithm is started with a set of solutions (represented by chromosomes) called Population  Solutions from one population are taken and used to form a new population for a better one.  Solutions which are selected to form new solutions (offspring) are selected according to their fitness - the more suitable they are the more chances they have to reproduce  Repeated until some condition is satisfied.
  • 7.
    Outline of theBasic Genetic Algorithm 1. [Start] Generate random population of n chromosomes (suitable solutions for the problem) 2. [Fitness] Evaluate the fitness f(x) of each chromosome x in the population 3. [New population] Create a new population by repeating following steps until the new population is complete 1. [Selection] Select two parent chromosomes from a population according to their fitness (the better fitness, the bigger chance to be selected) 2. [Crossover] With a crossover probability cross over the parents to form a new offspring (children). If no crossover was performed, offspring is an exact copy of parents. 3. [Mutation] With a mutation probability mutate new offspring at each locus (position in chromosome). 4. [Accepting] Place new offspring in a new population 4. [Replace] Use new generated population for a further run of algorithm 5. [Test] If the end condition is satisfied, stop, and return the best solution in current population 6. [Loop] Go to step 2
  • 8.
    Operators of GA Crossover+ Mutation  Encoding of a Chromosome  represent chromosome in Binary String  each chromosome has one binary string  each bit in this string can represent some characteristic of the solution (OR)  whole string can represent a number  many ways to Encode – Depends on solved problem Chromosome 1 1101100100110110 Chromosome 2 1101111000011110
  • 9.
    Crossover  Selects genesfrom parent chromosomes  Creates a new offspring  Depends on encoding of chromosome  Specific crossover - specific problem – performance improvement of GA  New chromosomes will have good parts of old chromosomes & better Chromosome 1 11011 | 00100110110 Chromosome 1 11011 | 00100110110 Offspring 1 11011 | 11000011110 Offspring 2 11011 | 00100110110
  • 10.
    Mutation  Prevents fallingall solutions in population into a local optimum of solved problem (local extreme)  Changes randomly the new offspring  for binary encoding, switch random chosen bit from 0 to 1 / 1 to 0  Depends on encoding & crossover  Should not occur very often, else GA will change to Random Search Original offspring 1 1101111000011110 Original offspring 2 1101100100110110 Mutated offspring 1 1100111000011110 Mutated offspring 2 1101101100110110
  • 11.
    Parameters of GA Probabilityof Crossover & Mutation  Crossover Probability  crossover performation  no crossover – offspring is exact copy of parents  if crossover – offspring is made from parts of parents  100 % - all offsprings made by crossover  0 % - exact copies of old population  Mutation Probability  chromosome mutation  no mutation – offspring crossover without any change  if mutation - part of chromosome is changed  100 % - whole chromosome change  0 % - no change
  • 12.
    Recommendations  Crossover rate should be high ~ 80% - 95%.  for some problems ~ 60% is the best  Mutation rate  mutation rate should be very low.  best rates reported - 0.5% - 1%.  Population size  best population size depends on size of encoded string  very big population size usually does not improve performance of GA  good population size is about 20-30  sometimes sizes 50-100 are reported as best  32 bits chromosome – population 32  16 bits chromosome - two times more than the best population size  Selection  basic roulette wheel selection  rank selection can be better  simulated annealing – sophisticated methods  elitism should be used  try steady state selection.  Encoding  Encoding depends on the problem & size of instance of the problem.  Crossover and mutation type  Operators depend on encoding & problem.
  • 13.
    Applications of GA Nonlinear dynamical systems - predicting, data analysis  Designing neural networks, both architecture and weights  Robot trajectory  Evolving LISP programs (genetic programming)  Strategy planning  Finding shape of protein molecules  TSP and sequence scheduling  Functions for creating images
  • 14.
    Advantage & DisAdvantage Advantage  parallelism  travelling in a search space with more individuals so they are less likely to get stuck in a local extreme like some other methods  easy to implement  have some GA, just write new chromosome to solve another problem  same encoding - change the fitness function  DisAdvantage  computational time  slower than some other methods  choosing encoding and fitness function can be difficult  But with today’s computers it is not so big problem
  • 15.
    Reference  Rechenberg, Ingo(1973). Evolutionsstrategie. Stuttgart: Holzmann-Froboog. ISBN 3-7728-0373-3.  Srinivas. M and Patnaik. L, "Adaptive probabilities of crossover and mutation in genetic algorithms," IEEE Transactions on System, Man and Cybernetics, vol.24, no.4, pp.656–667, 1994.  http://www.obitko.com/tutorials/genetic-algorithms/ga-basic- description.php
  • 16.