Introduction To Genetic Algorithms
Introduction To Genetic Algorithms
Global optima
Local optima
Local optima
Local optima
Local optima
X 7 November 2013
Introduction to optimization
4
“Select The
Best, Discard
The Rest”
An Example….
7
□ Favorable characteristic
propagated through generations
of giraffes.
Initial Population of
animals
Evolved Species
10
Start
Initialize
population
Evaluate Solutions
T= 0 NO
Optimum
Solution?
Selection
YES
T=T+1 Stop Crossover
Mutation
7 November 2013
Simple Genetic Algorithm
12
function sga ()
{
Initialize population;
Calculate fitness function;
Fitness
Next
Selection
Generation
Mutation Crossover
Let us consider an example in which we need
to find the optimum solution of F(X1,X2) .
Fitness
Next
Selection
Generation
Mutation Crossover
Initial Population
X1 X2
1001 1101
10011101
1 Complete Population
Initial Generation
1 1 0 1 1 0 1 0
0 1 1 1 1 0 1 1
1 1 1 0 1 0 1 0
0 0 0 1 1 0 1 0
0 0 1 1 0 0 0 1
1 1 0 1 1 0 0 0
1 0 1 0 1 0 1 1
1 1 1 0 0 0 1 0
1 0 1 0 0 0 1 0
0 1 1 1 1 0 1 1
Initial
Generation
Fitness
Next
Selection
Generation
Mutation Crossover
Fitness Function
□ Selection
□ Crossover
□ Mutation
Selection
14
Considering c = 0.0654
23 h
d
Selection operator
18
□ They are:
□ Tournament selection
□ Roulette wheel selection
□ Proportionate selection
□ Rank selection
□ Steady state selection, etc
Tournament selection
19
22 32 Selected
22 25
22 25
13 +30 25
32 22
32 40
32 22
25 13 +30
40 22
Best solution will have two copies
Worse solution will have no copies
7 +45 7 +45
Other solutions will have two, one
25 13 +30 or zero copies
25 13 +30
Roulette wheel and proportionate
21
selection
Chrom # Fitnes % of RW EC AC
s
Parents are selected 1 50 26.88172 1.612903 2
according to their 2 6 3.225806 0.193548 0
3 36 19.35484 1.16129 1
fitness values
4 30 16.12903 0.967742 1
5 36 19.35484 1.16129 1
The better 6 28 15.05376 0.903226 1
chromosomes have 186 100.00 6 6
more chances to be 6Roulet wheel
16% 1
21%
selected
2
3%
5
21%
3
21%
4 7N
18%
Selection
Before Selection After Selection
1 1 0 1 1 0 1 0 1 1 1 0 1 0 1 0
0 1 1 1 1 0 1 1 0 0 1 1 0 0 0 1
1 1 1 0 1 0 1 0 0 0 1 1 0 0 0 1
0 0 0 1 1 0 1 0 0 0 1 1 0 0 0 1
0 0 1 1 0 0 0 1 0 0 1 1 0 0 0 1
1 1 0 1 1 0 0 0 1 1 0 1 1 0 0 0
1 0 1 0 1 0 1 1 0 0 1 1 0 0 0 1
1 1 1 0 0 0 1 0 0 0 1 1 0 0 0 1
1 0 1 0 0 0 1 0 1 1 0 1 1 0 0 0
0 1 1 1 1 0 1 1 1 1 1 0 1 0 1 0
Methods of Reproduction
Crossover
Mutation
How to implement crossover
24
The crossover operator is used to create new solutions from the existing solutions
available in the mating pool after applying selection operator.
This operator exchanges the gene information between the solutions in the
mating pool.
0 1 0 0 1 1 0 1 1 0
Solution 1
Solution 2
Child 1
Child 2
Binary Crossover
29
Source: Deb1999
Mutation operator
30
Source: Deb1999
Elitism
32
Nature Computer
Population Set of solutions
Individual Solution to a problem
Fitness Quality of a solution
Chromosome Encoding for a solution
Gene Part of the encoding solution