You are on page 1of 45

GENETIC ALGORITHM

Courtesy: Slides from Debasis Samanta


Indian Institute of Technology Kharagpur
Rank-
Rank-based selection
Rank-
Rank-based selection: Example
Rank-
Rank-based selection: Implementation
Comparing Rank-
Rank-based selection with
Roulette-
Roulette-Wheel selection
Tournament selection
• In tournament selection several tournaments are played
among a few individuals. The individuals are chosen at
random from the population.
• The winner of each tournament is selected for next
generation.
• Selection pressure can be adjusted by changing the
tournament size.
• Weak individuals have a smaller chance to be selected if
tournament size is large.
Example
• In this scheme, we select the tournament size n (say 2 or 3) at
random.
• We pick n individuals from the population, at random and determine
the best one in terms of their fitness values.
• The best individual is copied into the mating pool.
• Thus, in this scheme only one individual is selected per tournament
and Np tournaments are to be played to make the size of mating pool
equals to Np.
• Note :
• Here, there is a chance for a good individual to be copied into the
mating pool more than once.
• This techniques founds to be computationally more faster than both
Roulette-Wheel and Rank-based selection scheme
Tournament selection : Implementation
Tournament selection : Example
Survey on GA selection strategies
Elitisms
• Crossover and mutation may destroy the best solution of the
population pool
• Elitism is the preservation of few best solutions of the population
pool
• Elitism is defined in percentage or in number
Elitisms
Comparing selection schemes
• Usually, a selection scheme follows Darwin’s principle of ”Survival
• of the fittest”.
• In other words, a selection strategy in GA is a process that favours the
selection of better individuals in the population for the matting pool
(so that better genes are inherited to the new offspring) and hence
search leads to the global optima.
There are two issues to decide the effectiveness of any selection
scheme.
• Population diversity
• Selection pressure
Effectiveness of any selection scheme
Effectiveness of any selection schemes
Analysis of different selection strategies
Important GA Operations
• 1 Encoding
• 2 Fitness Evaluation and Selection
• 3 Mating pool
• 4 Crossover
• 5 Mutation
• 6 Convergence test
Mating Pool: Prior to crossover operation
Important GA Operations
• 1 Encoding
• 2 Fitness Evaluation and Selection
• 3 Mating pool
• 4 Crossover
• 5 Mutation
• 6 Convergence test
Crossover operation
Crossover operations in Binary-
Binary-coded GAs
• There exists a large number of crossover schemes, few important of
them are listed in the following.
• 1 Single point crossover
• 2 Two-point crossover
• 3 Multi-point crossover (also called n-point crossover)
• 4 Uniform crossover (UX)
Single point crossover

• Here, we select the K-point lying between 1 and L. Let it be k.


• A single crossover point at k on both parent’s strings is selected.
• All data beyond that point in either string is swapped between the
two parents.
• The resulting strings are the chromosomes of the offsprings
produced.
Single point crossover: Illustration
Two-
Two-point crossover
• In this scheme, we select two different crossover points k1 and k2
lying between 1 and L at random such that k1 ≠ k2.
• The middle parts are swapped between the two strings.
• Alternatively, left and right parts also can be swapped
Two-
Two-point crossover: Illustration
Multi-
Multi-point crossover
Uniform Crossover (UX)
Uniform crossover (UX): Illustration
Uniform crossover with crossover mask
Uniform crossover with crossover mask
Important GA Operations
• 1 Encoding
• 2 Fitness Evaluation and Selection
• 3 Mating pool
• 4 Crossover
• 5 Mutation
• 6 Convergence test
Mutation Operation
Mutation Operation in Binary coded GA
Mutation in Binary-
Binary-coded GA : Flipping
Mutation in Binary-
Binary-coded GA : Interchanging
Mutation in Binary-
Binary-coded GA : Reversing
Crossover OR mutation?
• Decade long debate: which one is better / necessary / main-background

• Answer (at least, rather wide agreement):


• it depends on the problem, but
• in general, it is good to have both
• both have another role
• mutation-only-EA is possible, xover-only-EA would not work
Exploration: Discovering promising areas in the search space, i.e.
gaining information on the problem
Exploitation: Optimising within a promising area, i.e. using information
There is co-operation AND competition between them
• Crossover is explorative, it makes a big jump to an area somewhere
“in between” two (parent) areas
• Mutation is exploitative, it creates random small diversions, thereby
staying near (in the area of ) the parent
• Only crossover can combine information from two parents
• Only mutation can introduce new information (alleles)
• Crossover does not change the allele frequencies of the population
• To hit the optimum you often need a ‘lucky’ mutation
Nature to Computer Mapping
Maximize f(x) = x2 example: selection
X2 example: crossover
X2 example: mutation
• REFERENCES
1. D. E. Goldberg, ‘Genetic Algorithm In Search,Optimization And
Machine Learning’, New York:Addison –Wesley (1989)
2.John H. Holland ‘Genetic Algorithms’, Scientific American Journal,
July 1992.
3. Kalyanmoy Deb, ‘An Introduction To Genetic Algorithms’, Sadhana,
Vol. 24 Parts 4 And 5
Courtesy: Slides from Debasis Samanta
Indian Institute of Technology Kharagpur

You might also like