Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in...

45
Chapter 4 GAs: Selected Topics

Transcript of Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in...

Page 1: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

Chapter 4 GAs: Selected Topics

Page 2: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

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

Page 3: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

Combating Premature Convergence

A. Sampling Mechanism

Page 4: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

Characteristics of Function

A. Termination Condition

B. Population size

C. Penalty

Page 5: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

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

Page 6: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

Sampling Mechanism

1. Stochastic sampling Proportional selection Stochastic universal sampling

2. Deterministic sampling Truncation selection (T%) Block selection (s)

)( ke

)( kSP

Page 7: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

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

_

Page 8: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

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

Page 9: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

Ranking

Linear ranking

*

*

Nonlinear ranking

1_

)1()(

0

sizepop

qqr

rrankqrankprob

]1

1min)(max[min)( 1

n

rankrankprob n

1)1()( rankqqrankprob

Page 10: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

Classification of Selection Strategies

Dynamic vs. Static: The selection probabilities vary across

generations.

Dynamic (yes) proportionate selection Static (no) ranking

Page 11: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

Extinctive vs. Preservative

Guarantee each individual a non-zero selection probability.

Preservative (yes) proportional selection Extinctive (no) truncation selection

Page 12: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

Pure? Parents are allowed to reproduce in one

generation only.

Pure (yes) SGA, Not pure(no) SGA (Elite)

ES),(

Page 13: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

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),(

Page 14: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

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.

Page 15: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

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

Page 16: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

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

Page 17: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

Characteristics of the function

Scaling Linear scaling

Sigma truncation

Power law scaling

bfaf ii

))((

,0

0 ,)(

cffTf

otherwise

xifxxT

ii

ki i

ff

Page 18: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

Window Scaling For maximum problem

W : all individuals in the last W generations ( W >= 0 )

For minimum problem

)(min)()(' yfxfxfWy

)()(max)(' xfyfxfWy

Page 19: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

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

Page 20: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

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

Page 21: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

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

Page 22: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

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

Page 23: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

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

Page 24: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

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

Page 25: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

Population Size

Too small converge too quickly Too large waste computational resources

Varying population Size (GAVaPS)

Page 26: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

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

Page 27: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

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

Page 28: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

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

Page 29: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.
Page 30: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.
Page 31: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.
Page 32: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

GAVaPS(1): proportional

GAVaPS(1): linear

GAVaPS(1): bi-linear

Page 33: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

Handling Constraints

d

b

c

a

Solution Space

Xx

mmixh

mixg

xf

i

i

,,1 ,0)(

,,2,1 ,0)( tosubject

)(max

1

1

Page 34: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

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

Page 35: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

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.)

Page 36: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

ProblemMaximize

Subject to

n

i

iPixxf1

][][)(

CiWixn

i

1

][][

Page 37: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

Penalty Strategy

)()()( xPenxfxeval

(max/min)otherwise 0

feasible is if

/

0)(

xxPen

Penalty Function:

Page 38: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

Penalty Strategies

Penalty Functions: Logarithmic:

Linear:

Quadratic:

)()()( xPenxfxeval

n

i

CiWixxPen1

2 ))][][(1(log)(

n

i

CiWixxPen1

)][][()(

n

i

CiWixxPen1

2))][][(()(

) ][/][max (where1

iWiPni

Page 39: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

Repair Strategy

Two different repair algorithms: Random repair Greedy repair (profit / weight)

n

i

iPixxeval1

][][)(

Page 40: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

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

][][

Page 41: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

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)

Page 42: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

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

 

Page 43: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

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

Page 44: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

Crossover

One-point crossover Two-point crossover Multi-point crossover Segmented crossover Uniform crossover Gene pool recombination Simplex crossover

Page 45: Chapter 4 GAs: Selected Topics. Premature Convergence Why GA cannot to find the optimal solutions in the practical applications? Coding problem Limit.

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