Professional Documents
Culture Documents
02 GeneticAlgorithm
02 GeneticAlgorithm
3
Premise of Genetic Algorithm
1
“poz”
0
“gat”
9
gat gaz gat
cow gow cat
10
1st generation 2nd generation
11
Flow chart of an evolution algorithm
Selection
Population Parents
Reproduction
Replacement
Offspring
12
Flow chart of an evolution algorithm
Selection
Population Parents
Reproduction
Replacement
Many EAs are around: Offspring
Ant colony optimization,
Artificial immune system,
Cultural algorithms,
Genetic Algorithm,
Genetic Programming,
Grammatical evolution,
… 13
Flow chart of a genetic algorithm
Initialize
population
Solution No
Selection
found?
Yes
End
14
Flow chart of a genetic
We create algorithm
a
set of random 3-letter
Initialize words
population
Solution No
Selection
found?
Yes
End
15
Flow chart of a genetic algorithm
Initialize Compute the
population
score of each word
Solution No
Selection
found?
Yes
End
16
Flow chart of a genetic algorithm
Initialize
population
Solution No
Selection
found?
Yes
End
17
Flow chart of a genetic algorithm
Initialize
population
Solution No
Selection
found?
Yes
End
18
Flow chart of a genetic algorithm
We combine and
Initialize mutate words to form a new
population set of words
Solution No
Selection
found?
Yes
End
19
Genetic Algorithm in a Nutshell
20
Genetic Algorithm in a Nutshell
21
Terminology: Individual
23
Terminology: Fitness function
f( )=y y∈ℝ
24
Example: optimizing a server
27
Example: space antenna
f(x) = y
https://ti.arc.nasa.gov/m/pub-archive/1244h/1244%20(Hornby).pdf
28
Example: software testing
f(x) = y
29
Flow - chart of a genetic algorithm
Initialize
population
Solution No
Selection
found?
Yes
End
30
Selection phase
31
Roulette selection
i3
i1 (17%)
f(i1)=200 (35%)
f(i2)=150 i2
f(i3)=100 (26%)
f(i4)=120 i4
(21%)
Selection point
32
Roulette selection
33
Tournament
34
Flow - chart of a genetic algorithm
Initialize
population
Solution No
Selection
found?
Yes
End
35
Darwinian Natural Selection
https://en.wikipedia.org/wiki/Charles_Darwin#/media/File:Charles_Darwin_seated_crop.jpg
36
Genetic operators: Crossover
37
Genetic operators: Crossover
39
Genetic operators: Crossover
New individual
40
Genetic operators: Variant of
Crossover
41
Genetic operators: Mutation
42
Genetic operators: Mutation
43
Genetic operators: Mutation
44
Flow - chart of a genetic algorithm
Initialize
population
Solution No
Selection
found?
Yes
End
45
Fitness function
47
Minimization vs Maximization
Error function
N - objective
1 / (1 + objective)
48
Encoding / decoding
Genotype Phenotype
TAAGTG
(biology)
49
Encoding / decoding
Genotype Phenotype
2
1, 3, 2, 4, 5 1
5
3
50
Configuring the algorithm
51
Result of the algorithm
52
Some benefits of Genetic Algorithm
53
What have we seen?
54
Practical session
55