Download Genetic Algorithms: Parent Selection, Crossover, and Mutation and more Slides Stochastic Processes in PDF only on Docsity!
Gas: Create An Initial Population •^ First we choose a population size and encodingmethod; •^ As second setep we must choose a maximum rangefor each parameter. •^ Ranges for parameters should be determined basedon what would be physically reasonable (if you’reinterested in solving a physical problem). •^ Then develop an initial population set; it can begenerated by randomizing the genes for eachchromosome of the initial population •^ Next Step is the selection of parents for operations
GAs: Evaluate the Fitness •^ Next we must evaluate the fitness. •^ The fitness function is somehow based on the genesof the individual and should reflect how good a givenset of parameters is. For example;^ •^ Ability to swim faster than other robotic fish^ •^ Ability of a density functional to better predict chemicalphenomena^ •^ Power output of a system;^ •^ Or a value from a function for model i.e., f(x, y, z). •^ A larger fitness value will give the individual a higherprobability of being the parent of one or morechildren.
Genetic Algorithms: Parent Selection Methods •^ An Example Genetic Algorithm^ Procedure
GA{ t^ =^ 0; Initialize
P(t); Evaluate
P(t); While^
(Not^ Done) {^ Parents(t)
=^ Select_Parents(P(t)); Offspring(t)
=^ Procreate(Parents(t)); Evaluate(Offspring(t)); P(t+1)=
Select_Survivors(P(t),Offspring(t)); t^ =^ t^
+^ 1; }
GAs: Parent Selection Methods •^ The parents must be selected based on their fitness; •^ The individuals with a higher fitness must have a higherprobability of having offspring; •^ GA researchers have used a number of parent selectionmethods. •^ Some of the more popular methods are:^ •^ Roulette Wheel Selection^ •^ Proportionate Selection^ •^ Linear Rank Selection^ •^ Tournament Selection
Roulette Wheel Selection •^ This form of selection has problems ifthe fitness changes by orders ofmagnitude. •^ If two individuals have a much higherfitness, they could be the parents for^ every
child in the next generation.
Fit(#1)Fit(#2)Fit(#3)Fit(#4)Fit(#5)
-^ If the fitness value is very close, theparents will be chosen with equalprobability, and the function will ceaseto optimize. •^ Roulette selection is very sensitive tothe problem being solved andgenerally requires modifications towork at all.
Fit(#1)Fit(#2)Fit(#3)Fit(#4)Fit(#5)
Another Reason Not to Use the Roulette Wheel
docsity.com
Genetic Algorithms: Proportionate Selection •^ In Proportionate Selection, individuals are assigned aprobability of being selected based on their fitness:^ •^ p
= f/^ Σi i^ fj
-^ Where p
is the probability that individual i will be selected,i
-^ fis the fitness of individual i, andi^ •^ Σfrepresents the sum of all the fitnesses of the individualsj^ with the population. • This type of selection is similar to using a roulettewheel where the fitness of an individual is representedas proportionate slice of wheel. The wheel is then spunand the slice underneath the wheel when it stopsdetermine which individual becomes a parent.
GAs: Linear Rank Selection •^ In Linear Rank selection, individuals are assignedsubjective fitness based on the rank within thepopulation:^ •^ sf
= (P-ri )(max-min)/(P-1) + mini
-^ Where r
is the rank of indvidual i,i
-^ P is the population size, •^ Max represents the fitness to assign to the best individual, •^ Min represents the fitness to assign to the worst individual. • p= sf/i^ i^
ΣsfRoulette Wheel Selection can be performedj^ using^
the subjective fitnesses.
-^ One disadvantage associated with linear rank selection isthat the population must be sorted on each cycle.
GAs: Linear Rank Selection • All individuals in thepopulation areranked according tofitness • Each individual isassigned a weightinversely proportionalto the rank (or othersimilar scheme).
1 rank ( )^
1 7.^1 rank
Fit(#1)Fit(#2)Fit(#3)Fit(#4)Fit(#5) Fit(#1)Fit(#2)Fit(#3)Fit(#4)Fit(#5) docsity.com
GAs: Tournament and Rank Selection^ •^ Tournament selection isvery similar to rankselection (when weassign a weight =1/rank).^ •^ In the limit of a largepopulations, both havesimilar statistics
Fraction of^ children^9 Both parents were^ above the median^166 One parent was^ above the median^161 Neither parent was^ above the median^16
Genetic Algorithms: Genetic Procreation Operators •^ An Example Genetic Algorithm^ Procedure
GA{ t^ =^ 0; Initialize
P(t); Evaluate
P(t); While^
(Not^ Done) {^ Parents(t)
=^ Select_Parents(P(t)); Offspring(t)
=^ Procreate(Parents(t)); Evaluate(Offspring(t)); P(t+1)=
Select_Survivors(P(t),Offspring(t)); t^ =^ t^
+^ 1; }
Genetic Algorithms: Genetic Procreation Operators •^ CROSSOVER OPERATOR •^ However, there are a number of crossover operatorsthat have been used on binary and real-coded GAs:^ •^ Single-point Crossover,^ •^ Two-point Crossover,^ •^ Uniform Crossover
Genetic Algorithms: Single-Point Crossover •^ CROSSOVER OPERATOR •^ Given two parents, single-point crossover will generate a cut-point andrecombines the first part of first parent with the second part of thesecond parent to create one offspring. •^ Single-point crossover then recombines the second part of the firstparent with the first part of the second parent to create a secondoffspring. Single-Point Crossover: EXAMPLE^ Parent 1:
X
X^
X^ X^
X^ X^
X^ X
Parent 2:
Y
Y^
Y^ Y^
Y^ Y^
Y^ Y
Offspring 1:
X^
X^ Y^
Y^ Y^
Y^ Y^
Y
Offspring 2:
Y^
Y^ X^
X^ X^
X^ X^
X docsity.com
Genetic Algorithms: Single-Point Crossover •^ If a crossover point occurs within a parameter:
A^ a B^ b C^ c D^ d E^ e F^ f G^ g H^ h
A B C D E F g h
Param. 1 (eyes)^ Param. 2^ (nose)
mom dad child^ In this case the childwill have a new nosethat is not the same^ as mom’s or dad’s.
Genetic Algorithms: Two-Point Crossover •^ Two-Point crossover is very similar to single-point crossover exceptthat two cut-points are generated instead of one. Example:^ Parent 1:
X X^ | X X X |
X X
Parent 2:
Y Y |^ Y Y Y
| Y Y
Offspring 1:
X X Y Y Y X X
Offspring 2:
Y Y X X X Y Y