Beruflich Dokumente
Kultur Dokumente
FOR ENGINEERING
OPTIMIZATION
H.D. MEHTA
ASSO. PROF (ELECT. ENGG)
L.D. COLLEGE OF ENGG.
AHMEDABAD
WHAT IS OPTIMIZATION ?
Optimization is the process of making
something better
An engineer or scientist comes up with a new
idea and optimization improves on that idea
Optimization consists in trying variations on
an initial concept and using the information
gained to improve on the idea
A computer is the perfect tool for optimization
if the data can be input in electronic format
OPTIMIZATIONCONTD
Feed the computer some data and out comes
the solution
Is this the only solution? Often times not
Is it the best solution? Thats a tough question
Optimization is the math tool that we rely on
to get these answers
OPTIMIZATIONCONTD
Our lives confront us with many opportunities for
optimization
What time do we get up in the morning so that we
maximize the amount of sleep yet still make it to
work on time?
What is the best route to work?
Which project do we tackle first?
Optimization is the process of adjusting the inputs
to or characteristics of a device, mathematical
process, or experiment to find the minimum or
maximum output or result
2/18/16
Key terms
Individual - Any possible solution
Population - Group of all individuals
Search Space - All possible solutions to the
problem
Chromosome - Blueprint for an individual
Trait - Possible aspect (features) of an
individual
Allele - Possible settings of trait (black, blond,
etc.)
Locus - The position of a gene on the
chromosome
Genome - Collection of all chromosomes for
REPRESENTATION OF DESIGN
VARIABLES
In GAs the design variables are represented as string of
2/18/16
12
REPRESENTATION OF DESIGN
VARIABLES
If a continuous variable x with bounds 1 and 5 is to be
2q
+1=
401 or q =9
2/18/16
13
FITNESS FUNCTION
As GAs mimic the survival of the fittest principle of nature to
14
GA OPERATION
The operation of GA begins with a population of random
15
GA OPERATORS
(1) REPRODUCTION (2) CROSSOVER (3) MUTATION
REPRODUCTION
Reproduction is the first operation applied to the population
16
REPRODUCTION..CONT
D
The implementation of the selection process given by
2/18/16
17
REPRODUCTION..CONT
D
In previous fig., the population size is assumed to be 6 with fitness
2/18/16
value
of selection
e
Probability
of Cum.
Prob
12
0.12
0.12
0.00-0.12
0.04
0.16
0.12-0.16
16
0.16
0.32
0.16-0.32
0.08
0.40
0.32-0.40
36
0.36
0.76
0.40-0.76
24
0.24
1.00
0.76-1.00
18
REPRODUCTION..CONT
D
Suppose the random numbers generated are
0.41
0.10
0.42
0.80
0.67
0.39
0.63
0.53
0.86
0.88
0.75
0.55
String Number
to be copied to
mating pool
2/18/16
19
SRWS
Solution, i
Fi
pi
Pi
pi N
25.0
0.25
0.25
1.25
5.0
0.05
0.30
0.25
40.0
0.40
0.70
2.00
10.0
0.10
0.80
0.50
20.0
0.20
1.00
1.00
EXAMPLE
Let us consider a simple can design problem
A cylindrical can is considered to have only
hmin h hmax
EXAMPLE.contd
Suppose (d,h) = (8,10)
Chromosome = 01000 01010
Natural chromosomes are made up of many
EXAMPLE.contd
A value of 0 at this bit allows the can to have
TOURNAMENT
SELECTION
In tournament selection, tournaments are
TOURNAMENT SELECTIONcontd
Using a similar argument, the worst solution
TOURNAMENT SELECTIONcontd
TOURNAMENT SELECTIONcontd
STOCHASTIC UNIVERSAL
SELECTION
In SUS only one random number r is chosen
CROSSOVER
After reproduction the crossover operator is implemented. The
30
CROSSOVER.CONTD
For example, if two design vectors (parents), each with a string length of 10, are given
by
(Parent 1) = {0 1 0 | 1 0 1 1 0 1 0 0 1}
(Parent 2) = {1 1 0 | 0 0 1 0 1 1 1 0 1}
The result of crossover, when the crossover site is at 3 is given by
(Child 1) = {0 1 0 | 0 0 1 0 1 1 1 0 1}
(Child 2) = {1 1 0 | 1 0 1 1 0 1 0 0 1}
Since the crossover operator combines substrings from parent strings (which have
good fitness values), the resulting child strings created are expected to have better
fitness values provided an appropriate (suitable) crossover site is selected.
The child strings generated using a random crossover site may or may not be as good
2/18/16
31
CROSSOVER.CONTD
If the child strings created are worse than their parent strings, it should
not be of much concern to the success of the GAs because the bad child
strings will not survive very long as they are less likely to be selected in
the next reproduction stage (because of the survival-of-the-fittest
strategy used)
The effect of crossover may be useful or detrimental. Hence it is desirable
not to use all the strings of the mating pool in crossover but to preserve
some of the good strings of the mating pool as part of the population in
the next generation.
If pc is the crossover probability 100 pc percent of the strings in the
mating pool will be used in the crossover operator while 100 (1 pc)
percent of the strings will be retained as they are in the new generation
(of population)
2/18/16
32
n-point crossover
Choose n random crossover points
Split along those points
Glue parts, alternating between parents
Uniform crossover
Assign 'heads' to one parent, 'tails' to the
other
Flip a coin for each gene of the first child
Make an inverse copy of the gene for the
second child
MUTATION
The mutation operator is applied to the new strings with a
random along the string length and the binary digit at that site
is then changed from 1 to 0 or 0 to 1 with a probability of pm
A random number between 0 and 1 is generated/chosen. If the
35
MUTATION.CONTD
As an example consider the following population of size n = 5 with a
string length 10
1000100011
1011110100
1100001101
1011010010
1110001001
Here all the five strings have a 1 in the position of the first bit.
2/18/16
36
START
1. Create initial random population
2. Set Max. Generation counter
3. Set Generation counter = 1
Evaluate fitness of each string in
population
Create mating pool and find the
number of copies of each string to
be copied to mating pool using
any selection method
Perform crossover and mutation
Generate new population
Increment gen count by one
YES
Is Generation
counter <
Max. gen.?
NO
STOP
2/18/16
37
AN EXAMPLE BASED ON
GA
The objective is to minimize the function
Examplecontd
Example.contd
Average fitness of population = 0.008
Maximum fitness = 0.024
Expected count = String fitness/Average fitness
(For first string , expected count = 0.001/0.008 = 0.13)
Probability of selection = Expected count/pop size
(For first string , selection probab = 0.13/20 = 0.007 )
The inferior points have been probabilistically eliminated
Example.contd
The average fitness of the new population is
Example.contd
representation of individuals
Notation (schema)
{0,1,#} is the symbol alphabet, where # is
Notation (order)
The order of the schema S (denoted by o(S)) is the
Notation (defining
length)
The defining length of schema S (denoted by (S)) is
for S2 = [##1#1010],
(H1) = 4 1 = 3,
(H2) = 8 3 = 5
Growth of Schema
The growth of schema in one iteration of GA is
Example
Let us apply GA for one cycle to a numerical
maximization problem
Maximize
:sin(x)
Variable bounds
:0x
We will use 5 bit strings to represent variable
x in the range of [0, ], so that string (00000)
represents x=0 and string (11111) represents
x=
We will use pc = 1 and pm = 0 for simplicity
Example
String
DV
f(x)
fi/favg
AC
Mating
pool
01001
0.912
0.791
1.39
01001
10100
20
2.027
0.898
1.58
10100
00001
0.101
0.101
0.18
10100
11010
26
2.635
0.485
0.85
11010
Examplecontd
Mating
pool
CS
point
String
DV
after CS
f(x)
01001
01000
0.811
0.725
10100
10101
21
2.128
0.849
10100
10010
18
1.824
0.968
11010
11100
28
2.838
0.299
Examplecontd
Let us consider schema H1 = (1 0 * * * ) and
schema H2 = (0 0 * * * )
For schema H1
m (H,t+1) (1) ( 0.898/0.569 ) [1 1.0/(5 1)) 0.0(2)] = 1.184
0.133
Building blocks of GA
The schema H1 for the above example has
Building blocks of GA
Note that H2 is short and low order, it is not an above