Docsity

Genetic Algorithms: GA Operators and Parent Selection Methods, Slides of Computational Physics

Partial preview of the text

Download Genetic Algorithms: GA Operators and Parent Selection Methods and more Slides Computational Physics in PDF only on Docsity!

Lect 3: GA Operators^ Dr. Nasir M Mirza

Computational Physics^ Computational Physics

Email: [email protected]

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 •^ Evaluation of the fitness is the computationally-intensive portion of a GA optimization •^ Each chromosome holds the information thatuniquely describes an individual. •^ Each chromosome/(parameters set)/individual canbe evaluated separate from the other individuals.^ •^ GA optimizations are typically described as embarrassinglyparallelizable •^ The evaluation of the chromosomes reduces down toa fitness value for each individual which will beused in the next step

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; }

Roulette Wheel Selection • Probability of parenthood isproportional to fitness. • Use the wheel until twoparents are selected. • The two parents create oneoffspring. • The process is repeated tocreate a new population forthe next generation.

Fit(#1)Fit(#2)Fit(#3)Fit(#4)Fit(#5) Docsity.com

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

GAs: Proportionate Selection (continued) •^ There are a number of disadvantages associatedwith using proportionate selection:^ •^ Cannot be used on minimization problems,^ •^ Loss of selection pressure (search direction) aspopulation converges,^ •^ Susceptible to Super Individuals

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: Tournament Selection •^ In Tournament Selection, q individuals are randomly selectedfrom the population and the best of the q individuals is returnedas a parent. •^ Selection Pressure increases as q is increased and decreases a qis decreased. •^ 4 individuals are randomly selected from the population.

Two are

eliminated and two become the parents of a child in the nextgeneration

A^ A B C^ D D

Fitness(A) > Fitness(B) Fitness(D) > Fitness(C)

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 •^ Genetic Algorithms typically use two types of operators:^ •^ Crossover operators (Sexual Recombination), and^ •^ Mutation operators (Asexual) •^ Crossover is usually the primary operator with mutationserving only as a mechanism to introduce diversity in thepopulation. •^ However, when designing a GA to solve a problem it isnot uncommon that one will have to develop uniquecrossover and mutation operators that take advantage ofthe structure of the solution set comprising the searchspace.

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

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 parameters remained intact, and the child inherited the same eyes as mom and the same nose as dad.

-^ Example Recombination with one crossover point

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.