Genetic Algorithm
Genetic Algorithm
Genetic Algorithms
Logic
Initialization: Started with a number
of solutions (Population) instead of a
single solution
Fitness: Computation of function
values for each of them
Selection: Select better solutions
from the population (Parents)
Crossover, Mutation: Creating new
solutions from parent solutions
(Children)
Continue this process till some
termination criteria it met (say
maximum number of iterations)
F(x)
Local Basin
Global Basin
X
GA Example
Max sin( x )
String DV
01 001
10 100
00 001
11 010
String
01
10
10
11
001
100
100
010
9
20
1
26
f(x)
0.912
2.027
0.101
2.685
0.791
0.898
0.101
0.485
favg 0.569
String DV
x
01
10
10
11
000
101
010
100
8
21
18
28
01
10
10
11
001
100
100
010
f(x)
0.811
2.128
1.824
2.838
favg
01001
x
1
2
0
1
0 x
0.725
0.849
0.968
0.299
0.710
01001 24 0 23 1 22 0 21 0 20 1
Max sin(x )
0x
x max x min
DecodeValue
2L 1
3.14 0
x 0 5
9 0.912
2 1
x x min
Max sin(x )
0x
01001 24 0 23 1 22 0 21 0 20 1
x max x min
x x min
DV
2L 1
3.14 0
x 0 5
9 0.912
2 1
Requirements
Program should be modular (different
functions for initialization, fitness
evaluation, selection, crossover, mutation)
Plot evolution of population with time
Submission: Sep 20, 2016
Outputs (finalvariable.txt)
Values of variables (binary form & real
value) and objective functions of the last
generation
Outputs (allvariable.txt)
Values of variables (binary form & real
value) and objective functions of all
generations