Title: Genetic algorithms
1Genetic algorithms
2Basic Goal
Known Algorithm
Complex
Optimal problem
Solution
- Often this scheme is unrealistic
- NP Problem
- Unknown algorithm
- Good and fast solution is acceptable
- ...
- We are looking for an alternative method to
search huge spaces of - possible solutions
Learn from Nature
3oracle
X
F(X)
4ADN (aperiodic cristal , Schrödinger)
Operon off/on
Guanine Adenine Tyamine Citosine
codon
gene
mRNA
20 aminoacids stops
proteines
mRNA tRNA
Humans 3 109 bases 1 ADN
molecule 2 103 bases
1 gene but 30000/40000
genes
- junk ADN
- repited sequences
- multicopies genes
- jump of genes
- exons, introns
- transposons
5Reproduction does not preserve the exact form of
the genetic material Meiosis Genes are swaped
during meiosis. Strands of DNA recombine
crossover Mutations
Correction mechanism protect ADN copying from a
large amount of mutations copying
1 error / 10000 bases
- corrections 1 error / 109 bases
Natural Selection Survival of
the fittest before reproduction Random
crossover and mutations over naturally selected
generations render improved species.
Large populations come from few individuals
6The Genetic Algorithm strategy
Complex
Optimal problem
Solution
Good
Population of solutions
natural selection rulette
mutations low rate
crossover high rate
- Are genetic algorithms different from traditional
methods? - GAs work with a coding of the parameter set
- GAs search from a population of points
- GAs use payoff information
- GAs use probabilistic transition rules
7Travelling Salesman Problem
n
Find the shortest path visiting n cities only once
1
2
NP problem There are n! solutions to explore but
checking one only takes polynomial time There is
no algorithm to find the solution Local minima,
frustration Of practical use when further (many
and complex) constraints are included Coding
e.g. A1 1,7,4,3,8,2,6,9,5 mutation
A2 1,7,3,4,8,2,6,9,5 crossover A3
1,8,2,6,7,4,3,9,5 payoff dist
d(1,7) d(7,4) ... d(9,5) d(5,1)
8TSP results
100 generations
10 cities solutions 362880 exact minimum
t 1 min dist 3.394975 AG minimum
t lt 1s distAG 3.394975 11
cities solutions 3628800 exact minimum
t 10 min dist 3.441836 AG minimum
t lt 1s distAG 3.441836
9101 cities solutions 10156 Random search
over a million solutions (t 30s) finds
a minimum at dist 43.26733 AG minimum t lt
1s distAG 30.61271
Random sample of 106 solutions
10Why do GAs work?
Some definitions
Schema H 0 1 1 1
Order of a Schema
O(H) O(0111) 4 ( fixed
digits) Defining length of a schema
d(H) d(0111) 6
(length of fixed pattern)
String A i bits l
ex A 1,0,1,
... population A A 1, A2, ..., An
schemata 101, 10,11, possible schemata
3l
01, 1, 0, present schemata in a population
with n strings n 2l
1,
11At time t we start with m examples of schema H
within the population A ( there are n strings in
A and l bits in each string )
Reproduction A String is copied
according to its fitness
Ai
The fate of a particular
schema depends on
Averaged fitness of H
Overall averaged fitness
Cgt0 life exponential growth Clt0
death exponential decay
12Reproduction does nothing to explore new
solutions Crossover mutation destroy and create
new schema Crossover If crossover is selected
uniformly at random a schema H is destroyed with
probability The survival probability
is Mutation O(H) positions must remain
unaltered
If crossover is done only with probability pc
If mutation probability pm ltlt 1
13Fundamental theorem of genetic algorithms
Low order above-average schemata receive
exponentially increasing trials in subsequent
generations n 2l (out of 3l) schemata are
explored at a given time (only n3 are processed
efficiently implicit parallelism)
14Summary for Genetic Algorithms
Genetic Algorithms are suited to search large
solution spaces. They are easy to program
Add one to your private library! Lamarck vs
Darwin They consume a lot of CPU time but
you decide the of generations Good crossover
strategies are essential to avoid local minima
This is the artful and tricky part of the game
- NP problems (TSP)
- Problems with very many constraints (timetables)
- Optimization (Control, business applications)
- Designing architecture and weights of neural nets
15A tip for Las Vegas
RR
0
1
LL
LR
LL
LL
RR
LR
RL
LL
Loaded two-arm bandit Play a population of
strategies and mutate-cross-select optimal
benefit