Title: Evolutionary Computation L3
1MAT9JA Metaheuristics 2Evolutionary Strategies
andGenetic Algorithms
Dr Jerry Swan
2Population-Based Metaheuristics
- In the previous lecture we looked at local
search, e.g. hill climbing, simulated annealing,
tabu search. - These techniques have a single current solution.
- In this lecture, we take a look at
population-based approaches. - These include
- Evolutionary Strategies
- Genetic Algorithms
- Genetic Programming
3Population-Based Approaches
- Rather than maintain a single candidate solution
we maintain a population of them. The idea is
that population members interact to promote good
solutions. - Population-based approaches are loosely inspired
by Darwinian evolution, which can be (roughly)
characterized as survival of the fittest - An abstraction of real-world evolution
- real-world entities do not evolve in
isolation there are many competing/collaborating
species (co-evolution).
4Inspiration not Devotion
- Claim that the emphasis should be on loosely
inspired. - We may legitimately wish to be inspired by nature
but we are not constrained by it - Thats not how the biology works.
- So what - it works! (But why does it work????)
- But general benefits are to be had (and little is
lost) by a more detailed investigation of natural
mechanisms.
5Inspired' Optimization
- There is debate on the similarity between the
abstractions of bio-inspired optimization and
the actual biological mechanisms that gave rise
to them. - Biology is a rich domain and our abstractions
necessarily simplify (e.g. some ants use (at
least) seven different types of pheromones...). - How much useful machinery do we lose by using
such simple models? We start by looking at
Evolutionary Strategies (very simple) and move on
to Genetic Algorithms (more complex).
6Evolutionary Strategies
7Evolutionary Strategies
- Developed in 60s and 70s in Germany by Bienert,
Rechenberg, and Schwefel. - Uses the evolutionary concept of randomized
mutation. - Originated with numerical optimisation problems.
- Traditionally works with real-valued vectors
- but can work with any solution
representation for which we can define
mutation.
8Gaussian Mutation
- For real-vectors, the mutation degree is
typically drawn from a Normal (a.k.a. Gaussian)
distribution - Initially, N(0,1) is used
9Real-valued Solution Representation
x1
xn
?1
?n
Vector of real-valued fields
Real-valued evolutionary parameters
x1
xn
?1
x1
xn
?1
?n
10Mutating Solutions
- Each field is mutated according to a Gaussian
distribution (mean 0) with standard deviation ?.
t
x1
xn
N(0,??1)
N(0,??n)
t1
x1
xn
11Basic ES
- Has a single parent which gives rise to a single
child by mutation. - The child is compared with parent and the best
survives. - This essentially hill-climbing.
- except that the mutation rate is part of the
chromosome and the standard deviation of the
mutation rate is updated too...
12Schwefel's 1/5 Success Rule
- Determine percentage ps of successful mutations
in past k iterations. - Update each ? after every k iterations by
- ? ? / c if ps gt 1/5
- ? ? c if ps lt 1/5
- ? ? if ps 1/5where 0.8 ? c ? 1
13ES for Function Approximation
- Given a set of data-points in the plane, fit a
polynomial (or rational function) to these
points, minimizing the error
Data
14Polynomial Approximation with ES
- Rational polynomial of degree six fitted to a
noisy dataset
http//www.bionik.tu-berlin.de/user/giani/esdemos/
evo.html
15But mutation is not the whole story...
- More complex creatures create offspring by
recombining their genetic material using
crossover
- More complex creatures create offspring by
recombining their genetic material using
crossover
- More complex creatures create offspring by
recombining their genetic material using
crossover
- This is the essential additional feature of
genetic algorithms...
16Genetic Algorithms
17Genetic Algorithms
- Developed by John Holland in the 60s and gaining
wider publicity in the 70s and 80s. - Further developed by one of Hollands student
David Goldberg. - An extremely popular technique (10,000s of
genetic algorithm papers). - Applied to a huge number of application domains.
18Genetic Algorithms Pipeline
population of solutions
fitness evaluation
population of solutions
mutate individuals
19GA Example - Simple Optimization Problem
- Maximise f(x)x over the interval 0,15
- We will choose f(x) x as the fitness value for
candidate solution x. - Note this is a choice.
- No reason in principle why this should be used in
preference to, say, x2. - In general, the fitness function and the
objective function need not be the same.
20Representation
- We will represent candidate solutions x as
strings (chromosomes) of four bits. This is the
genotype it is the genotype that is subject to
genetic operations. - We interpret a bit string as the non-negative
decimal integer for which it naturally encodes.
This is the phenotype.
Chromosome with bi in 0,1
Interpretation
23b3 22b2 21b1 20b0
0000gt0, 0001gt1, , 111014, 111115
21Initial Population
- For this very simple example we will use a
population size M4. These are generated
randomly..
0
1
0
0
4
a0
0
0
1
1
3
b0
0
0
1
1
3
c0
0
0
1
0
2
d0
12
Total pop fitness
22Selection
- Select probabilistically according to fitness
23Crossover
- Pick chromosome pairs and loci randomly
0
0
1
1
3
a1
0
1
0
0
4
b1
0
1
0
0
4
c1
0
0
1
1
3
d1
14
Total pop fitness
24Crossover
- We swap the right halves of selected pairs
0
0
0
a2
0
1
7
b2
0
1
0
1
5
c2
0
0
0
1
2
d2
14
Total pop fitness
25Mutation
- With small probability mutate (here flip the bit)
each gene value. Here we get very lucky..
0
0
0
0
0
a
0
1
1
1
7
b
0
1
0
1
5
c
1
0
1
0
10
d
22
Total pop fitness
26 and repeat
- Can easily see why repeating this general process
will give rise eventually to a solution 1111gt15 - The process is repeated until a satisfactory
outcome is achieved, or else we run out of time.
27Representation Issues
- Representation is an important modeling step.
- Here the representation and interpretation are
very natural. - What if we wanted to maximize over the interval
0,12? - We could interpret each bit string as an integer
mod 13. - This introduces a bias since the number of
chromosomes that encode for each integer in this
range varies - 0 is encoded by 0000 and 1101
- 1 is encoded by 0001 and 1110
- 2 is encoded by 0010 and 1111
- The rest are encoded by the single binary
representation.
28Roulette wheel Proportional Selection
- Chromosomes are selected with probability
proportional to their fitness. Often referred to
as roulette wheel selection. - Some problems with this approach
29Issues with Proportional Selection
- If the objective function takes negative values
you need to be careful! - Scaling is an option
- If one solution is much better than the rest,
this cause the population to stagnate and the GA
to get trapped in a local minimum. - Some popular alternative selection schemes are
30Rank Selection
- Form a list of population members, ranked
according to fitness. - Now select probabilistically with
probability - The sum of the ranks k is 12M M(M1)/2
- There are many variations on this theme
31Tournament Selection
- Generate a permutation of the population members
essentially gives a list. - Look at successive blocks of k members and select
the fittest this is the tournament winner. - Repeat using further permutations until M parents
have been selected.
32Single-Point Crossover
Pick crossing point randomly
33Two-Point Crossover
Pick crossing points randomly
34Uniform Crossover
Generatemask
35Some Other Issues with GAs...
- Choice of parameters
- Population size (DeJong)
- Initialization method...
- Crossover rate
- Mutation rate
- Selection operator
- Choice of fitness functions the choice matters
a lot. - The new few slides discuss some other issues...
36Crossover issue disruption
- Crossover can be highly disruptive
high-performing schema may not be preserved under
crossover. - If solutions need to obey constraints, these may
not be preserved under crossover. - Some options
- Arrange representation and operators so that a
solutions are always valid. - Carry out a repair operation on chromosomes to
restore validity.
37Feasibility...
Sometimes its beneficial to allow unfeasible
solutions...
38Genotypes and Semantic Equivalence
- Radically different genotypes may actually map to
the same phenotype. - This may mean that recombining high-performing
solutions result in radically-poorer children
(despite in some sense being the same solution).
39Question...
- For a great many different types of problem,
genetic algorithms work rather well - Why do you think this is so?
40Acknowledgements
- Thanks to John Clark for
- making his original slides available.
41References
- Sean Luke, Essentials of Metaheuristics
- Freely downloadable from http//cs.gmu.edu/sean/
book/metaheuristics/Essentials.pdf