Professional Documents
Culture Documents
CH 07
CH 07
Chapter 7
Derivative-Free Optimization
Outline
Model space
Adaptive networks
Neural networks
Fuzzy inf. systems
Soft
Computing
Approach space
Derivative-free optim.
Derivative-based optim.
Genetic Algorithms
Motivation
• Look at what evolution brings us?
- Vision
- Hearing
- Smelling
- Taste
- Touch
- Learning and reasoning
• Can we emulate the evolutionary process with
today's fast computers?
Genetic Algorithms
Outlines:
Basics of genetic algorithms
Further Evolution Of GA
Applications Of Genetic
Algorithms.
Genetic Algorithm.
Terminology:
• Fitness function
• Population
• Encoding schemes
• Selection
• Crossover
• Mutation
• Elitism
Three operators- Reproduction, Crossover
Mutation
Chromosome
1 01110 8 16 8
2 11000 15 30 23
3 00100 2 4 25
4 10010 5 10 30
5 01100 12 24 42
6 00011 8 16 50
Crossover
0 1 0 1 1 1 0 0 1 0 1 0 0 1
1 1 1 1 0 0 1 1 1 1 1 1 1 0
Crossover site
Mutation
n = population size,
pc = crossover probability,
pm = mutation probability,
G = generation gap.
G = 1 non-overlapping population
0<G<1 overlapping
Genetic Algorithms
10010110 10010110
01100010 Elitism 01100010
10100100 10100100
10011001 10011101
01111101 01111001
... ...
... Selection Crossover Mutation ...
... ...
... ...
Current Next
generation generation
Step1: Establish a base population of chromosomes.
(b)Crossover Process
Mating Pool after Crossover New
Reproduction Mate Site Population x
0100|1 2 4 01000 8
1100|0 1 4 11001 25
11|000 4 2 11011 27
10|011 2 2 10000 16
Schemata
Schema Theorem:
Short, low-order, above-average schemata receive
exponentially increasing trials in subsequent
generations.
Schema order :
ex: o(*111*)=3 o(*1***)=1
Schema length :
ex: (011*1**)=5-1=4 (0******)=1-1=0
Mapping objective function values to
:
fitness
Minimize a cost function g(x):
f x
0 otherwise,
Diversity
Premature convergence
Linear scaling.
Linear Fitness scaling
f' = af + b,
where the coefficient a and b are chosen such that
f’avg = favg
and
f’max = Cmult favg’
when Cmult is the number of expected copies desired f
or the best population typically small populations (n
=50 to 100), Cmult =1.2 to 2 has been used .
Coding
Coding maps a finite-length parameters of
an optimization problem.
f3*
t0 t1 t2 t3 t4 t5
Time, t
Optimization problems with
constraints
To incorporate GA search, we can use the penalty
method which degrades the fitness ranking in
relation to the degree of constraint violation.
Minimize g(x)
subject to hi (x)≥0, i=1,2,…,n,
n
Minimize g x r h i x
i 1
Elitism.
Deterministic Sampling.
Remainder Stochastic Sampling with Replacement.
Remainder Stochastic Sampling Without
Replacement.
Ranking Procedure.
Elitism
The elitist strategy copies the best member of each
succeeding generation. This strategy may
increase the speed of domination by a super
individual and thus improves the local search at
the expense of , but on balance it appears to
improve GA performance.
Deterministic Sampling
count
min
1n
Rank
Figure Baker’s ranking procedure
Advanced Operators
Chromosome 1: 10110001100
Chromosome 2: 00101101001
This problem can be solved by, for example, two point crossover
as follows:
12345678
10010001
where 1,2,…,8 represent positions or gene names.
two inversion sites are chosen at random:
12|3456|78
01|1110|10
Then after inversion, it becomes
12654378
01011110
Macro-operators - Interspecies differentiation
Share, s( d )
f ( xi )
fs(xi)= j
n
s ( d ( xi , xj )) 0.0
1
0 share
Distance dij = || xi - xj ||
Example
the fitness of each string. Since the fitness should i
ncrease as the distance the fitness F(q) of the string q
= 0-4-8-10-15-20-23-26 can be given by F(q)= 1/ (d0-4+ d
4-8
+…+d23-26 ), where di-j is the distance between nodes i
and j, which is equal to the length of link on the static
map.
Example
Parent 1: 0-1-2-3-6-9-11-15-16-21-24-26
Parent 2: 0-4-8-10-15-20-23-26
Since each parent has the point 15, the underlined parts of
each string are exchanged, yielding:
Child 1: 0-1-2-3-6-9-11-15-20-23-26
Child 2: 0-4-8-10-15-16-21-24-26
After the crossover children are checked to determine
whether each string has repeated number
Child 3: 0-1-2-3-6-9-11-15-10-7-11-17-22-25-26.
and after the cutoff operation,
Child 3’: 0-1-2-3-6-9-11-17-22-25-26
Genetic Algorithms
Example: Find the max. of the “peaks” function
z = f(x, y) = 3*(1-x)^2*exp(-(x^2) - (y+1)^2) - 10*(x/5 - x^3 -
y^5)*exp(-x^2-y^2) -1/3*exp(-(x+1)^2 - y^2).
Genetic Algorithms
GA process:
Reduce temperature T
Simulated Annealing
Example: Travel Salesperson Problem (TSP)
How to transverse n cities once and only
once with a minimal total distance?
Simulated Annealing
Move sets for TSP
12 12
10 10
3 3
1 6 Inversion 1 6 Translation
2 7 2 7
11 8 9 11 8 9
4 5 4 5
1-2-3-4-5-6-7-8-9-10-11-12 1-2-3-4-5-9-8-7-6-10-11-12
12 12
10 10
3 3
1 Switching 1
6 6
2 7 2 7
11 9 11 9
8 8
4 5 4 5
1-2-11-4-8-7-5-9-6-10-3-12 1-2-3-4-8-7-5-9-6-10-11-12
Simulated Annealing
A 100-city TSP using SA
Introduction (cont.)
Introduction (cont.)
Introduction (cont.)
Terminology:
Terminology (cont.)
4 5 4 5
1-2-3-4-5-6-7-8-9-10-11-12 1-2-3-4-5-9-8-7-6-10-11-12
Select 3 and 11
12 and switch them 12
10 10
3 Switching 3
1 6 1 6
2 7 2 7
11 9 11 9
8 8
4 5 4 5
1-2-11-4-8-7-5-9-6-10-3-12 1-2-3-4-8-7-5-9-6-10-11-12
Simulated Annealing (cont.)
It is based on 2 observations:
Flowchart:
Select a random dx
yes x = x + b + dx
f(x+b+dx)<f(x)?
b = 0.2 b + 0.4 dx
no
yes x = x + b - dx
f(x+b-dx)<f(x)?
b = b - 0.4 dx
no
b = 0.5 b
Hybrid Genetic Algorithm
Simulated Annealing
SA mutation (SAM) SA Recombination (SAR)
0.5
1.1 -0.7
-1.6 2.1
0.9 -7.3
1.5 3.5
-0.8 -1.9
Encoding : (1.1, -0.7, 0.5, 0.9, 1.5, -0.8, -1.9, 3.5, -7.3, -1.6, 2.1)
Initialization of weights
Unbiased-mutate-weight:
Biased-mutate-weights:
Mutate-nodes:
Unbiased-mutate-weight
yes x = x + b + dx
f(x+b+dx)<f(x)?
b = 0.2 b + 0.4 dx
no
yes x = x + b - dx
f(x+b-dx)<f(x)?
b = b - 0.4 dx
no
b = 0.5 b
Random Search
Example: Find the min. of the “peaks” function
z = f(x, y) = 3*(1-x)^2*exp(-(x^2) - (y+1)^2) - 10*(x/5 - x^3 -
y^5)*exp(-x^2-y^2) -1/3*exp(-(x+1)^2 - y^2).
Principle:
It is based on 4 operations:
• Reflection
• Contraction
• Shrinkage
Downhill Simplex Search (cont.)
(Choose an _ _ _
*
opposite P P ( P Ph ) ( P centroid of (n 1) points)
direction of Ph)
* *
y fP ( 0)
Downhill Simplex Search (cont.)
A. Reflection (cont.)