1
1
The Classic Genetic Algorithm
2
Logistics
Checkpoint 1 -- Framework
Due Friday, Dec 22nd. Group accounts…
Need one for you project? Let me know.
Dropboxes open 24/7
Operators are standing by…
Logistics Checkpoint 1 -- Framework Due Friday, Dec 22nd. Group - - PDF document
The Classic Genetic Algorithm 1 Logistics Checkpoint 1 -- Framework Due Friday, Dec 22nd. Group accounts Need one for you project? Let me know. Dropboxes open 24/7 Operators are standing by 2 1 Logistics Grad
1
2
Checkpoint 1 -- Framework
Due Friday, Dec 22nd. Group accounts…
Need one for you project? Let me know.
Dropboxes open 24/7
Operators are standing by…
3
Grad Report
Will need topics first week after we return
4
The Classic Genetic Algorithms Questions before we start
5
An EA uses some mechanisms inspired by biological
Candidate solutions to the optimization problem play
Evolution of the population then takes place after the
6
Some history
Introduced by John Holland (U of Mich) in
“Adaptation in natural and artificial systems”
Not the first to “apply” evolution to
However, is the origin of the framework in
7
Initialize population Select individuals for crossover (based on fitness function Crossover Mutation Insert new offspring into population Are stopping criteria satisfied? Finish
8
Goals:
Define an application independent
Explore processes of evolution Framework for analysis
9
To use evolutionary algorithms your must:
Define your problem Define your genotype Identify your phenotype Define the genotype -> phenotype translation Define crossover and mutation operators Define fitness Determine selection criteria Set population parameters 10
11
Classic GA representation
12
Can use to represent any phenotype
13
a binary numeral system where two
Named after Frank Grey (Bell Labs) who
14
Three digit grey codes:
Dec Gray Binary 0 000 000 1 001 001 2 011 010 3 010 011 4 110 100 5 111 101 6 101 110 7 100 111
15
1.
2.
16
Easy to define crossover and mutation
17
1.
2.
3.
18
1.
Compute fitness u(i) for each individual i
2.
Define selection probabilities p(i) proportional to u(i).
3.
Generate m offspring (using crossover / mutation) by probabilistically choosing parents (Parents can be chosen more than once).
4.
Select only the offspring to survive.
19
Individuals only live for one generation
Compete to reproduce No elitism
Parental suitability based on fitness
The more fit you are, the more likely you
Avg fitness is not necessarily increasing
Good parents can produce bad children. 20
1.
2.
3.
4.
21
Mechanism for evolution defined in a
To apply:
Genetic mapping from bit string Define fitness.
Advantage:
Theoretic study of why and how well GAs work.
22
1.
2.
3.
4.
5.
23
Goals:
Holland’s motivations Intuitive idea of why GAs work Taste of formal analysis of Gas
Discussion derived from [Michalewicz],
24
Schema:
Built by adding a * (don’t care) symbol to
Represents all bit strings that match on all
25
Schema:
Example: ( *111100100 )
Matches (0111100100) and (1111100100)
Example: ( *1*1100100)
Matches (0111100100) , (1111100100) and Matches (0101100100) , (1101100100)
26
Schema:
Any schema can match 2r strings where r is
Each string can be matched by 2m schemas
27
Order of a Schema:
The order of a schema, o(S) is the number of
Defining Length
Defines the “compactness” of a schema The defining length, δ(S) is the distance between
Schemas with a single fixed position has δ(S) = 0. 28
S1 = (***001*110) S2 = (****00**0*) S3 = (11101**001) o(S1) = 6 δ(S1) = 10-4 = 6 o(S2) = 3 δ(S2) = 9-5 = 4 o(S3) = 8 δ(S1) = 10-1 = 9
29
Strings / generation
ξ (S, t) = number of strings in a population
Fitness
eval(S,t) = average fitness for all strings
30
Step 1 is to be selected as a parent. Probability, pi of individual i being chosen is
pi = eval (vi) / F(t)
31
Probability for an individual matching
eval (S, t) / F(t)
Number of strings matched by a
ξ (S, t)
Number of parents to be selected =
32
Number of parents matching the schema for
ξ (S, t+1) = ξ (S, t) • pop_size • (eval (S, t) /
Letting Fa = average fitness of all in
Fa = F(t) / pop_size
Then
ξ (S, t+1) = ξ (S, t) • (eval (S, t) / Fa(t))
33
Let’s consider this
ξ (S, t+1) = ξ (S, t) • (eval (S, t) / Fa(t))
Observations:
Number of strings in a schema grows based on
Good schemas get more members in next
Bad schemas don’t. 34
Selection is non-elitist. We only chose parents, not offspring. Must consider what the operations of
Questions so far?
35
Using standard one point crossover. Illustate using example:
v1 = (111011111010001000110000001000110)
This matches schemas
S0 = (****111**************************) S1 = (111****************************10) 36
v1 =
v2 =
Producing offspring:
(111011111010001000111010111111011) (000101000010010101000000001000110)
37
Producing offspring:
(111011111010001000111010111111011) (000101000010010101000000001000110)
Schemas:
S0 = (****111**************************) δ(S0) = 2 S1 = (111****************************10) δ(S1) = 32
S0 survives, S1 does not 38
Observation:
Defining length of a schema has much to
In fact, if crossover site is selected uniformly
pd (S) = δ(S0) / (m-1) Probablility of survival:
ps (S) = 1 - pd = 1 - (δ(S) / (m-1))
39
Using standard mutation operator. Illustate using example:
v1 = (111011111010001000110000001000110)
This matches schemas
S0 = (****111**************************)
As long as mutation point is a don’t care the schema
40
Standard mutation operator, randomly
From survivability of the schema,
Schema survives if the flipped bit is an *. Probability of the flipped bit being * can be
The higher the order, the higher the probably
41
Depends on:
Probability of schema members being
Probably of schema survivabilty under
Probability of schema survivability under
42
Survival of schemas with above average
Schema with low order have better
Schema with small defining length have
43
Short, low-order, above-average
Leading to…
44
“A genetic algorithm seeks near-optimal
45
“Just as a child creates magnificent
46
Note:
Nowhere in the analysis was any mention
Advantage of using a common standard.
Something was learned, not only about
Questions?
47
Classic Genetic Algorithms are a
With standard genotype, reproduction
In depth analysis, can, and has been
Not just solving problems, but exploring
48
Now take those messages home…
And have a good break!!!!
But remember:
Checkpoint 1 -- due tomorrow Checkpoint 2 -- due when we return (1/9)
Enjoy!