Genetic Algorithms: by Volkan TUNALI
Genetic Algorithms: by Volkan TUNALI
by
Volkan TUNALI
Content
Evolutionary Computation (EC)
Positioning of EC
Some terminology
Problem types
Evolutionary Algorithms (EA)
Genetic Algorithms (GA)
Original GA by Holland
Example
Sample Application – Travelling Salesman
Positioning of EC
EC is part of computer science
Environment Problem
Individual Candidate Solution
Fitness Quality
If phenotypic traits:
Lead to higher chances of reproduction
Can be inherited
better
Typically we talk about fitness being maximised
Some problems may be best posed as
Phenotype:
a board configuration
Fitness of a configuration:
inverse of q(p) (= 1 / q(p))
M - q(p) where M is sufficiently large number
8 Queens Problem: Mutation
Small variation in one permutation, e.g.:
swapping values of two randomly chosen positions,
1 3 5 2 6 4 7 8 1 3 7 2 6 4 5 8
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
1 3 5 2 6 4 7 8 1 3 5 4 2 8 7 6
8 7 6 5 4 3 2 1 8 7 6 2 4 1 3 5
8 Queens Problem: Selection
Parent selection:
Pick 5 parents and take best two to
undergo crossover
Survivor selection (replacement)
Merge the population and offspring
Rank them according to fitness
Delete the worst two
8 Queens Problem: Summary
Early phase:
quasi-random population distribution
Mid-phase:
population arranged around/on hills
Late phase:
population concentrated on high hills
Typical Run: Progression of Fitness
Best fitness in population
T
Time (number of generations)
• Answer : it depends:
- possibly, if good solutions/methods exist
Genetic Algorithms
Developed: USA in the 1970’s
Early names: J. Holland, K. DeJong, D. Goldberg
Typically applied to:
discrete optimization
Attributed features:
not too fast
good heuristic for combinatorial problems
Special Features:
Traditionally emphasizes combining information from
good parents (crossover)
many variants, e.g., reproduction models, operators
Genetic Algorithms
Holland’s original GA is now known as the
simple genetic algorithm (SGA)
Other GAs use different:
Representations
Mutations
Crossovers
Selection mechanisms
SGA Technical Summary
Representation Binary strings
Recombination N-point or uniform
Mutation Bitwise bit-flipping
with fixed probability
1/6 = 17%
A B fitness(A) = 3
C fitness(B) = 1
3/6 = 50% 2/6 = 33%
fitness(C) = 2
An Example After Goldberg ‘89
Simple problem: max x2 over {0,1,…,31}
GA approach:
Representation: binary code, e.g. 01101 ↔ 13
Population size: 4
1-point xover, bitwise mutation
Roulette wheel selection
Random initialisation
We show one generational cycle done by hand
x2 Example: Selection
x2 Example: Crossover
x2 Example: Mutation
The Simple GA
Has been subject of many (early) studies
Still often used as benchmark for novel GAs
Shows many shortcomings, e.g.
Representation is too restrictive
Mutation & crossovers only applicable for bit-
string & integer representations
Selection mechanism sensitive for converging
populations with close fitness values
Generational population model (step 5 in SGA
repr. cycle) can be improved with explicit
survivor selection
Conclusion with a Sample
Application
Travelling Salesman Problem
visit a number of cities once
minimize the overall distance travelled
As the number of cities grow, the time
required to find the solution grows
exponentially = O(2n)
See the demonstration...