Content uploaded by A. E. Eiben
Author content
All content in this area was uploaded by A. E. Eiben
Content may be subject to copyright.
Introduction to
Evolutionary Computing II
A.E. Eiben
Free University Amsterdam
http://www.cs.vu.nl/~gusz/
with thanks to the EvoNet Training Committee and its “Flying Circus”
A.E. Eiben, Introduction to EC II 2EvoNet Summer School 2002
Contents
The evolutionary mechanism and its
components
Examples: the 8-queens problem
Working of an evolutionary algorithm
EC dialects and beyond
Advantages & disadvantages of EC
Summary
A.E. Eiben, Introduction to EC II 3EvoNet Summer School 2002
The main evolutionary cycle
Population
Parents
Parent selection
Survivor selection Offspring
Recombination
(crossover)
Mutation
Intialization
Termination
A.E. Eiben, Introduction to EC II 4EvoNet Summer School 2002
The two pillars of evolution
Increasing population
diversity by genetic
operators
mutation
recombination
Push towards novelty
Decreasing population
diversity by selection
of parents
of survivors
Push towards quality
There are two competing forces active
A.E. Eiben, Introduction to EC II 5EvoNet Summer School 2002
Components:
representation / individuals (1)
Individuals have two levels of existence
•phenotype: object in original problem context, the outside
•genotype: code to denote that object, the inside
(a.k.a. chromosome, “digital DNA”):
a d c a a c b
genotype:
phenotype:
The link between these levels is called representation
A.E. Eiben, Introduction to EC II 6EvoNet Summer School 2002
Genotype spacePhenotype space
Encoding
(representation)
Decoding
(inverse representation)
B 0 c 0 1 c d
G 0 c 0 1 c d
R 0 c 0 1 c d
Components:
representation / individiuals (2)
A.E. Eiben, Introduction to EC II 7EvoNet Summer School 2002
Sometimes producing
the phenotype from the
genotype is a simple
and obvious process.
Other times the
genotype might be a set
of parameters to some
algorithm, which works
on the problem data to
produce the phenotype
Problem
Data
Genotype
Phenotype
Growth
Function
Components:
representation / individuals (3)
A.E. Eiben, Introduction to EC II 8EvoNet Summer School 2002
Components:
representation / individuals (4)
•Search takes place in the genotype space
•Evaluation takes place in the phenotype space
•Repr: Phenotypes
Genotypes
•Fitness(g) = Value(repr-1(g))
•Repr must be invertible, in other words decoding must be
injective (Q: surjective?)
•Role of representation: defines objects that can be
manipulated by (genetic) operators
•Note back on Darwinism: no mutations on phenotypic
level! (right term: small random variations)
A.E. Eiben, Introduction to EC II 9EvoNet Summer School 2002
Components: evaluation, fitness
measure
Role:
•represents the task to solve, the requirements to adapt to
•enables selection (provides basis for comparison)
Some phenotypic traits are advantageous, desirable,
e.g. big ears cool better,
These traits are rewarded by more offspring that will
expectedly carry the same trait
A.E. Eiben, Introduction to EC II 10 EvoNet Summer School 2002
Components: population
Role: holds the candidate solutions of the problem as
individuals (genotypes)
Formally, a population is a multiset of individuals,
i.e. repetitions are possible
Population is the basic unit of evolution,
i.e., the population is evolving, not the individuals
Selection operators act on population level
Variation operators act on individual level
A.E. Eiben, Introduction to EC II 11 EvoNet Summer School 2002
Components: selection
Role:
Gives better individuals a higher chance of
becoming parents
surviving
Pushes population towards higher fitness
E.g. roulette wheel selection
fitness(A) = 3
fitness(B) = 1
fitness(C) = 2
AC
1/6 = 17%
3/6 = 50%
B
2/6 = 33%
A.E. Eiben, Introduction to EC II 12 EvoNet Summer School 2002
Components: Mutation
Role: causes small (random) variance
before
1 1 1 0 1 1 1
after
1 1 1 1 1 1 1
A.E. Eiben, Introduction to EC II 13 EvoNet Summer School 2002
Components: Recombination
1 1 1 1 1 1 1 0 0 0 0 0 0 0 parents
cut cut
1 1 1 0 0 0 0 0 0 0 1 1 1 1 offspring
Role: combines features from different sources
A.E. Eiben, Introduction to EC II 14 EvoNet Summer School 2002
Place 8 queens on an 8x8 chessboard in
such a way that they cannot check each other
Example: the 8 queens problem
A.E. Eiben, Introduction to EC II 15 EvoNet Summer School 2002
The 8 queens problem
Representation
1 23 45 6 7 8
Genotype:
a permutation of
the numbers 1 - 8
Phenotype:
a board configuration
Obvious mapping
A.E. Eiben, Introduction to EC II 16 EvoNet Summer School 2002
Penalty of one queen:
the number of queens she can check.
Penalty of a configuration:
the sum of the penalties of all queens.
Note: penalty is to be minimized
Fitness of a configuration:
inverse penalty to be maximized
The 8 queens problem
Fitness evaluation
A.E. Eiben, Introduction to EC II 17 EvoNet Summer School 2002
The 8 queens problem
Mutation
Small variation in one permutation, e.g.:
•swapping values of two randomly chosen positions, or
•inverting a randomly chosen segment
1 23 45 6 7 8 1 23 4 567 8
A.E. Eiben, Introduction to EC II 18 EvoNet Summer School 2002
The 8 queens problem
Recombination
Combining two permutations into two new permutations:
•choose random crossover point
•copy first parts into children
•create second part by inserting values from other
parent:
•in the order they appear there
•beginning after crossover point
•skipping values already in child
8 7 6 42 53
1
1 3 5 24 67
8
8 7 6 45 1
2
3
1 3 5 62 87
4
A.E. Eiben, Introduction to EC II 19 EvoNet Summer School 2002
Parent selection:
Roulette wheel selection, for instance
Survivor selection (replacement)
When inserting a new child into the population, choose
an existing member to replace by:
sorting the whole population by decreasing fitness
enumerating this list from high to low
replacing the first with a fitness lower than the given child
Note: selection works on fitness values, no need to adjust it
to representation
The 8 queens problem
Selection
A.E. Eiben, Introduction to EC II 20 EvoNet Summer School 2002
Working of an EA
Phases in optimizing on a 1-dimensional fitness landscape
Early phase:
quasi-random population distribution
Mid-phase:
population arranged around/on hills
Late phase:
population concentrated on high hills
A.E. Eiben, Introduction to EC II 21 EvoNet Summer School 2002
Typical run
Typical run of an EA shows so-called “anytime behavior”
Best fitness in population
Time (number of generations)
A.E. Eiben, Introduction to EC II 22 EvoNet Summer School 2002
Best fitness in population
Time (number of generations)
Progress in 1st half
Progress in 2nd half
Long runs?
A.E. Eiben, Introduction to EC II 23 EvoNet Summer School 2002
Time (number of generations)
Best fitness in population
T: time needed to reach level F after random initialisation
T
F: fitness after smart initialisation
F
Smart initialisation?
A.E. Eiben, Introduction to EC II 24 EvoNet Summer School 2002
Scale of “all” problems
Performance of methods on problems
Random search
Special, problem tailored method
Evolutionary algorithm
Goldberg’89 view
A.E. Eiben, Introduction to EC II 25 EvoNet Summer School 2002
EAs and domain knowledge
Trend in the 90ies: adding problem specific knowledge
to EAs (special variation operators, repair, etc)
Result: EA performance curve “deformation”:
better on problems of the given type
worse on problems different from given type
Amount of added knowledge is variable
A.E. Eiben, Introduction to EC II 26 EvoNet Summer School 2002
Performance of methods on problems
EA 1
EA 4
EA 3
EA 2
Scale of “all” problems
P
Michalewicz’96 view
A.E. Eiben, Introduction to EC II 27 EvoNet Summer School 2002
General EA framework and dialects
There is a general, formal EA framework (omitted here)
In theory:
every EA is an instantiation of this framework, thus:
specifying a particular EA or a type of EAs (a “dialect”)
needs only filling in the characteristic features
In practice
this would be too formalistic
there are many exceptions (EAs not fitting into this
framework)
why care about the taxonomy, or label?
A.E. Eiben, Introduction to EC II 28 EvoNet Summer School 2002
Genetic algorithms &
genetic programming
Genetic algorithms (USA, 70’s, Holland, DeJong):
Typically applied to: discrete optimization
Attributed features:
not too fast
good solver for combinatorial problems
Special: many variants, e.g., reproduction models, operators
Genetic programming (USA, 90’s, Koza)
Typically applied to: machine learning tasks
Attributed features:
competes with neural nets and alike
slow
needs huge populations (thousands)
Special: non-linear chromosomes: trees, graphs
A.E. Eiben, Introduction to EC II 29 EvoNet Summer School 2002
Evolution strategies &
evolutionary programming
Evolution strategies (Germany, 70’s, Rechenberg, Schwefel)
Typically applied to:
numerical optimization
Attributed features:
fast & good optimizer for real-valued optimization
relatively much theory
Special:
self-adaptation of (mutation) parameters standard
Evolutionary programming (USA, 60’s, Fogel et al.)
Typically applied to: machine learning (old EP), optimization
Attributed features:
very open framework: any representation and mutation op’s OK
Special:
no recombination
self-adaptation of parameters standard (contemporary EP)
A.E. Eiben, Introduction to EC II 30 EvoNet Summer School 2002
Beyond dialects
Field merging from the early 1990’s
No hard barriers between dialects, many
hybrids, outliers
Choice for dialect should be motivated by given
problem
Best practical approach: choose representation,
operators, population model, etc. pragmatically
(and end up with an “unclassifiable” EA)
There are general issues for EC as a whole
A.E. Eiben, Introduction to EC II 31 EvoNet Summer School 2002
Advantages of EC
No presumptions w.r.t. problem space
Widely applicable
Low development & application costs
Easy to incorporate other methods
Solutions are interpretable (unlike NN)
Can be run interactively, accommodate user
proposed solutions
Provides many alternative solutions
Intrinsic parallelism,straightforward parallel
implementations
A.E. Eiben, Introduction to EC II 32 EvoNet Summer School 2002
Disadvantages of EC
No guarantee for optimal solution within
finite time
Weak theoretical basis
May need parameter tuning
Often computationally expensive, i.e. slow
A.E. Eiben, Introduction to EC II 33 EvoNet Summer School 2002
The performance of EC
Acceptable performance at acceptable costs on a wide range
of problems
EC niche (where supposedly superior to other techniques):
complex problems with one or more of the following features
many free parameters
complex relationships between parameters
mixed types of parameters (integer, real)
many local optima
multiple objectives
noisy data
changing conditions (dynamic fitness landscape)
A.E. Eiben, Introduction to EC II 34 EvoNet Summer School 2002
Summary
Evolutionary Computation:
is a method, based on biological metaphors,
of breeding solutions to problems
has been shown to be useful in a number of
areas
could be useful for your problem
its easy to give it a try
is FUN