Professional Documents
Culture Documents
30/11/2007
Genetic algorithms
Basic operators and some practical habits
Original Hollands Simple GA
41
Evolutionary algorithms
Evolution algorithms
What are evolutionary
algorithms, and where do
they locate in the world?
Universe
Borg
Vogons
Art
Life Sciences
Earth
etc
Biotop
Society
etc
Science
Politics
Sports
etc
Social Sciences
Mathematics
30/11/2007
Exact Sciences
etc
Physics
Computer Science
etc
Software Engineering
Computational Intelligence
etc
Neural Nets
Evolutionary Computing
Fuzzy Systems
42
Evolutionary algorithms
Evolution algorithms
30/11/2007
Evolutionary algorithms
Evolution algorithms
30/11/2007
Evolution
Problem solving
Environment
Individual
Fitness
Problem
Solution candidate (trial)
Quality
Fitness
->
Quality
->
44
Evolutionary algorithms
Evolution algorithms
30/11/2007
Evolutionary algorithms
30/11/2007
Things that differs in EAs compared to the genetics in nature include e.g.:
Genotype and phenotype are usually the same, so they are directly coded and
encoded from each others (same genotype always lead the same phenotype and
vice versa), i.e. the environment do not have effect to the phenotype
The individuals do not have sex, there are no male or female, so all the
individuals can mate and crossover with any other individual in the population
The individuals usually have only one chromosome (haploid, gametes), not
chromosome pairs (diploid) or double helix as in real DNA (it is totally possible
to program diploid-EA, but no-one have proved it would be beneficial with any
real problems)
http://en.wikipedia.org/wiki/Gamete
http://en.wikipedia.org/wiki/Ploidy
http://en.wikipedia.org/wiki/Dna
The indivdual can have 1 to n parents, as in nature there can be only one (asexual
reproduction, mutation only) or two (sexual reproduction, crossover) parents
There exist many EAs where new individuals have more than two parents
http://en.wikipedia.org/wiki/Reproduction
http://en.wikipedia.org/wiki/Asexual_reproduction
http://en.wikipedia.org/wiki/Sexual_reproduction
46
Evolutionary algorithms
Evolution
30/11/2007
47
Evolutionary algorithms
30/11/2007
Genotype must be able to represent all the possible solutions inside the
search space
Sometimes this means that it can also represent illegal solutions, and they
must be rule out with other means
Small changes in the genotype must lead to small changes in the organism
(e.g. height, hair color etc.), same with EAs, otherwise they will not work
48
Evolutionary algorithms
Crossover
30/11/2007
Evolutionary algorithms
Crossover
30/11/2007
Individual 2:
Individual 3:
Individual 4:
[0, 1]
[0, 1]
[0, 1]
[0, 1]
[0, 1]
50
Evolutionary algorithms
30/11/2007
Evolutionary algorithms
Equal
chance
Elitism
High
Elitism
Elitism
low
Linearly
proportional
30/11/2007
52
Evolutionary algorithms
30/11/2007
Elitist GA: Some percentage % of old individuals will survive to the next generation
Again there can be random selection, tournament selection, or ranking based selection.
Ranking based with some % of best is the most common.
If the problem is deterministic we do not need to evaluate the old individuals fitness value
again. If the problem is noisy or nondeterministic, the old individuals must be re-evaluated.
Tournament selection is usually applied so that the new individual will duel
with some random population member, and the more fit will gain the place in
the new population
Often we also use model where the child duel with one of its parents
We can also define lifetime, so that one individual can live in the
population a certain maximum number of generations
53
Evolutionary algorithms
Real coded GA
In the floating point coded GA the
chromosome of GA consist of real
numbers that are within some
boundaries, e.g. [0, 1]
In real coded GA we can use onepoint, multipoint, uniform or
arithmetic crossovers
In real coded GA the mutation can
be random between the boundaries
or Gaussian (adding Gaussian
distributed random number to the
current value)
It is also possible to use binary
coded GA and interpret the bit
vector into floating point numbers
30/11/2007
Child 1
Child 2
Evolutionary algorithms
Arithmetic crossover
30/11/2007
Note!
The arithmetic crossover is an averaging method!
All the non-mutated values of child 1 and child 2 in the
previous slide are between the gene values of parent 1 and
parent 2
Evolutionary algorithms
Mutation
30/11/2007
56
Evolutionary algorithms
30/11/2007
The value can be returned to the permitted area with e.g. following methods:
if (x > max) x=random([min, max]);
(random value within the permitted area)
if (x > max) x=max;
(if over, set vale to the border value)
if (x > max) x=max-(x-max);
(reflect back from the border)
if (x > max) x=min+x-max;
(think area as continuous max=min)
if (x > max) x= max*(max/x);
(turn back to the permitted area)
if (x < min) x=random([min, max]);
if (x < min) x=min;
if (x < min) x=min-(x-min);
if (x < min) x=max-min+x;
if (x < min) x= min*(min/x);
Sometimes the returned value is still out of permitted area, so we need value
check inside while loop that continues as long as the gene value is not in the
permitted area
57
Evolutionary algorithms
Simple GA
30/11/2007
58