Intro Genetic Algorithms
Intro Genetic Algorithms
combinatorial improvement
problem instance
fenotype data structures
genotype
specific generic
genetic
heuristics improvement
algorithms
for instance class routine
acceptable
fenotyperesult datagenotype
structures
using formalism
notion of a building block is formalized as a schema
schemata are propagated or destroyed
according to the laws of probability
basic cycle of simple genetic algorithms
1. select parents for the mating pool
proportional to their fitness,
e.g. by roulette-wheel selection
(size of mating pool = population size)
2. shuffle the mating pool randomly
3. for each consecutive
pair apply crossover with probability pc , else copy parents
4. for each offspring apply mutation
(bit-flip with probability pm independently for each bit)
5. replace the population with the resulting offspring
standard representation and selection
fenotype space genotype space = {0,1}L
encoding 10010001
(representation)
10010010
010001001
decoding 011101001
(inverse
representation)
selection:
main idea: better individuals get higher chance
chances proportional to fitness
1/6 = 17% fitness(A) = 3
implementation:
roulette wheel technique
assign to each individual A BC fitness(B) = 1
n
max v j x j with x j {0,1}
j=1 0-1 knapsack problem
n
subject to w x
j=1
j j b
fitness: v x
j=1
j j if w x
j=1
j j b else 0
operators
one-point crossover: randomly chosen position
(defining) length
the distance between the first and the last fixed bit
(difference between their positions)
order
the number of fixed bits in a schema
examples
for a binary individual with the gene sequence 0 1 1 1 0 0 0,
one (of many) matching schema has the form, * 1 1 * 0 * *
the schema H = [0 1 * 1 *] identifies the chromosome set,
01010
01011
01110
01111
11****00 is the set encoded in 8 bits,
beginning with two ones and ending with two zeros
length =7
order=4
1*01, beginning with 1 and ending with 01
length = 3
order =3
0*101*
length=4
order =4
approximating schema dynamics
let H be a schema
with at least one instance present in generation k
let e(H, k) be the number of instances of H in P(k)
let f(H,k) be the average fitness of instances of H
f (x ) 1
f (H, k ) = xHP (k )
e(H, k )
F (k) = f (x )
N xP(k )
f (H, k )
e(H, k )
F (k )
number of offspring of x is f(x)/f(pop)
(roulette-wheel or fitness proportionate selection)
approximating schema dynamics
schemata with fitness greater (lower) than
the average population fitness are likely
to account for proportionally more (less)
of the population at the next generation
strictly speaking, for accurate estimates of expectation
the population size should be infinite
note that the average fitness of a schema
is never explicitly calculates,
but schema proliferation depends on its value
f (H, k )
e(H, k )
F (k )
approximating schema dynamics
consider the following individual, h,
two matching schema, H1, H2 and
crossover point between 3rd and 4th gene:
h= 1 0 1 | 1 1 0 0
H1 = * 0 1 | * * * 0
H2 = * 0 1 | * * * *
observations,
- schema H1 will be broken by the location of the crossover operator
unless the second parent is able to repair the disrupted gene.
- schema H2 emerges unaffected and is therefore independent of the
second parent.
- with Pdiff(H, k) is the probability that the second parent
from generation k does not match schema H
under single point crossover, the (lower bound) probability of schema
H surviving at generation k is, P(H survives) = 1 P(H dies)=
d(H) d(H)
1 pC pdiff (H, k ) 1 pC
L1 L1
approximating schema dynamics
mutation is applied gene by gene.
in order for schema H to survive,
all non * genes in the schema must remain unchanged
probability of not changing a gene is (1 pm)
require that all o(H) non * genes survive, or (1 pm)o(H)
typically the probability of applying the mutation operator, pm,<< 1,
thus
(1 pm)o(H) appr. 1 o(H) pm
under gene wise mutation,
the surviving probability of an order o(H) schema H at generation k is,
o(H)
(1 pm ) 1 o(H)pm
the schema theorem
lemma 1: the expected number of f (H, k )
instance of H in the mating pool is e(H, k )
F (k )
lemma 2: the probability that
an instance of H in the mating pool is chosen (pc)
and neither of its offspring is in H is
l(H)
pC pdiff (H, k )
lemma 3: the probability that L1
an instance of H in the mating pool remains in H
after the mutation operator is
(1 pm )o (H)
d(H) f (H, k )
1 pC o(H)pm e(H, k )
L1 F (k )
the schema theorem
the theorem was a milestone in the development of genetic algorithms,
but it has undesirable assumptions:
e(H, k + 1) (1 + c)e(H, k )
where c is the constant by which fit schema are always fitter than the
population average.
the simple genetic algorithm