250 likes | 461 Views
Evolutionary Optimization. considering many solutions together. Where are we?. Optimization methods. Complete solutions. Partial solutions. Exhaustive search Branch and bound Greedy Best first A* Divide and Conquer Dynamic programming. Exhaustive search Hill climbing
E N D
Evolutionary Optimization considering many solutions together
Where are we? Optimization methods Complete solutions Partial solutions Exhaustive search Branch and bound Greedy Best first A* Divide and Conquer Dynamic programming Exhaustive search Hill climbing Randomized hill climbing Variable Neighbourhood Simulated Annealing Tabu search
Where are we going? Optimization methods Complete solutions Partial solutions Exhaustive search Branch and bound Greedy Best first A* Divide and Conquer Dynamic programming Exhaustive search Hill climbing Randomized hill climbing Variable Neighbourhood Simulated Annealing Tabu search multiple solutions -genetic algorithms -swarms
A population of solutions • not just parallel execution • interaction among members of population for • comparison of fitness - competition • evolutionary metaphor (M&F’s focus) • learning of features - share information • society metaphor
Genetic algorithms NATURE population chromosome life breeding mutation generations PROBLEM SPACE population solution fitness function crossover mutation generations
Genetic algorithm • population is a set of solutions • some are more fit than others • those should have better probability of ‘surviving’ • surviving means • staying alive • producing ‘offspring’ solutions
Genetic algorithm time t = t0 pick starting population P(t) evaluate members of P(t) repeat create ‘children’ C(P(t)) //crossover alter C(P(t)) //mutation evaluate members of C(P(t)) pick P(t+1) from P(t) and C(P(t)) t = t+1 until t==tMax
A simple SAT example n propositions: a solution (chromosome) is a sequence of n boolean values: {b1, … ,bn} e.g: s={t,f,f,t,t,t,f,t,f,t,f,t,f,f,t,t} where n=16
A simple SAT example SAT expression with k clauses fitness f(s): number of true clauses based on solution values (k for optimal solution) e.g: suppose k = 25 and for s={t,f,f,t,t,t,f,t,f,t,f,t,f,f,t,t} and f(s) = 13
time t = 0 population size: 4 f(s) s1={t,f,f,t,t,t,f,t,f,t,f,t,f,f,t,t} 13 s2={f,t,t,t,f,t,f,t,t,f,t,t,t,f,f,f} 9 s3={t,t,f,t,f,f,f,f,t,t,f,f,t,t,t,f} 15 s4={t,f,t,t,f,t,f,t,f,t,t,t,f,f,t,t} 16 time t = t0 pick starting population P(t) evaluate members of P(t) repeat create ‘children’ C(P(t)) //crossover alter C(P(t)) //mutation evaluate members of C(P(t)) pick P(t+1) from P(t) and C(P(t)) t = t+1 until t==tMax
time t = t0 pick starting population P(t) evaluate members of P(t) repeat create ‘children’ C(P(t)) //crossover alter C(P(t)) //mutation evaluate members of C(P(t)) pick P(t+1) from P(t) and C(P(t)) t = t+1 until t==tMax time t = 0 s1={t,f,f,t,t,t,f,t,f,t,f,t,f,f,t,t} 13 s2={f,t,t,t,f,t,f,t,t,f,t,t,t,f,f,f} 9 s3={t,t,f,t,f,f,f,f,t,t,f,f,t,t,t,f} 15 s4={t,f,t,t,f,t,f,t,f,t,t,t,f,f,t,t} 16 s43={t,f,t,t,f,t,f,t,f,t,f,f,t,t,t,f} s34={t,t,f,t,f,f,f,f,t,t,t,t,f,f,t,t} s41={t,f,t,t,f,t,f,t,f,t,f,t,f,f,t,t} s14={t,f,f,t,t,t,f,t,f,t,t,t,f,f,t,t}
time t = t0 pick starting population P(t) evaluate members of P(t) repeat create ‘children’ C(P(t)) //crossover alter C(P(t)) //mutation evaluate members of C(P(t)) pick P(t+1) from P(t) and C(P(t)) t = t+1 until t==tMax time t = 0 s1={t,f,f,t,t,t,f,t,f,t,f,t,f,f,t,t} 13 s2={f,t,t,t,f,t,f,t,t,f,t,t,t,f,f,f} 9 s3={t,t,f,t,f,f,f,f,t,t,f,f,t,t,t,f} 15 s4={t,f,t,t,f,t,f,t,f,t,t,t,f,f,t,t} 16 s43={t,f,t,t,f,t,f,t,f,t,f,f,t,t,t,f} s34={t,t,f,t,f,t,f,f,t,t,t,t,f,f,t,t} s41={t,f,t,t,f,t,f,t,f,t,f,f,f,f,t,t} s14={t,f,f,t,t,t,f,t,f,t,t,t,f,f,t,t}
time t = t0 pick starting population P(t) evaluate members of P(t) repeat create ‘children’ C(P(t)) //crossover alter C(P(t)) //mutation evaluate members of C(P(t)) pick P(t+1) from P(t) and C(P(t)) t = t+1 until t==tMax time t = 0 s1={t,f,f,t,t,t,f,t,f,t,f,t,f,f,t,t} 13 s2={f,t,t,t,f,t,f,t,t,f,t,t,t,f,f,f} 9 s3={t,t,f,t,f,f,f,f,t,t,f,f,t,t,t,f} 15 s4={t,f,t,t,f,t,f,t,f,t,t,t,f,f,t,t} 16 s43={t,f,t,t,f,t,f,t,f,t,f,f,t,t,t,f}18 s34={t,t,f,t,f,t,f,f,t,t,t,t,f,f,t,t}11 s41={t,f,t,t,f,t,f,t,f,t,f,f,f,f,t,t} 19 s14={t,f,f,t,t,t,f,t,f,t,t,t,f,f,t,t} 8
time t = t0 pick starting population P(t) evaluate members of P(t) repeat create ‘children’ C(P(t)) //crossover alter C(P(t)) //mutation evaluate members of C(P(t)) pick P(t+1) from P(t) and C(P(t)) t = t+1 until t==tMax time t = 1 s1={t,f,f,t,t,t,f,t,f,t,f,t,f,f,t,t} 13 s2={f,t,t,t,f,t,f,t,t,f,t,t,t,f,f,f} 9 s3={t,t,f,t,f,f,f,f,t,t,f,f,t,t,t,f} 15 s4={t,f,t,t,f,t,f,t,f,t,t,t,f,f,t,t} 16 s43={t,f,t,t,f,t,f,t,f,t,f,f,t,t,t,f}18 s34={t,t,f,t,f,t,f,f,t,t,t,t,f,f,t,t}11 s41={t,f,t,t,f,t,f,t,f,t,f,f,f,f,t,t} 19 s14={t,f,f,t,t,t,f,t,f,t,t,t,f,f,t,t} 8
time t = 1 population size: 4 f(s) s1={t,f,t,t,f,t,f,t,f,t,f,f,t,t,t,f}18 s2={t,f,t,t,f,t,f,t,f,t,f,f,f,f,t,t} 19 s3={t,t,f,t,f,f,f,f,t,t,f,f,t,t,t,f} 15 s4={t,f,t,t,f,t,f,t,f,t,t,t,f,f,t,t} 16 time t = t0 pick starting population P(t) evaluate members of P(t) repeat create ‘children’ C(P(t)) //crossover alter C(P(t)) //mutation evaluate members of C(P(t)) pick P(t+1) from P(t) and C(P(t)) t = t+1 until t==tMax
time t = 1 population size: 4 f(s) s1={t,f,t,t,f,t,f,t,f,t,f,f,t,t,t,f}18 s2={t,f,t,t,f,t,f,t,f,t,f,f,f,f,t,t} 19 s3={t,t,f,t,f,f,f,f,t,t,f,f,t,t,t,f} 15 s4={t,f,t,t,f,t,f,t,f,t,t,t,f,f,t,t} 16 Notes: • successful solution has ‘dominated’ • local optimum if genetic variety is lost
Independence of components if components (variables) are not independent, crossover may fail • solutions: • avoid variation that combines parents!! • redefine crossover example: TSP
Genetic algorithm for TSP representation - chromosome: • A G D B H C F E J I - 10 city tours • F E H D A J G I C B crossover: • A G D B A J G I C B - nottours • F E H D H C F E J I • strategy: • avoid crossover (GA has competition but individual variation) • revise crossover (usually tradeoffs)
Example revised crossover (p.147-8) • select first city from parent at random • continue selecting at random • if a repeat city, select from other parent • if also a repeat, select random new city A G D B H C F E J I F E H D A J G I C B child: A E D D A C G E C B B H I J I F • more costly crossover • how much is “inherited”? -absolute position -relative order -adjacency
Other examples ofrevised crossovers in TSP • double cut A G D B H C F E J I F E H D A J G I C B take midsection from one parent, copy others in order from second parent B H C F E D A J G I D A J G B H C F E I
Other examples ofrevised crossovers in TSP • transform to ordinal representation A D B C F E -> 131121 F D E B C A->644221 apply normal crossover and restore 134221 A D F C E B 641121 F D A B E C
M&F’s model of GA orEvolutionary Algorithm Five aspects of specification • representation (e.g., set of variable values) • initial population (e.g., random) • evaluation function ( e.g., fitness) • selection procedure (next generation pop.) • random variation operators(e.g., crossover, mutation)
Evolutionary algorithms M&F, p.151 procedure evolutionary algorithm begin t<-0 initialize P(t) evaluate P(t) while (not termination-condition) do begin t <- t+1 select P(t) from P(t-1) alter P(t) evaluate P(t) end end p. 181 x(t+1) = s(v(x(t))) where x - populationv - variation ops - selection op