4. Problem solving
Fitness function
Non – linear, non – differentiable, black – box optimization
-Error rate measurement
-Restrictions
-Minimal
-Measurement of ‘bad’ solutions matters
5. Basic Genetic Algorithm
1. Generate population
2. Select the best from the population
3. Crossover genes
4. Mutate!
5. Repeat from(2) until criteria met
Links: [4]
6. Color Red Green Blue
250 164 197
241 247 167
58 188 129
53 45 219
182 174 240
44 102 106
62 12 244
215 26 11
8 random colors Target
7. Color Red Green Blue
250 164 197
241 247 167
58 188 129
53 45 219
182 174 240
44 102 106
62 12 244
215 26 11
Select 2 closest to ‘Blue’ color
8. Color Red Green Blue
53 12 244
53 12 219
53 45 244
53 45 219
62 45 219
62 45 244
62 12 244
62 12 219
Mix and receive new population
9. Color Red Green Blue
53 12 244
53 12 219
53 65 244
53 45 219
140 45 219
62 45 244
62 12 244
62 12 219
Mutations!
12. GA disadvantages
• No guarantee of finding global maxima
• Time taken for convergence
• Parameters like mutation rate, elitism percentage, crossover
parametersm fitness norm is often trial/error
• Incomprehensible solutions
• unguided mutation (but, Differential evolution algorithm perform
guided search)
13. Differential evolution Differential evolution
Random generate population X
(N vectors)
Get random V1, V2, V3
Create donor: Vi,= V1 F*(V2 - V3 )
F = [0,2]
Create mutant: Xm,= Vi X Xi with
probability CR
for each Xi:
Take the best to the next
generation: Xi vs Xm
14. Libraries and frameworks
Python
•Pyvolution: Very modular and very extensible
evolutionary algorithms framework, with complete
documentation, Apache License 2.0
•deap: Distributed Evolutionary Algorithms in Python,
GNU Lesser GPL
•pySTEP: Python Strongly Typed gEnetic Programming,
MIT License
•Pyevolve
•PyRobot: Evolutionary Algorithms (GA + GP) Modules,
Open Source
•PonyGEa small, one source file implementation of GE,
with an interactive graphics demo application