Professional Documents
Culture Documents
3 GO Olesya Genetic Algorithms
3 GO Olesya Genetic Algorithms
Genetic Algorithms
Olesya Peshko
Outline
z
z
z
z
z
z
z
Evolution in biology
Algorithm
Pros and cons
Applications
Example
Software
Matlab toolboxes
Evolution in Biology
Evolution in Biology I
z
Evolution in Biology II
z
Inheritance
Mutation
Selection
Discontinuous
Highly nonlinear
Stochastic
Performance
Biological Terminology
z
10
0 1 1
1 1 0 1 1
1 1 0 0 1
0 1 0 0 0
1 1 1 1 1
1 0 0 1 1
0 1 0 1 0
1 1 0 1 0
11
12
Representations
Mutations
Crossovers
Selection mechanisms
Representation
z
Bit strings
Real numbers
Permutations of element
Lists of rules
Program elements
Any other data structure
Encoding
(representation)
Decoding
13
(inverse representation)
0 1 0 1 1
1 1 0 1 1
1 1 1 1 1
1 0 0 1 1
Representation Example
z
34.57 ~ 1000010101101
z
14
Generation N
23.99 ~ 1000001111110
1-Point Crossover
15
Children
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 1 1
Two-point crossover
Parents
Children
1 1 1 1 1 1 1 1 1 1
0 0 1 1 1 1 1 0 0 0
0 0 0 0 0 0 0 0 0 0
1 1 0 0 0 0 0 1 1 1
16
1 1 0 1 0 0 0 1 1 0
Parents
Children
1 1 1 1 1 1 1 1 1 1
0 0 1 0 1 1 1 0 0 1
0 0 0 0 0 0 0 0 0 0
1 1 0 1 0 0 0 1 1 0
Mutation
z
17
Parent
Child
1 1 1 1 1 1 1 1 1 1
1 1 0 1 1 1 1 0 1 0
Selection
z
2 1 4 5 7
2 1 4 5 7
2 1 3 3 4
2 1 3 3 5
27
1 2 3 3 4
1 2 3 3 4
1 2 4 5 7
1 2 4 5 7
32
6 2 1 3 1
1 2 3 3 4
1 2 3 3 1
1 7 3 3 1
11
1 1 2 1 9
6 2 1 3 1
6 2 1 3 4
6 2 1 1 4
Initial population
Selection
Crossover
Mutation
18
A
3/6=50%
C
2/6=33%
19
fitness(A) = 3
fitness(B) = 1
fitness(C) = 2
Initialize population;
% Evaluate the fitness of each chromosome in the population
Evaluate population;
[Fitness]
while Termination_Criteria_Not_Satisfied
{
% Select according to fitness
Select parents for reproduction;
[Selection]
Perform crossover;
[Crossover]
Perform mutation;
Accept new generation;
Evaluate population;
}
20
[Mutation]
[Fitness]
21
z
z
z
z
z
22
Choosing parameters:
Performance:
23
Population size
Crossover and mutation probabilities
Selection, deletion policies
Crossover, mutation operators, etc.
Termination criteria
Can be too slow but covers a large search space
Is only as good as the fitness function
Applications
24
25
A Simple Example
The traveling salesman problem
Find a tour of a given set of cities
so that:
26
Representation
z
27
Kyiv
Budapest
Teheran
Beijing
Jerusalem
Bucharest
Hamilton
Toronto
CityList1 (3 5 7 2 1 6 4 8)
CityList2 (2 5 7 6 8 1 3 4)
Crossover
Parent2
(3 5 7 2 1 6 4 8)
(2 5 7 6 8 1 3 4)
Child
(5 8 7 2 1 6 3 4)
Parent1
28
Mutation
Mutation involves reordering of the list:
29
Before:
*
*
(5 8 7 2 1 6 3 4)
After:
(5 8 6 2 1 7 3 4)
30
31
32
33
34
35
1.
2.
3.
4.
Software
36
z
z
z
z
z
z
z
z
z
37
38
Prices
z
z
z
39
Commercial
Academic
Student use
Demo 1
z
40
Demo 2: Function
z
Rastrigins function :
41
Demo 2: gatool
42
GEATbx: Features
z
z
z
z
z
z
z
z
z
z
43
Demo
z
44
demogeatbx.m
Prices
45
46
Demo
z
47
gademo1.m
GA Software References
48
1.
2.
3.
4.