E C: A O: Volutionary Omputations N Verview
E C: A O: Volutionary Omputations N Verview
EVOLUTIONARY COMPUTATION
TYPES
Evolutionary Algorithms:
Swarm Intelligence
Particle Swarm Optimization, Ant
Colony Optimization etc.
GENETIC ALGORITHM
It
Goldberg
"They combine survival of the fittest among string
structures
with
a structured
yet randomized
information exchange to form a search algorithm with
some of the innovative flair of human search. In
every generation, a new set of artificial creatures
(strings) is created using bits and pieces of the fittest
of the old; an occasional new part is tried for good
measure. While randomized, genetic algorithms are
no simple random walk. They efficiently exploit
historical information to speculate on new search
points with expected improved performance."
10
11
PSEUDO-CODE ALGORITHM
OF GENETIC ALGORITHM
1:Choose initial population
2: Evaluate the fitness of each individual in the
population
3:Repeat
1: Select best-ranking individuals to reproduce
2: Breed new generation through crossover and
mutation (genetic operations) and give birth
to
offspring
3: Evaluate the individual fatnesses of the offspring
4: Replace worst ranked part of population with
offspring
4:Until <terminating condition>
12
Calculus
Optimization is Everywhere
Goal of Optimization
MATHEMATICAL FORMULATION OF
OPTIMIZATION PROBLEMS
minimize the objective function
min f ( x), x x1 , x2 ,......., xn
subject to constraints
ci ( x) 0
Example
ci x 0
2
2
min x1 2 x2 1
subject: x12 x2 2 0
x1 x2 2
PROBLEM
Maximize
F(x1, x2) = 21.5 + x1*sin(4* *x1)
+ x2*sin(20* *x2);
Where
3.0 x1 12.1
17
CONTINUE: PROBLEM
18
STEP:1 REPRESENTATION
Assume
The
the required precision for each variable is upto four decimal places.
The precision requirement implies that the range[-3.0, 12.1] should be divided into
at least 15.1*10000 equal size ranges.
This
means that 18 bits are required for the first part of the chromosome.
19
CONTINUE: REPRESENTATION
The domain of variable x2 has length 1.7 e.g.[5.8-4.1]
The precision requirement implies that the range [4.1, 5.8] should
be divided into at least 1.7*10000 equal size ranges.
This means that 15 bits are required as the second part of the
chromosome.
214< 17000 <215
20
CONTINUE:REPRESENTATION
The
010001001011010000 represents
x1 = -3.0 + decimal(010001001011010000).
(12.1-(-3.0))/(218 -1)
21
CONTINUE: REPRESENTATION
The next 15 bits 111110010100010 represents
x2 = 4.1 + decimal(111110010100010 ).
(5.8-(4.1))/(215 -1)
= 4.1 + 31906(1.7)/(32767)
= 4.1 + 1.655330 = 5.755330.
So the Chromosome
(010001001011010000111110010100010)
Corresponds to
<x1,x2> = <1.052426, 5.755330>;
22
CONTINUE: REPRESENTATION
The fitness value for this chromosome is
F(1.052426, 5.755330) = 20.252640.
23
STEP-2 POPULATION
Let us assume a population size of
pop_size = 20 chromosomes. All 33 bits in all chromosomes are
initialized randomly.
Let the populations are
V1 = (100110100000001111111010011011111);
V2 = (111000100100110111001010100011010);
V3 = (000010000011001000001010111011101);
V4 = (100011000101101001111000001110010);
V5 = (000111011001010011010111111000101);
24
CONTINUE: POPULATION
V6=
(000101000010010101001010111111011);
V7= (001000100000110101111011011111011);
V8= (100001100001110100010110101100111);
V9= (010000000101100010110000001111100);
V10=(000001111000110000011010000111011);
V11=(011001111110110101100001101111000);
V12=(110100010111101101000101010000000);
V13=(111011111010001000110000001000110);
V14=(010010011000001010100111100101001);
V15=(111011101101110000100011111011110);
25
CONTINUE: POPULATION
V16= (110011110000011111100001101001011);
V17= (011010111111001111010001101111101);
V18= (011101000000001110100111110101101);
V19= (000101010011111111110000110001100);
V20= (101110010110011110011000101111110);
26
Eval(v1)
27
Now among all the chromosome v15 is the strongest and v2 the
weakest
29
30
31
p1 = eval(v1)/ F = 0.067099 ;
p2 = eval(v2)/ F = 0.019547;
p3 = eval(v3)/ F = 0.050355;
32
= eval(v1)/ F = 0.044889;
p5 = eval(v5)/ F = 0.065350;
p6 = eval(v6)/ F = 0.046677;
p7 = eval(v7)/ F = 0.041315;
p8 = eval(v8)/ F = 0.046315;
p9 = eval(v9)/ F = 0.041590;
p10 = eval(v10)/ F = 0.054873;
p11 = eval(v11)/ F = 0.060372;
p12 = eval(v12)/ F = 0.038712;
33
= eval(v13)/ F = 0.070444;
p14 = eval(v14)/ F = 0.051257;
p15 = eval(v15)/ F = 0.077519;
p16 = eval(v16)/ F = 0.061549;
p17 = eval(v17)/ F = 0.035320;
p18 = eval(v18)/ F = 0.039750;
p19 = eval(v19)/ F = 0.051823;
p20 = eval(v20)/ F = 0.035244;
34
q1 = 0.067099
q2 = 0.086647 q3 = 0.137001
q4= 0.181890
q5=0.247240
q6= 0.293917
q7=0.335232
q8=0.381546
q9= 0.423137
q10=0.478009
q11=0.538381 q12=0.577093
q13= 0.647537 q14 = 0.698794 q15= 0.776314
q16=0.837863 q17=0.873182 q18= 0.912932
q19=0.964756 q20 = 1.00000
35
0.947628
36
37
STEP-5:RECOMBINATION(CROSSOVER )
Recombination
40
CONTINUE: CROSSOVER
Assume the probability of crossover Pc.
This probability gives us the expected number Pc* pop_size of
chromosomes which undergo the crossover operation.
41
CONTINUE: CROSSOVER
Example:
Let us consider the Pc as 0.25. We can expect 25% of
chromosomes(e.g. 5 out of 20) undergo crossover.
Finding 20 random number as follows
42
CONTINUE: CROSSOVER
Assume the position of the crossing point for crossover. Let pos= 9
First pair
V2n =(100011000101101001111000001110010)
V11n=(111011101101110000100011111011110)
By interchanging the bits after the 9th position and creating
two offspring as
V2nn =(100011000101110000100011111011110)
V11nn=(111011101101101001111000001110010)
43
CONTINUE: CROSSOVER
Second pair
Assume the position of the crossing point for crossover. Let pos=
20
V13n=(000101000010010101001010111111011)
V18n =(111011111010001000110000001000110)
By interchanging the bits after the 9th position and creating
two offspring as
V13nn =(000101000010010101000000001000110)
V18nn =(111011111010001000111010111111011)
44
CONTINUE: CROSSOVER
V1n=(011001111110110101100001101111000)
V2nn =(100011000101110000100011111011110)
V3n=(001000100000110101111011011111011)
V4n=(011001111110110101100001101111000)
V5n=(000101010011111111110000110001100)
V6n=(100011000101101001111000001110010)
V7n=(111011101101110000100011111011110)
V8n=(000111011001010011010111111000101)
V9n=(011001111110110101100001101111000)
V10n=(000010000011001000001010111011101)
45
CONTINUE: CROSSOVER
V11nn=(111011101101101001111000001110010)
V12n=(010000000101100010110000001111100)
V13nn =(000101000010010101000000001000110)
V14n=(100001100001110100010110101100111)
V15n=(101110010110011110011000101111110)
V16n=(100110100000001111111010011011111)
V17n=(000001111000110000011010000111011)
V18nn =(111011111010001000111010111111011)
V19n=(111011101101110000100011111011110)
V20n=(110011110000011111100001101001011)
46
STEP-6: MUTATION
After recombination every offspring undergoes mutation. Offspring variables are
mutated by small perturbations (size of the mutation step), with low probability. The
representation of the variables determines the used algorithm.
Type:
47
CONTINUE: MUTATION
48
CONTINUE: MUTATION
Example:
Let
CONTINUE: MUTATION
Translating the bit position into chromosome number and the bit
number within the chromosome
Bit
Chromosome Bit number
position Number
within chromosome
112
4
13
349
11
19
418
13
22
429
13
33
602
19
8
50
CONTINUE: MUTATION
V1n=(011001111110110101100001101111000)
V2nn =(100011000101110000100011111011110)
V3n=(001000100000110101111011011111011)
V4n=(011001111110010101100001101111000)
V5n=(000101010011111111110000110001100)
V6n=(100011000101101001111000001110010)
V7n=(111011101101110000100011111011110)
V8n=(000111011001010011010111111000101)
V9n=(011001111110110101100001101111000)
V10n=(000010000011001000001010111011101)
51
CONTINUE: MUTATION
V11nn=(111011101101101001011000001110010)
V12n=(010000000101100010110000001111100)
V13nn =(000101000010010101000100001000111)
V14n=(100001100001110100010110101100111)
V15n=(101110010110011110011000101111110)
V16n=(100110100000001111111010011011111)
V17n=(000001111000110000011010000111011)
V18nn =(111011111010001000111010111111011)
V19n=(111011111101110000100011111011110)
V20n=(110011110000011111100001101001011)
52
Eval(v1)
53
CONTINUE:
EVALUATION OF RESULT
CONTINUE:
EVALUATION OF RESULT
Eval(v15)
55
CONTINUE:
EVALUATION OF RESULT
The best chromosome now v11 has a better evaluation 33.351874 than
the best chromosome v15 from the previous population(30.060205)
56