IE789F ch3
IE789F ch3
Genetic Algorithms
What are genetic algorithms?
Why use genetic algorithms?
Fundamentals of genetic algorithms
Applications
Earliest Predecessors:
1. Fraser, A., \Simulation of Genetic Systems by
Automatic Digital Computers: Part I Introduction", Australian Journal of Biological
Science, Vol. 10, pp. 481-491, 1957.
2. Fraser, A., \Part II - E ects of Linkage on Rates of
Advance under Selection", Australian Journal of
Biological Science, Vol. 10, pp. 492-499, 1957.
end
end
Genetic
crossover
Algorithms
110010 1010
101110 1110
110010 1110
101110 1010
chromosomes
encoding
solutions
1100101010
1011101110
mutation
0011011001
1100110001
00110 11001
00110 01001
evaluation
selection
offspring
new
population
110010 1110
101110 1010
00110 01001
decoding
roulette wheel
solutions
fitness
computation
Terminology of GAs
Genetic Algorithms
Chromosome (string, individual)
Genes (bits)
Locus
Alleles
Phenotype
Genotype
Explanation
Solution (coding)
Part of solution
Position of gene
Values of gene
Decoded solution
Encoded solution
genetic algorithm
initial population
improvement
(problem-specific)
terminal ?
improvement
(problem-independent)
No
Yes
terminal ?
Yes
end
end
No
Nature of GAs
1. Genetic algorithms work with a coding of solution
set, not the solutions themselves.
2. Genetic algorithms search from a population of
solutions, not a single solution.
3. Genetic algorithms use payo information ( tness
function), not derivatives or other auxiliary
knowledge.
4. Genetic algorithms use probability transition rules,
not deterministic rules.
5. Genetic algorithms exploit the best solution while
exploring the search space.
10
Encoding / Decoding
How to encode a solution of the problem into a
chromosome is a key to success.
decoding
coding space
solution space
Evaluation and
Selection
Genetic
Operations
encoding
Issues:
1. The feasibility of a chromosome
2. The legality of a chromosome
3. The uniqueness of mapping
11
Coding Schemes
1. Binary coding
2. Integer coding
3. Real number coding
4. Other specially designed codings
12
Examples
1. Optimization Problems
max f (x1 x2 ) = 21:5 + x1 sin(4 x1 ) + x2 sin(20 x2 )
;3:0
x1 12:1
4:1 x2 5:8
(Binary Coding)
;1
bj a
xj = aj + decimal(substringj ) 2m;; j1
where decimal(substringj ) represents the decimal value of
substringj for decision variable xj .
j
13
In this example,
(12:1 ; (;3:0)) 10 000 = 151 000
217 < 151 000 218
m1 = 18
(5:8 ; 4:1) 10 000 = 17 000
214 < 17 000 215
m2 = 15
m = m1 + m2 = 18 + 15 = 33
The total length of a chromosome is 33 bits which can be
represented as follows:
33bits
vj 000001010100101001 101111011111110
18bits
15bits
14
2. Word-Matching Problem
- The word-matching problem tries to evolve an
expression of \to be or not to be" from the
randomly-generated lists of letters.
- Since there are 26 possible letters for each of 13
locations in the list, the probability that we get the
correct phrase in a pure random way is
(1=26)13 = 4:03038 10;19 , which is about two chances
out of a billion.
(Integer Coding)
- We use a list of ASCII integers to encode the string of
letters.
- The lowercase letters in ASCII are represented by
numbers in the range 97, 122] in the decimal number
system.
- Fox example, the string of letters tobeornottobe becomes
116 111 98 101 111 114 110 111 116 116 111 98 101]
15
16
17
18
1. Sampling Space
(a) Regular Sampling Space:
new population
population
crossover
mutation
selection
replacement
19
crossover
new population
mutation
selection
offspring
20
2. Sampling Mechanism
- Sampling mechanism concerns the problem of how to
select chromosomes from sampling space.
- Basic approaches:
(a) Stochastic sampling
(b) Deterministic sampling
(c) Mixed sampling
21
fk : tness of chromosome k
pk : selection probability
pk = Ppopfk
size
j =1
fj
22
23
24
3. Selection Probability
Scaling and Ranking:
- Scaling method maps raw objective function values
to some positive real values, and the survival
probability for each chromosome is determined
according to these values.
- Ranking method ignores the actual objective
function values and uses a ranking of chromosomes
instead to determine survival probability.
Fitness Scaling
0
fk = gk (fk )
where g( ) transforms the raw tness into scaled tness.
Examples
1. Linear Scaling
0
fk = a fk + b
2. Sigma Truncation
0
fk = fk ; (f ; c
3. Power Scaling
0
fk = fk
4. Logarithmic Scaling
0
fk = b ; log(fk )
5. Boltzmann Scaling
0
fk = ef =T
k
26
Ranking Selection:
pk = q(1 ; q)k;1
or
pk = qk;1
27
mutation
hill-climbing
evaluation
28
end
end
Memetic Algorithms
fitness
local optimum
proto-child
search space
29
30
31
vn g
T = min
w
T e 2E \T ij
ij
32
Encoding
(1) Edge encoding
e4
e1
e5
e8
e2
e10
e11
e6
e3
e9
e12
e7
e1 e2
e3
e4
e5
e6
e7
e8
e9
Problems:
- Representation space is too large.
- Probability of having a tree is too low.
33
34
Examples
4
Tree
6
3
Prufer number
3
3
4
4
Prufer number
3
3
4
4
2
Prufer number
35
Procedure: Encoding
Step 1. Let vertex i be the smallest labeled leaf vertex in a labeled tree T .
36
Procedure: Decoding
Step 1. Let P be the original Prufer number and let
37
Crossover
cut-point
parent 1
parent 2
offspring 1
offspring 2
Mutation
select a position at random
parent
38
Evaluation
Step 1. Convert a chromosome into a tree.
Step 2. Calculate the total weight of the tree.
- Let P be a chromosome, and let P be the set of eligible
vertices.
39
Procedure: Evaluation
begin
T f g
eval(T ) 0
de ne P according to P
repeat
end
k
k+1
until k n ; 2
T T fers g r s 2 P
eval(T ) eval(T ) + wrs
end
40
Selection
- a mixed strategy with ( + ) selection and roulette
wheel selection is used.
Procedure: Selection
begin
end
end
41
Algorithm
Procedure: Genetic Algorithm for dc-MST
begin
t 0
initialize P (t)
evaluate P (t)
while (not termination condition) do
recombine P (t) to yield C (t)
evaluate C (t)
select P (t + 1) from P (t) and C (t)
t t+1
end
end
42
Parameters:
percentage %
100
80
60
40
20
0
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
2256
23.3
111
000
111
000
111
000
111
000
111
000
111
000
111
000
000
111
2292
3.3
111
000
111
000
2332
3.3
2342
43
111
000
111
000
3.3
111
000
111
000
2378
References
http://www.ie.ncsu.edu/fangroup/ga.html
44