KEMBAR78
Introduction to Genetic algorithm | PPTX
Submitted by:
Heena Gupta
2013Ems02
Mtech(1st sem)
• A class of probabilistic optimization algorithms
• Inspired by the biological evolution process
• Uses concepts of “Natural Selection” and “Genetic Inheritance”
(Darwin 1859)
• Originally developed by Prof. John Holland (1975)
• Particularly well suited for hard problems where little is known
about the underlying search space
• Widely used in searching techniques involving “search for
solutions”
Selection This operator selects chromosomes in the population for
reproduction. The fitter the chromosome,
the more times it is likely to be selected to reproduce.
Crossover This operator randomly chooses a locus and exchanges the
subsequences before and after that locus
The crossover operator roughly mimics biological recombination between two
single−chromosome (haploid) organisms.
Mutation This operator randomly flips some of the bits in a
chromosome.
A genetic algorithm maintains a population of candidate solutions for
the problem at hand ,and makes it evolve by iteratively applying a set
of stochastic operators
1.Start with a randomly generated population of n l−bit chromosomes
2.Calculate the fitness ƒ(x) of each chromosome x in the population.
3.Repeat the following steps until n offspring have been created:
a. Select a pair of parent chromosomes from the current population,
the
probability of selection being an increasing function of fitness
b. With probability pc (the "crossover probability" or "crossover rate"),
cross
over the pair at a randomly chosen point (chosen with uniform
probability)
to form two offspring.
c. Mutate the two offspring at each locus with probability pm and place
the
resulting chromosomes in the new population.
4.Replace the current population with the new population.
5.Go to step 2.
Each iteration of this process is called a generation
The entire set of generations is called a run.
Before a genetic algorithm can be put to work on any problem, a method
is needed to encode potential solutions to that problem in a form so that a
computer can process.
Common approaches are:
Binary Encoding : every chromosome is a string of 0 or 1
Permutation Encoding : every chromosome is a string of
numbers that represent position in a sequence
Tree Encoding : a tree structure represents the chromosome
Value Encoding : every chromosome is a sequence of some
values (real numbers, characters or objects)
Concept : From the population, the chromosomes are selected to be
parents to crossover and produce offspring.
Concept : the chance of an individual's being
selected is proportional to its fitness, greater
or less than its competitors‘s fitness.
Implementation :
Probability of selection of i th individual is:
Where
fi :fitness of ith individual,
N : number of individuals
Concept : Selects genes from parent chromosomes, combines them and
creates a new offspring.
Idea : New chromosome may be better than both of the parents if it takes
the best characteristics from each of them
Consider the two parents selected for crossover.
Interchange the parents chromosomes after crossover points.
The offsprings produced are :
Concept : Mutation alters one or more gene values in a chromosome
from its initial state.
The mutation operator simply inverts the value of the chosen
gene i.e. 0 goes to 1 and 1 goes to 0.
Consider the two original off springs selected for mutation.
The Mutated Off-spring produced are :
suppose that l (string length) is 8, that ƒ(x) is equal to the number
of ones in bit string x, n(the population size)is 4, that pc = 0.7, and that pm
= 0.001
The initial (randomly generated) population might look like this:
Step1: Select the parent by using Roulette wheel .Here n=4 so the wheel
is rotated 4 times let parent B,C be selected in first two spins and B,D be
selected in the next two
Step2: Once a pair of parents is selected, with probability pc they cross
over to form two offspring. If they do not cross over, then the offspring are
exact copies of each parent.
Suppose, in the example above, that parents B and D cross over after the first
bit position to form offspring
E = 10110100 and
F = 01101110,
parents B and C do not cross over, instead forming offspring that are exact
copies of B and C.
Step3: Next, each offspring is subject to mutation at each locus with
probability pm. For example,
suppose offspring E is mutated at the sixth locus to form
E' = 10110000,
offspring F and C are not mutated at all,
and offspring B is mutated at the first
locus to form B' = 01101110.
The new population will be the following:
In the new population, although the best string was lost, the average fitness
rose from 12/4 to 14/4. Iterating this procedure will eventually result in a string
with all ones.
Solution Space is explored in multiple directions
Nonlinear problems -Large Solution space, but GA are ideal.
Works on complex landscape (discontinuous, noisy, changing with
time)
Dilemma of global optimum vs many local optima. GA strike perfect
balance
GA can manipulate many parameters simultaneously .
GA don't have specific knowledge of problem. All possible search
pathways
are considered in GA.
Computationally expensive and time consuming
Issues in representation of problem
Proper writing of fitness function
Proper values of size of population, crossover and mutation rate
Premature Convergence

Introduction to Genetic algorithm

  • 1.
  • 2.
    • A classof probabilistic optimization algorithms • Inspired by the biological evolution process • Uses concepts of “Natural Selection” and “Genetic Inheritance” (Darwin 1859) • Originally developed by Prof. John Holland (1975) • Particularly well suited for hard problems where little is known about the underlying search space • Widely used in searching techniques involving “search for solutions”
  • 3.
    Selection This operatorselects chromosomes in the population for reproduction. The fitter the chromosome, the more times it is likely to be selected to reproduce. Crossover This operator randomly chooses a locus and exchanges the subsequences before and after that locus The crossover operator roughly mimics biological recombination between two single−chromosome (haploid) organisms. Mutation This operator randomly flips some of the bits in a chromosome. A genetic algorithm maintains a population of candidate solutions for the problem at hand ,and makes it evolve by iteratively applying a set of stochastic operators
  • 4.
    1.Start with arandomly generated population of n l−bit chromosomes 2.Calculate the fitness ƒ(x) of each chromosome x in the population. 3.Repeat the following steps until n offspring have been created: a. Select a pair of parent chromosomes from the current population, the probability of selection being an increasing function of fitness b. With probability pc (the "crossover probability" or "crossover rate"), cross over the pair at a randomly chosen point (chosen with uniform probability) to form two offspring. c. Mutate the two offspring at each locus with probability pm and place the resulting chromosomes in the new population. 4.Replace the current population with the new population. 5.Go to step 2. Each iteration of this process is called a generation The entire set of generations is called a run.
  • 5.
    Before a geneticalgorithm can be put to work on any problem, a method is needed to encode potential solutions to that problem in a form so that a computer can process. Common approaches are: Binary Encoding : every chromosome is a string of 0 or 1 Permutation Encoding : every chromosome is a string of numbers that represent position in a sequence Tree Encoding : a tree structure represents the chromosome Value Encoding : every chromosome is a sequence of some values (real numbers, characters or objects)
  • 6.
    Concept : Fromthe population, the chromosomes are selected to be parents to crossover and produce offspring. Concept : the chance of an individual's being selected is proportional to its fitness, greater or less than its competitors‘s fitness. Implementation : Probability of selection of i th individual is: Where fi :fitness of ith individual, N : number of individuals
  • 7.
    Concept : Selectsgenes from parent chromosomes, combines them and creates a new offspring. Idea : New chromosome may be better than both of the parents if it takes the best characteristics from each of them Consider the two parents selected for crossover. Interchange the parents chromosomes after crossover points. The offsprings produced are :
  • 8.
    Concept : Mutationalters one or more gene values in a chromosome from its initial state. The mutation operator simply inverts the value of the chosen gene i.e. 0 goes to 1 and 1 goes to 0. Consider the two original off springs selected for mutation. The Mutated Off-spring produced are :
  • 9.
    suppose that l(string length) is 8, that ƒ(x) is equal to the number of ones in bit string x, n(the population size)is 4, that pc = 0.7, and that pm = 0.001 The initial (randomly generated) population might look like this: Step1: Select the parent by using Roulette wheel .Here n=4 so the wheel is rotated 4 times let parent B,C be selected in first two spins and B,D be selected in the next two Step2: Once a pair of parents is selected, with probability pc they cross over to form two offspring. If they do not cross over, then the offspring are exact copies of each parent.
  • 10.
    Suppose, in theexample above, that parents B and D cross over after the first bit position to form offspring E = 10110100 and F = 01101110, parents B and C do not cross over, instead forming offspring that are exact copies of B and C. Step3: Next, each offspring is subject to mutation at each locus with probability pm. For example, suppose offspring E is mutated at the sixth locus to form E' = 10110000, offspring F and C are not mutated at all, and offspring B is mutated at the first locus to form B' = 01101110. The new population will be the following: In the new population, although the best string was lost, the average fitness rose from 12/4 to 14/4. Iterating this procedure will eventually result in a string with all ones.
  • 11.
    Solution Space isexplored in multiple directions Nonlinear problems -Large Solution space, but GA are ideal. Works on complex landscape (discontinuous, noisy, changing with time) Dilemma of global optimum vs many local optima. GA strike perfect balance GA can manipulate many parameters simultaneously . GA don't have specific knowledge of problem. All possible search pathways are considered in GA.
  • 12.
    Computationally expensive andtime consuming Issues in representation of problem Proper writing of fitness function Proper values of size of population, crossover and mutation rate Premature Convergence