0% found this document useful (0 votes)
48 views56 pages

E C: A O: Volutionary Omputations N Verview

This document provides an overview of evolutionary computations and summarizes key points about genetic algorithms. Evolutionary computation uses computational models of evolutionary processes like inheritance, mutation, and selection as elements in problem solving systems. Genetic algorithms are a type of evolutionary algorithm that mimic biological evolution to find optimal or near-optimal solutions to problems by evolving initial populations using mechanisms like selection, crossover, and mutation. The document outlines the representation of solutions as chromosomes, defines the fitness function, and describes the roulette wheel selection process to select parents for reproduction in genetic algorithms.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views56 pages

E C: A O: Volutionary Omputations N Verview

This document provides an overview of evolutionary computations and summarizes key points about genetic algorithms. Evolutionary computation uses computational models of evolutionary processes like inheritance, mutation, and selection as elements in problem solving systems. Genetic algorithms are a type of evolutionary algorithm that mimic biological evolution to find optimal or near-optimal solutions to problems by evolving initial populations using mechanisms like selection, crossover, and mutation. The document outlines the representation of solutions as chromosomes, defines the fitness function, and describes the roulette wheel selection process to select parents for reproduction in genetic algorithms.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 56

EVOLUTIONARY COMPUTATIONS: AN OVERVIEW

Pravat Kumar Rout


Department of Electrical and Electronics
ITER, SOA University

WHY EVOLUTIONARY COMPUTATION

Exact Mathematical Expression


Derivative Free
Global Optimization

EVOLUTIONARY COMPUTATION

It is a Computer-based problem solving


systems that use computational models of
evolutionary processes as the key elements in
the design and implementations.
Evolution A process that results in heritable
changes in a population spread over many
generations.

TYPES

Evolutionary Algorithms:

Genetic Algorithms, Genetic Programming,


Evolutionary Programming, Genetic
Strategy etc.

Swarm Intelligence
Particle Swarm Optimization, Ant
Colony Optimization etc.

TYPE-I EVOLUTIONARY ALGORITHMS

An evolutionary algorithm is a subset of


evolutionary computation, a generic populationbased meta-heuristic optimization algorithm.
An EA uses some mechanisms inspired by
biological evolution : reproduction, mutation,
recombination and selection.

TYPE:II SWARM INTELLIGENCE

Swarm Intelligence is a type of artificial


intelligence based on the collective behavior of
decentralized , self-organized systems.

GENETIC ALGORITHM
It

is a search technique used in computing to find


exact or approximate solutions to optimization and
search problems.
Genetic

Algorithms are categorized as global


search heuristics.
a

particular class of evolutionary algorithms (also


known as evolutionary computation) that use
techniques inspired by evolutionary biology such as
inheritance, mutation, selection, and crossover (also
called recombination).

WHAT IS GENETIC ALGORITHMS?


Inverted by Prof. John Holland at the university of Michigan in 1975
A genetic algorithm (or short GA) is a search technique used in
computing to find true or approximate solutions to optimization and
search problems.
It uses two basic processes from evolution: inheritance(passing of
features from one generation to next) and competition ,survival of the
fittest (weeding out the bad features from individuals in the
populations).

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

WHY GENETIC ALGORITHMS


A Robust Search Technique
Suitable for parallel processing
Can use a noise fitness function
Fairly simple to develop
GAs will produce "close" to optimal results in a "reasonable"
amount of time.
Probability and randomness are essential parts of GA
They are adaptive and learn from experience

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

Maximum and minimum of a smooth


function is reached at a stationary
point where its gradient vanishes.

Optimization is Everywhere

The more we know about something, the more we


see where optimization can be applied.
Some personal decision making

- Finding fastest route home or class


- Optimal allocation of time for home work
- Optimal budgeting

Goal of Optimization

Find values of the variables that


minimize or maximize the objective
function
while
satisfying
the
constraints.

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

and 4.1 x2 5.8

17

CONTINUE: PROBLEM

If the optimization problem is to minimize a function f, this is


equivalent to maximizing a function g, where g = -f e.g

min f(x) = max g(x) = max {-f(x)}


or
min f(x) = max g(x) = max (1/f(x))

18

STEP:1 REPRESENTATION
Assume
The

the required precision for each variable is upto four decimal places.

variable x1 has length 15.1 e.g [12.1 3.0]

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.

217< 151000 <218

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

total length of a chromosome(solution vector) is then 18+15 = 33 bits, the first


18 bits code x1 and remaining 15 bits code x2.
010001001011010000111110010100010
Example

010001001011010000 represents
x1 = -3.0 + decimal(010001001011010000).

(12.1-(-3.0))/(218 -1)

= -3.0 + 70352.(15.1)/( 262143)

= -3.0 + 4.052426 = 1.052426.

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

STEP-3: FITNESS FUNCTION EVALUATION

Decode each chromosome and calculate the fitness function values


from (x1, x2) values just decoded

Eval(v1)

= f(6.084492, 5.652242) = 26.019600 ;


Eval(v2) = f(10.348434, 4.380264) = 7.580015 ;
Eval(v3) = f(-2.516603, 4.390381) =19.526329 ;
Eval(v4) = f(5.278638, 5.593460) = 17.406725;
Eval(v5) = f( -1.255173, 4.734458) = 25.341160 ;

27

CONTINUE: FITNESS FUNCTION


Eval(v6) = f( -1.811725,4.391937) =18.100417 ;
Eval(v7) = f( -0.991471, 5.680258) = 16.020812 ;
Eval(v8) = f(4.910618, 4.703018) = 17.959701 ;
Eval(v9) = f(0.795406, 5.381472) = 16.127799 ;
Eval(v10) = f( -2.554851, 4.793707) =21.278435 ;
Eval(v11) = f(3.130078, 4.996097) = 23.410669 ;
Eval(v12) = f(9.356179, 4.239457) = 15.0111619 ;
Eval(v13) = f(11.134646, 5.378671) = 27.316702 ;
Eval(v14) = f(1.335944, 5.151378) = 19.876294 ;
28

CONTINUE: FITNESS FUNCTION


Eval(v15)

= f(11.089025, 5.054515) = 30.060205;


Eval(v16) = f(9.211598, 4.993762) = 23.867227 ;
Eval(v17) = f(3.367514, 4.571343) = 13.696165;
Eval(v18) = f(3.843020, 5.158226) = 15.414128 ;
Eval(v19) = f( -1.746635, 5.395584) = 20.095903 ;
Eval(v20) = f(7.935998, 4.757338) = 13.666916 ;

Now among all the chromosome v15 is the strongest and v2 the
weakest

29

STEP-4: ROULETTE WHEEL SELECTION PROCESS


Selection determines, which individuals are chosen for mating
(recombination) and how many offspring each selected individual
produces.
Type: roulette-wheel selection, stochastic universal sampling, local
selection, truncation selection, tournament selection.
Calculate the fitness value eval(Vi) for each chromosome Vi(
i=1,2,.pop_size).
Find the total fitness of the population
F = eval(Vi)

30

CONTINUE: ROULETTE WHEEL


Calculate the probability of a selection pi for each chromosome Vi
(I,2,pop_size).
pi = eval(Vi)/ F
Calculate the cumulative probability qi
for each chromosome Vi(I = 1,2, pop_size);
qi = pj where j varies from 1 to i
Generate a random (float) number r from the range [0..1]
If r<q1then select the first chromosome(v1); otherwise select the ith
chromosome
Vi (2 i pop_size) such that q i-1 < r qi.

31

CONTINUE: ROULETTE WHEEL


Example:
Total fitness value
F = eval(Vi) where
i from 1 to 20
= 387.776822
The probability of selection pi for each chromosome Vi(i =
1,2pop_size)

p1 = eval(v1)/ F = 0.067099 ;
p2 = eval(v2)/ F = 0.019547;
p3 = eval(v3)/ F = 0.050355;

32

CONTINUE: ROULETTE WHEEL


p4

= 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

CONTINUE: ROULETTE WHEEL


p13

= 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

CONTINUE: ROULETTE WHEEL

The cumulative probabilities qi for each chromosome vi (I =


1,2,pop_size) are:

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

CONTINUE: ROULETTE WHEEL

Let us assume that a (random) sequence of 20 numbers from the


range[0..1]is:

0.513870 0.175741 0.308652 0.534534

0.947628

0.171736 0.702231 0.226431 0.494773 0.424720


0.703899 0.389647 0.277226 0.368071 0.983437

0.005398 0.765682 0.646473 0.767139 0.780237

36

CONTINUE: ROULETTE WHEEL


The first r = 0.513870 is greater than q10 and smaller than q11,
meaning the chromosome v11 is selected for the new population
The second r = 0.175741 is greater than q3 and smaller than q4,
meaning the chromosome v4 is selected for the new population

37

CONTINUE: ROULETTE WHEEL


V1n=(011001111110110101100001101111000)(v11);
V2n=(100011000101101001111000001110010)(v4);
V3n=(001000100000110101111011011111011)(v7);
V4n=(011001111110110101100001101111000)(v11);
V5n=(000101010011111111110000110001100)(v19);
V6n=(100011000101101001111000001110010)(v4);
V7n=(111011101101110000100011111011110)(v15);
V8n=(000111011001010011010111111000101)(v5);
V9n=(011001111110110101100001101111000)(v11);
V10n=(000010000011001000001010111011101)(v3);
38

CONTINUE: ROULETTE WHEEL


V11n=(111011101101110000100011111011110)(v15);
V12n=(010000000101100010110000001111100)(v9);
V13n=(000101000010010101001010111111011)(v6);
V14n=(100001100001110100010110101100111)(v8);
V15n=(101110010110011110011000101111110)(v20);
V16n=(100110100000001111111010011011111)(v1);
V17n=(000001111000110000011010000111011)(v10);
V18n=(111011111010001000110000001000110)(v13);
V19n=(111011101101110000100011111011110)(v15);
V20n=(110011110000011111100001101001011)(v16);
39

STEP-5:RECOMBINATION(CROSSOVER )
Recombination

produces new individuals in combining the information contained in


the parents (parents - mating population).

Type: Discrete recombination


Real valued recombination,
Binary valued recombination,

single-point / double-point /multi-point


crossover,
uniform crossover, shuffle
crossover, crossover with reduced
surrogate,

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.

Generate a random(float) number r from the range[0..1]

If r<Pc, select the given chromosome for crossover

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

0.822951 0.151932 0.625477 0.314685 0.346901


0.917204 0.519760 0.401154 0.606758 0.785402
0.031523 0.869921 0.166525 0.674520 0.758400
0.581893 0.389248 0.200232 0.355635 0.826927
Here v2n, v11n, v13n, and v18n are selected for crossover

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:

Mutation operator for real valued variables


Mutation for binary valued variables

47

CONTINUE: MUTATION

Mutation is performed bit-by-bit basis

Assume the probability of Mutation Pm.

This probability gives us the expected number of mutated bits


Pm* pop_size.
Generate a random(float) number r from the range[0..1]
If r<Pm, mutate the bit

48

CONTINUE: MUTATION
Example:
Let

the probability of Mutation Pm = 0.01. This indicates


1% of bits would undergo Mutation. Here 0.01* 33*20 =
6.6 number of bits will be mutated
Let
Bit position
Random Number
112
0.000213
349
0.009945
418
0.008809
429
0.005425
602
0.002836
49

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

STEP-7: EVALUATION OF RESULT

Decode each chromosome and calculate the fitness function values


from <x1, x2> values just decoded

Eval(v1)

= f(3.130078, 4.996097) = 23.410669;


Eval(v2) = f(5.279042, 5.054515) = 18.201083;
Eval(v3) = f(-0.991471, 5.680258) = 16.020812 ;
Eval(v4) = f(3.128235, 4.996097) = 23.412613;
Eval(v5) = f( -1.746635, 5.395584) = 20.095903;

53

CONTINUE:

EVALUATION OF RESULT

Eval(v6) = f( 5.278638,5.593460) =17.406725 ;


Eval(v7) = f( 11.089025, 5.054515) = 30.060205 ;
Eval(v8) = f(-1.255173, 4.734458) = 25.341160;
Eval(v9) = f(3.130078, 4.996097) = 23.410669 ;
Eval(v10) = f( -2.516603, 4.390381) =19.526329 ;
Eval(v11) = f(11.088621, 4.743434) = 33.351874 ;
Eval(v12) = f(0.795406, 5.381472) = 16.127799 ;
Eval(v13) = f(-1.811725, 4.209937) = 22.692462 ;
Eval(v14) = f(4.910618, 4.703018) = 17.959701 ;
54

CONTINUE:

EVALUATION OF RESULT

Eval(v15)

= f(7.935998, 4.757338) = 13.666916;


Eval(v16) = f(6.084492, 5.652242) = 26.019600 ;
Eval(v17) = f(-2.554851, 4.793707) = 21.278435;
Eval(v18) = f(11.134646, 5.666976) = 27.591064 ;
Eval(v19) = f( 11.059532, 5.054515) = 27.608441 ;
Eval(v20) = f(9.211598, 4.993762) = 23.867227 ;

55

CONTINUE:

EVALUATION OF RESULT

The total fitness of the new population is f = 447.049688, much higher


than the total fitness of the previous population 387.776822

The best chromosome now v11 has a better evaluation 33.351874 than
the best chromosome v15 from the previous population(30.060205)

56

You might also like