You are on page 1of 26

1 GA details

 GA detailed process
 Schema theory
2 GA details
the stages through which a GA passes in evolving the genome population: At Generation n:
1. Create a mating pool of the same size as the population by
i. applying the fitness function to every genome;
ii. randomly selecting genomes from the population, based on the biased roulette wheel;
iii. mutating genes in the mating pool (alternatively, mutation may occur at the step 2.iii, or not at
all).
2. Build a new population (Generation n+1) by:
i. selecting pairs of genomes in the mating pool for crossover (those not selected pass directly
into the new population);
ii. mutating genes on crossover (alternatively, mutation may occur at step 1.iii, or not at all).
3. Go back to step 1.
This process is repeated until very good solutions emerge.
3 GA details

Points at which the decision of GA is made randomly:


 the selection of genomes for the mating pool by
means of the biased roulette wheel;
 the selection of genomes for crossover;
 the selection of the crossover point;
 the selection of genomes for mutation;
 the selection of the mutated gene.
4 GA Example
5 GA examples
6 GA examples
7 GA examples
8 GA examples
9 GA examples
10 GA examples
11 GA examples
12 GA examples

A conclusion: a GA solves a problem by:


1. starting with an initial random population of
genomes, or bit strings, representing potential
solutions to the problem;
2. applying a fitness function to each genome;
3. building a mating pool by selecting genomes from
this population based on their fitness;
4. generating a new population from the mating pool;
5. starting at step 2 again with the new population.
13 Schema theory
Schema theory:
 A schema is a way of identifying some part of a genome, a template.
 If the genome only consists of binary digits (0 and 1), we need three symbols
to represent schemata: 0, 1 and *, where the * means ‘don’t care’.
 For instance, *10**11 is a schema.
 Schemata need to be the same length as the genomes we’re interested in.
 A schema matches a genome if, for every position, the symbols at the
corresponding positions are identical.
 A * in the schema matches any symbol in the genome.
 For instance, the schema *100111 matches two strings (0100111 and
1100111)
 while the schema *100*11 matches four (0100011, 0100111, 1100011 and
1100111).
 The schema *10**11 matches the string 1100111, but does not match the
string 1000111 (the symbols in the second position don’t match).
14 Schema theory
Schema theory:
 How many binary strings are covered by the schema 101**0*1? List
them.
ANSWER
 23 = 8 because there are 3 *s; 10100001, 10100011, 10101001,
10101011, 10110001, 10110011, 10111001, 10111011.

Construct a schema for the following list of binary strings:


 100000, 100001, 100010, 100011, 101000, 100001, 100010,
100011, 110000, 110001, 110010, 110011, 111000, 111001,
111010, 111011.
ANSWER: 1**0**
15 Schema theory
Schema theory:
 Schemata are generally characterized by two numbers: order and
defining length.
 The order of a schema H, written as o(H), is the number of fixed
positions in that schema.
 For instance, the schema *10**11 is order 4 and *100111 is order 6.
 Order is a measure of how specific that schema is; high-order
schemata match fewer strings than low-order schemata.
 Defining length, written δ(H) , is the distance from the first to the last
fixed position in the schema.
 The schemata *10**11 and *100111 both have defining lengths of 5,
while the schema ****0** has a defining length of zero.
 Schemata with larger defining lengths are more likely to be disrupted
by crossover and mutation.
16 Schema theory

Schema theory:
 What are the values of o(H) and δ(H) for the schema
101**0*1?

ANSWER
H has five fixed positions, so its order, o(H) = 5. The first
fixed position is position 1 and the last is position 8, so its
defining length, δ(H) = 7.
17 Schema theory

Schema theory:
 The basic idea behind schema theory is that fragments of the genome
(the schemata’s fixed positions) are responsible for contributions to
an individual’s overall fitness.
 A single schema will be tested many times each generation, once for
each individual that contains it in the population.
 Finding the fitness of an individual also contributes to the
information about the relative fitness of all the schemata that can
make up that individual.
 The selection step of the GA will generally select those individuals
with the highest fitness and therefore those schemata that most
contribute to that fitness will be more commonly represented.
18 Schema theory
Schema theory:
 For instance, consider the task of trying to find a genome that encodes for
the largest binary number.
 Let’s take the number that a genome encodes as its fitness.
 If we have a small population of six individuals, as shown in the table, we
can see that individuals with the 1***** schema have an average fitness of
45.7, while individuals with the 0***** schema have an average fitness of
20.3.
 Similarly, the schema *****1 has a fitness of 31 and *****0 has a fitness
of 34.
 There is a clear difference in fitness between 1***** and 0*****, but
*****1 and *****0 have very similar fitnesses.
 Any sensible GA will be more likely to select the fittest individuals, so we
can expect that the next generation will have more instances of 1***** than
0*****, but there will be little pressure to select *****1 over *****0, so
the proportions of these schemata in the next generation will be more open.
19 Challenges of GA

Bootstrap problem:
 In artificial evolution, the danger is that all the new
variants on an initial population will be of negative or zero
fitness, or at best of such low fitness that no improvement
is possible and the evolutionary process cannot get started.

 An evolutionary algorithm will probably just wander


without direction, with no gradual improvement possible.
 Two approaches to the bootstrap problem have been
adopted in recent research in artificial systems. They are
incremental evolution and co-evolution.
20 Sharing population
Incremental evolution
 In incremental evolution, the evolutionary process is subjected to careful
human supervision. In evolving a controller to carry out a complex task, the
idea is to start by evolving controllers that can solve a simplified version of
the task and then gradually increase the complexity, evolving improved
controllers for each new version.
Co-evolution
 Organisms do not evolve in isolation. An evolutionary improvement in one
species may create difficulties for another. Co-evolution is where two or
more species of organism evolve together. Improvements in one species are
offset by inducing counter improvements in the other, hence, the two species
evolve together.
21
GA for solving binary Knapsack
problem
• Given: A set S of n items, with each item i
having:
• wi - a positive weight
• bi - a positive benefit

• Goal: Choose items with maximum total


benefit but with weight at most W.
• If we are not allowed to take fractional
amounts, then this is the 0/1 knapsack
problem
22
Binary Knapsack -example
23
GA for solving binary Knapsack
problem
24
GA for binary Knapsack
25
GA for binary Knapsack

Having n items we have a genome of length n


with possible value 0 or 1 representing
taking/leaving an item
The fitness is to maximize the value of the
taken items
Constrained to the maximum volume allowed
26
GA for binary Knapsack

You might also like