Docsity

Practical Issues in Implementing Genetic Algorithms: Constraint Handling and Convergence, Slides of Computational Physics

Partial preview of the text

Download Practical Issues in Implementing Genetic Algorithms: Constraint Handling and Convergence and more Slides Computational Physics in PDF only on Docsity!

GA Examples:

Practical Issues Dr. Nasir M Mirza

Computational Physics^ Computational Physics

Email: [email protected]

Practical Implementation Issues The next set of slides will deal with some issuesencountered in the practical implementation of agenetic algorithm. Specifically constraint handling and convergencecriteria.

Constraint Handling Example of a penalty term. This will provide a numerical violation value.

It is

up to you to decide how this will effect yourfitness.

∑^

=^

m = j

l k

k

j^

x

h

x

g

xP

1

1

2

2

] 0 ),

max[

Convergence Common ways of determining convergence: 1.^

No change in best quality design over chosennumber of gens.

2.^

No change in average quality of population ofchosen number of gens.

3.^

Set a maximum allowable number ofgenerations.

4.^

Set a maximum allowable number of objectivefunction evaluations.

Example

ON OFF

ON OFF

ON OFF

ON OFF

ON OFF

Payoff ($)

f (s)

We will toggle the switches to alter the payoff.

Black Box

Example According to our 5 basic components, what shouldour first step be? Considering the nature of our problem, is there anencoding scheme that we think may work well? How can we encode solutions to our problem inthis way?

Example What’s next? We must decide how to generate an initialpopulation. We will use a random approach.

This would be

like flipping a coin a sufficient number of times tofill each of our initial designs with 1’s and 0’s.

Example Now what? We must decide how we are going to evaluate our designfitness.

This is not (necessarily) the objective function value. In our case, we will consider the output (payoff) of ourblack box to be the design fitness (We will treat the switchsettings as a binary number and our fitness will be thesquare of the decimal equivalent).

Example Variation - Crossover Recall the approaches presented for crossover onvectors of bits. (random parameter selection andn-pt crossover) We will choose to use single point uniformcrossover.

(uniform refers to the means by which

we generate our random crossover pt.)

Example Variation – Mutation We will use random bit mutation which in this caseis exactly the same as random design variablereassignment since each of our design variables isin itself a bit.

Example Execution We will maintain a population of 4 members andperform 2 crossovers per generation.

With 4

members, there are 6 possible parings (excludingorder) so this is a 33% crossover rate.

We will use

a 5% mutation rate (bitwise).

Example Initial Population – Gen. #0 (recall f = x

string

X^

f^

f/favg

cop.

avg

Example Generation #1 - evaluation + selection for 2^ string

X^

f^

f/favg

cop.

avg

Example Generation #2 - variation^ string

after cross. after mutation