Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in...
-
Upload
regina-phelps -
Category
Documents
-
view
223 -
download
3
Transcript of Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in...
Chapter 4 GAs: Selected Topics
Premature Convergence
Why GA cannot to find the optimal solutions in the practical applications?
Coding problem Limit number of iterations Limit population size Super individuals Multiple copies
Combating Premature Convergence
A. Sampling Mechanism
Characteristics of Function
A. Termination Condition
B. Population size
C. Penalty
Exploitation and Exploration
Exploreing the search space (population diversity) Too much random search no convergence
Exploiting the best individuals (selective pressure) Too much Hillclimbing local search
Sampling Mechanism
1. Stochastic sampling Proportional selection Stochastic universal sampling
2. Deterministic sampling Truncation selection (T%) Block selection (s)
)( ke
)( kSP
Stochastic Universal Sampling
procedure Stochastic Universal Samplingbegin
sum 0;ptr rand();for k 1 to pop_size do
sum sum ek; ‘expected value: while (sum > ptr) do
select chromosome k;ptr ptr + 1;
endend
end
sizepop
jjkk
kk
ffp
psizepope_
1
_
3. Mixed sampling Tournament selection (tournament size = 2) Boltzmann tournament
Brindle’s remainder stochastic sampling
4. Others Elitist model Expected value model ( ) Elitist expected value model Crowding factor model (CF)
Tjfif
e)()(
1
1
0)/)( cfvf
Ranking
Linear ranking
*
*
Nonlinear ranking
1_
)1()(
0
sizepop
qqr
rrankqrankprob
]1
1min)(max[min)( 1
n
rankrankprob n
1)1()( rankqqrankprob
Classification of Selection Strategies
Dynamic vs. Static: The selection probabilities vary across
generations.
Dynamic (yes) proportionate selection Static (no) ranking
Extinctive vs. Preservative
Guarantee each individual a non-zero selection probability.
Preservative (yes) proportional selection Extinctive (no) truncation selection
Pure? Parents are allowed to reproduce in one
generation only.
Pure (yes) SGA, Not pure(no) SGA (Elite)
ES),(
Generational? The set of parents is fixed until all offspring for the
next generation are completely produced.
Generational (yes) SGA; Not generational (no) tournament
ES),(
Modified Genetic Algorithm (modGA)
modGA_1, modGA_2 a two-step selection algorithm: “select-parents” and
“select-dead” three groups of strings: parents, dead, neutral strings Stochastic universal sampling Avoid exact multiple copies Compare with SGA, Crowding Factor Mode, and
Breeder GA (BGA) selection: dynamic, preservative, generational, elitist.
modGA_1 Algorithm
Procedure modGA_1begin
t 0initialize P(t)evaluate P(t)while (not termination-condition) dobegin
t t+1select-parents from P(t-1)select-dead from P(t-1)form P(t): reproduce the parentsevaluate P(t)
endend
modGA_2 AlgorithmProcedure modGA_2begin
t 0initialize P(t)evaluate P(t)while (not termination-condition) dobegin
t t+1select r parents from P(t-1)
select pop_size - r distinct chromosomes from P(t-1) and copy them to P(t)
form P(t): r parents breed r offspringevaluate P(t)
endend
Characteristics of the function
Scaling Linear scaling
Sigma truncation
Power law scaling
bfaf ii
))((
,0
0 ,)(
cffTf
otherwise
xifxxT
ii
ki i
ff
Window Scaling For maximum problem
W : all individuals in the last W generations ( W >= 0 )
For minimum problem
)(min)()(' yfxfxfWy
)()(max)(' xfyfxfWy
Termination Condition
Some number of evolution cycles Pre-defined value of fitness Some variation of individuals between
different generations Some percentage of the converged
alleles
Banach Fixpoint Theorem
Let
1. be a complete metric space
2. be a contractive mapping.
Then there has a unique fixpoint such that for any ,
where and .
,S
SSf :
f Sx
000 )( xxf
)(lim 0xfx i
i
Sx 0
))(()( 001 xffxf ii
A set together with is a metric space,
, if, for any elements ,
If is a metric space and , is contractive iff there is a constant such that for all
S RSS :
Syx ,,S
yxyxyx iff 0),( and ;0),( ),(),( xyyx
).,()(),( zxzyyx
),())(),(( yxyfxf
,S SSf :
)1,0[Syx ,
f
The sequence of metric space is a Cauchy sequence iff for any there is such that for all , .
A metric space is complete if any Cauchy sequence has a limit .
,, 10 pp
0knm , ),( nm pp
,S
k
nn
pp
lim,, 10 pp
Contractive Mapping GA(CM-GA)
Procedure CM-GABegin
t 0Initialize P(t)Evaluate P(t)While (not termination-condition) doBegin (contractive mapping f ( P(t) ) P(t+1))
t t + 1 Select P(t) from P(t-1) Alter P(t)
Evaluate P(t) if Eval( P(t-1)) >= Eval( P(t) ) ‘then t = t - 1
EndEnd
Px
in
i
xevalPEval )()( 1
CM-GA satisfies the assumptions of Banach fixpoint theorem: The distance
The space of populations is a metric space.
The metric space is complete.
The iteration is contractive.
CM-GA converges to population , which is a unique fixpoint in the space of all populations.
,S
212121 iff 0),( and ;0),( PPPPPP ),(),( 1221 PPPP
),(),(),( 313221 PPPPPP
)))1(())(((
))(),(()))(()),((( 2121
tPEvaltPEval
tPtPtPftPf
)1()(: tPtPf
))0((lim* PfP i
i
*P
,S
ii
PP
lim
otherwise
PEvalM
PEvalMPPif
PP
)(1
)(10
),(
2
1
21
21
Population Size
Too small converge too quickly Too large waste computational resources
Varying population Size (GAVaPS)
Varying Population Size(GAVaPS)
Procedure GAVaPS
begin
t = 0
initialize P(t)
evaluate P(t)
while (not termination-condition) do
begin
t = t+1
increase the age to each individual by 1
recombine P(t) ‘
evaluate P(t) ‘ p : reproduction ration
remove from P(t) all individuals
with age greater than their lifetime
end ‘
end
ptPopSizetAuxPopSize *)()(
PopSize t PopSize t AuxPopSize t Dead t( ) ( ) ( ) ( ) 1
Lifetime value: Proportional allocation
Linear allocation
Bi-linear allocation
)( where
),][
min(
21 MinLTMaxLT
MaxLTAvgFit
ifitnessMinLT
AbsFitMinAbsFitMax
AbsFitMinifitnessMinLT
][
2
MinFitAvgFit
MinFitifitnessMinLT
][
][ if ifitnessAvgFit AvgFitMaxFit
AvgFigifitnessMaxLTMinLT
][
)(2
1
][ if ifitnessAvgFit
Example
Initial_size = 20 Reproduction ratio = 0.4 Mutation ratio =0.015 Crossover ratio = 0.65 Length of chromosome = 20 MaxLT =7 MinLT = 1 Termination = no progress for consecutive 20 generations Independent run = 20 times
GAVaPS(1): proportional
GAVaPS(1): linear
GAVaPS(1): bi-linear
Handling Constraints
d
b
c
a
Solution Space
Xx
mmixh
mixg
xf
i
i
,,1 ,0)(
,,2,1 ,0)( tosubject
)(max
1
1
Penalty Strategy
Rejecting/Death Strategy Repairing Strategy Modifying GA Strategy Penalty Strategy Others:
Dynamic penalty functions Self-adaptive penalty function Combine penalty methods with repair algorithms
0-1 Knapsack Problem(example)
A thief robbing a store finds n items; the ith item is worth Pi dollars and weighs Wi pounds, where Pi and Wi are integers. He wants to take as valuable a load as possible, but he can carry at most C pounds in his knapsack. What items should he take? (This is called the 0-1 knapsack problem because each item must either be taken or left behind; the thief cannot take a fractional amount of an item or take an item more than once.)
ProblemMaximize
Subject to
n
i
iPixxf1
][][)(
CiWixn
i
1
][][
Penalty Strategy
)()()( xPenxfxeval
(max/min)otherwise 0
feasible is if
/
0)(
xxPen
Penalty Function:
Penalty Strategies
Penalty Functions: Logarithmic:
Linear:
Quadratic:
)()()( xPenxfxeval
n
i
CiWixxPen1
2 ))][][(1(log)(
n
i
CiWixxPen1
)][][()(
n
i
CiWixxPen1
2))][][(()(
) ][/][max (where1
iWiPni
Repair Strategy
Two different repair algorithms: Random repair Greedy repair (profit / weight)
n
i
iPixxeval1
][][)(
Algorithm:Procedure Repair (x)begin
knapsack-overfilled := false
if then knapsack-overfilled := truewhile (knapsack-overfilled) dobegin
i := select an item from the knapsackremove the selected item from the
knapsack:i.e.
if then knapsack-overfilled := false
end end
xx :
n
i
CiWix1
][][
0:][ ix
n
i
CiWix1
][][
Decoder Strategy
Ordinal representation L = ( 1 2 3 4 5 6 ) v = ( 4 3 4 1 1 1 )
Two different decoding algorithms: Random decoding Greedy decoding (profit / weight)
Algorithm:Procedure Decode (x)begin build a list L of itemsWeightSum := 0ProfitSum := 0
i := 1while i <= n dobeginj := x[i]remove the j-th item from the list Lif WeightSum + W[j] <= C thenbeginWeigthSum := WeightSum + W[j]ProfitSum := ProfitSum + P[j]endi := i+1endend
0.10.0 ))(001.01(
5.0sin0.5 :G4
0.10.0 )sgn( :G3
0.10.0 8/)8(int :G2
0.10.2 1)10sin( :G1
222
222
xyx
yx
xxx
xxeger
xxx
Crossover
One-point crossover Two-point crossover Multi-point crossover Segmented crossover Uniform crossover Gene pool recombination Simplex crossover
Messy Genetic Algorithm(mGA)
Representation tag, length, redundant and contradictory
v1 = ((7,1)(1,0)) v2 = ((3,1)(9,0)(3,1)(3,1)(3,1)) v3 = ((2,1)(2,0)(4,1)(5,0)(6,0)(7,1)(8,1))
overspecification – tie-breaking (first come, first serve) underspecification – probability / competitive templates
Selection tournament
Crossover splice & cut
Mutation bit inversion