Professional Documents
Culture Documents
Ga For Optimization: What Is Genetic Algorithms?
Ga For Optimization: What Is Genetic Algorithms?
Start
Production of the
individuals
Selection
Crossover and
Mutation
No
Gen ≤ Max.Gen
Yes
End
Figure 1.1
1. A genetic representation for potential solutions to the problem.
2. A way to create an initial population of potential solutions,
3. An evaluation function that plays the role of the environment, rating solutions in
terms of their “fitness”.
4. Genetic operators that alter the composition of children.
5. Values for various parameters that the genetic algorithm uses (population size,
probabilities of applying genetic operators, etc.).
Let us understand the working of genetic algorithms with the following examples;
Case 1
Figure 1.2 Plot of the function f(x) =x. sin (10π.x) + 1.0
Representation
In this case a binary vector (chromosome) has been considered to represent real
values of the variable x. The length of the vector depends on the required precision,
which, in this example, is six places after the decimal point.
The domain of the variable x has length 3; the precision requirement implies that
the range [-1...2] should be divided into at least 3.1000000 equal size ranges. This means
that 22 bits are required as a binary vector (chromosome):
2097152 = 221 <3000000 ≤ 222 =4194304.
The mapping from a binary string (b21 b20….. b0) into a real number x from the
range [-1 ...2] is straightforward and is completed in two steps:
• convert the binary string (b21 b20….. b0) from the base 2 to base 10 and equal to x’,
• find a corresponding real number:
x = -1.0 + x’. (3/222-1), (5)
where -1.0 is the left boundary of the domain and 3 is the length of the domain.
For example, a chromosome
(1000101110110101000111)
represent the number 0.637197, since
x’= (1000101110110101000111)2 = 2288967
and
x = -1.0 + 2288967. (3/4194303) = 0.637197.
Of course, the chromosomes (0000000000000000000000) and
(1111111111111111111111) represent boundaries of the domain, -1.0 and 2.0,
respectively.
Initial population
The initialization process is very simple: we create a population of
chromosomes, where each chromosome is binary vector of 22 bits. All 22 bits for each
chromosome are initialized randomly.
Evaluation function
Evaluation function eval for binary vectors v is equivalent to the function f:
eval (v) = f(x) (6)
where the chromosome ‘v’ represents the real value x.
As noted earlier, the evaluation function plays the role of the environment, rating
potential solutions in terms of their fitness. For example, three chromosomes:
v1= (1000101110110101000111),
v2= (0000001110000000010000),
v3= (1110000000111111000101),
Correspond to values x1 = 0.637197, x2 = -0.958973, and x3 = 1.627888,
respectively. Consequently, the evaluation function would rate them as follows:
eval (v1) = f(x1) = 1.586345,
eval (v2) = f(x2) = 0.078878,
eval (v3) = f(x3) = 2.250650.
Clearly, the chromosome v3 is the best of the three chromosomes, since its
evaluation returns the highest value.
Genetic operators
During the alteration phase of the genetic algorithm we would use two classical
genetic operators: mutation and crossover.
As mentioned earlier, mutation alters one or more genes (positions in a
chromosome) with a probability equal to the mutation rate. Assume that the fifth gene
from the v3 chromosome was selected for a mutation. Since the fifth gene in this
chromosome is 0, it would be flipped into 1. So the chromosome v3 after this mutation
would be
v3’ = (1110100000111111000101).
This chromosome represents the value x’3 = 1.721638 and f (x’3) = -0.082257.
This means that this particular mutation resulted in a significant decrease of the value of
the chromosome v3. then
v3” = (1110000001111111000101).
The corresponding value x”3 = 1.630818 and f (x”3) = 2.343555, an improvement
over the original value of f(x3) =2.250650.
Let us illustrate the crossover operator on chromosome v2 and v3. Assume that the
crossover point was (randomly) selected after the 5th gene:
v2= (0000001110000000010000),
v3= (1110000000111111000101).
The two resulting offspring are
v2’= (0000000000111111000101),
v3’= (1110001110000000010000).
These offspring evaluate to
f(v2’) = f(-0.998113) = 0.940865,
f(v3’) = f(1.666028) = 2.459245.
Note that the second offspring has a better evaluation than both of its parents.
Parameters
For this particular problem we have used the following parameters: population
size pop_size = 50, probability of crossover pc = 0.25, probability of mutation pm = 0.01.
The following section presents some experimental results for such a genetic system.
Results: Table 1.1
Generation
Evaluation function
number
1 1.441942
6 2.250003
8 2.250283
9 2.250284
10 2.250363
12 2.328077
39 2.344251
40 2.345087
51 2.738930
99 2.849246
137 2.850217
145 2.850227
Experimental results
We provide the generation number for which we noted an improvement in the
evaluation function, together with the value of the function. The best chromosome after
150 generations was
vmax = (1111001101000100000101),
which corresponds to value x max = 1.850773.
As expected, x max = 1.85 +ε, and f(x max) is slightly larger than 2.85.
Case 2
Assume that the population size pop-size = 20, and the probabilities of genetic
operators are pc = 0.25 and pm = 0.01.
Let us assume also that we maximize the following function (shown in figure
9.5):
f(x1,x2) = 21.5 + x1 . sin (4Πx1) +x2 . sin(20Πx2). (9.39)
where -3.0 ≤ x1 ≤ 12.1 and 4.1 ≤ x2 ≤ 5.8.
Figure 9.41 Plot of the function f(x1,x2) = 21.5 + x1 . sin (4Πx1) +x2 . sin(20Πx2).
Assume that after the initialization process we get the following population:
v1 = (100110100000001111111010011011111)
v2 = (111000100100110111001010100011010)
v3 = (000010000011001000001010111011101)
v4 = (100011000101101001111000001110010)
v5 = (000111011001010011010111111000101)
v6 = (000101000010010101001010111111011)
v7 = (001000100000110101111011011111011)
v8 = (100001100001110100010110101100111)
v9 = (010000000101100010110000001111100)
v10 = (000001111000110000011010000111011)
v11 = (011001111110110101100001101111000)
v12 = (110100010111101101000101010000000)
v13 = (111011111010001000110000001000110)
v14 = (010010011000001010100111100101001)
v15 = (111011101101110000100011111011110)
v16 = (110011110000011111100001101001011)
v17 = (011010111111001111010001101111101)
v18 = (011101000000001110100111110101101)
v19 = (000101010011111111110000110001100)
v20 = (101110010110011110011000101111110)
During the evaluation phase we denote each chromosome and calculate the fitness
function values from (x1,x2) values just decoded. We get:
Now the system constructs a roulette wheel for the selection process. The total
fitness of the population is
F = 387.776822.
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.837182
q18=0.912932
q19=0.964756
q20=1.000000
Now we are ready to spin the roulette wheel 20 times; each time we select a single
chromosome for a new population. Let us assume that a (random) sequence of 20
numbers from the range [0…1] is :
This means that the chromosomes v12, v111, v113, and v118 were selected for
crossover. Now we mate selected chromosomes randomly: say, the first two (i.e., v12 and
v111) and the next two ( i.e., v113, and v118) are coupled together. For each of these two
pairs, we generate a random integer number pos from the range [1…32] (33 is the total
length – number of bits- in a chromosome). The number pos indicates the position of the
crossing point .The first pairs of chromosomes is
And the generated number pos = 9. These chromosomes are cut after the 9th bit
and replaced by a pair of their offspring:
v11 = (011001111110110101100001101111000)
v112 = (100011000101110000100011111011110)
v13 = (001000100000110101111011011111011)
v14 = (011001111110110101100001101111000)
v15 = (000101010011111111110000110001100)
v16 = (100011000101101001111000001110010)
v17 = (111011101101110000100011111011110)
v18 = (000111011001010011010111111000101)
v19 = (011001111110110101100001101111000)
v110 = (000010000011001000001010111011101)
v1111 = (111011101101101001111000001110010)
v112 = (010000000101100010110000001111100)
v1113 = (000101000010010101000000001000110)
v114 = (100001100001110100010110101100111)
v115 = (101110010110011110011000101111110)
v116 = (100110100000001111111010011011111)
v117 = (000001111000110000011010000111011)
v1118 = (111011111010001000110000001000110)
v119 = (111011101101110000100011111011110)
v120 = (110011110000011111100001101001011)
The next operator, mutation, is performed on a bit- by –bit basis. The probability
of mutation pm = 0.01, so we expect that (on average) 1% of bits would undergo
mutation. There are m × pop-size = 33 × 20 = 660 bits in the whole population; we expect
(on average) 6.6 mutations per generation. Every bit has an equal chance to be mutated,
so, for every bit in the population, we generate a random number r from the range [0…1];
if r <0.01, we mutate the bit.
This means that we have to generate 660 random numbers. In a sample run, 5 of
these numbers were smaller than 0.01; the bit number and the random number are listed
below:
This means that the mutation operator affects 4 chromosomes; one of the
chromosomes (the 13th) has two bits changed.
The final population is listed below; the mutated bits are typed in boldface. We
drop primes for modified chromosomes; the population is listed as new vectors vi
v1 = (011001111110110101100001101111000)
v2 = (100011000101110000100011111011110)
v3 = (001000100000110101111011011111011)
v4 = (011001111110110101100001101111000)
v5 = (000101010011111111110000110001100)
v6 = (100011000101101001111000001110010)
v7 = (111011101101110000100011111011110)
v8 = (000111011001010011010111111000101)
v9 = (011001111110110101100001101111000)
v10 = (000010000011001000001010111011101)
v11 = (111011101101101001111000001110010)
v12 = (010000000101100010110000001111100)
v13 = (000101000010010101000000001000110)
v14 = (100001100001110100010110101100111)
v15 = (101110010110011110011000101111110)
v16 = (100110100000001111111010011011111)
v17 = (000001111000110000011010000111011)
v18 = (111011111010001000110000001000110)
v19 = (111011101101110000100011111011110)
v20 = (110011110000011111100001101001011)
We have just completed one iteration (i.e., one generation ) of the while loop in
the genetic procedure. It is interesting to examine the results of the evaluation process of
the new population. During the evaluation phase we decode each chromosome and
calculate the fitness function varies from (x1,x2) values just decoded. We get:
Note that the total fitness of the new population f is 447.049688, much higher
than total fitness of the previous population, 387.776822. Also, the best chromosome,
now (v11) has better evaluation (33.351874) than the best chromosome(v15) from the
previous population (30.060205). Now we are ready to run the selection process again
and apply the genetic operators, evaluate the next generation, etc. After 1000 generations
the population is :
v1 = (111011110110011011100101010111011)
v2 = (111001100110000100010101010111000)
v3 = (111011110111011011100101010111011)
v4 = (111001100010000110000101010111001)
v5 = (111011110111011011100101010111011)
v6 = (111001100110000100000100010100001)
v7 = (110101100010010010001100010110000)
v8 = (111101100010001010001101010010001)
v9 = (111001100010010010001100010110001)
v10 = (111011110111011011100101010111011)
v11 = (110101100000010010001100010110000)
v12 = (110101100010010010001100010110001)
v13 = (111011110111011011100101010111011)
v14 = (111001100110000100000101010111011)
v15 = (111001101010111001010100110110001)
v16 = (111001100110000101000100010100001)
v17 = (111001100110000100000101010111011)
v18 = (111001100110000100000101010111001)
v19 = (111101100010001010001110000010001)
v20 = (111001100110000100000101010111001)
However, if we look carefully at the progress during the run, we may discover
that in earlier generations the fitness values of some chromosomes were better than the
value 35.477938 of the best chromosome after 1000 generations. For example, the best
chromosome in generation 396 had value of 38.827553. This is due to the stochastic
errors of sampling. It is relatively easy to keep track of the best individual in the
evolution process. It is customary (in genetic algorithm implementations ) to store “the
best ever” individual at a separate location; in that way, the algorithm would report the
best value found during the whole process.
Example Problems
• Note: Round the number of bits to the next successive integer value (22)
Number of strings
Fitness value sorted Corresponding copied to the next
New Population of strings
in ascending order Binary strings generation
0.5217 0 0 0 1 0 1 1 1 0 0 0 0 1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 0 1 0 0 0 0 1 0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1 0 1 1 1 0 0 0 0
1.5096 1 0 1 1 1 0 0 1 1 1 0 0 1 0 0 0 0 1 1 0 0 0 0 1 1 1 0 0 0 0 1 1 1 0 0 1 0 1 1 1 0 0 0 0
1.6164 1 1 0 0 0 1 1 0 0 1 0 0 1 1 1 0 0 1 1 1 0 0 0 1 1 0 1 0 1 1 1 0 0 1 0 1 1 0 0 1 0 0 1 1
1.6715 1 1 1 0 1 0 0 0 0 0 1 1 1 0 1 1 0 1 1 1 1 0 0 1 1 0 1 0 1 1 1 0 0 1 0 1 1 0 0 1 0 0 1 1
1.8396 1 0 0 1 1 1 0 1 1 0 0 1 1 1 0 0 1 0 1 1 0 1 0 1 1 0 1 0 1 1 1 0 0 1 0 1 1 0 0 1 0 0 1 1
1.9469 1 1 1 0 0 1 0 0 0 0 0 1 0 1 1 0 0 0 1 1 1 0 0 1 1 1 0 0 0 1 1 1 1 0 1 0 1 0 1 0 0 0 1 1
2.1102 1 0 1 1 1 0 0 0 0 0 0 0 0 0 1 1 0 1 0 1 0 1 0 1 1 1 0 0 0 1 1 1 1 0 1 0 1 0 1 0 0 0 1 1
2.6500 1 1 1 0 0 0 1 0 0 0 1 0 1 1 1 0 1 1 1 0 1 1 0 1 1 1 0 0 0 1 1 1 1 0 1 0 1 0 1 0 0 0 1 1
2.9464 1 1 1 1 1 0 1 1 1 0 1 0 0 0 1 0 1 1 0 1 0 1 0 1 1 1 0 0 0 1 1 1 1 0 1 0 1 0 1 0 0 0 1 1
Generation 1
Best Objective value = 0.5217
X= -0.7300
g. Number of strings participating in crossover = Number of population *
Probability of crossover (1st ,2nd ,4th ,5th )
= 4 i.e., (20*0.20)
Two strings are chosen randomly
two times and single point random crossover is done.
1st & 2nd string crossed
4th & 5th string crossed
h. Number of bits to be mutated = Number of population * Bit length * Probability
of mutation
= 5 i.e., (20*22*0.01)
(Round 4.4 to next nearest integer)
The mutation positions randomly chosen in row/column wise
(16,2)-(3,14)-(15,6)-(2,20)-(1,21)
i.e., after crossover, select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0 0 1 1 1 0 0 1 0 1 1 1 0 0 0 0 0 1 1 1 0 0 0 0 1 1 1 0 0 1 0 1 1 1 0 0 0 0
0 1 1 1 0 0 0 0 1 1 1 0 0 1 0 1 1 1 0 0 0 0 0 1 1 1 0 0 0 0 1 1 1 0 0 1 0 1 1 1 0 0 0 0
0 1 1 0 1 0 1 1 1 0 0 1 0 1 1 0 0 1 0 0 1 1 0 1 1 0 1 0 1 1 1 0 0 1 0 1 1 0 0 1 0 0 1 1
0 1 1 0 1 0 1 1 1 0 0 1 0 1 1 0 0 1 0 0 1 1 0 1 1 0 1 1 1 1 1 0 0 1 0 1 1 0 0 1 0 0 1 1
0 1 1 0 1 0 1 1 1 0 0 1 0 1 1 0 0 1 0 0 1 1 0 0 1 0 1 0 1 1 1 0 0 1 0 1 1 0 0 1 0 0 1 1
0 1 1 1 0 0 0 1 1 1 1 0 1 0 1 0 1 0 0 0 1 1 0 1 1 1 0 0 0 1 1 1 1 0 1 0 1 0 1 0 0 0 1 1
0 1 1 1 0 0 0 1 1 1 1 0 1 0 1 0 1 0 0 0 1 1 0 1 1 1 0 0 0 1 1 1 1 0 1 0 1 0 1 0 0 0 1 1
0 1 1 1 0 0 0 1 1 1 1 0 1 0 1 0 1 0 0 0 1 1 0 1 1 1 0 0 0 1 1 1 1 0 1 0 1 0 1 0 0 0 1 1
0 1 1 1 0 0 0 1 1 1 1 0 1 0 1 0 1 0 0 0 1 1 0 1 1 1 0 0 0 1 1 1 1 0 1 0 1 0 1 0 0 0 1 1
i. The same procedure is repeated from (e to h) and the best fitness value so far
obtained and the corresponding value of the variable X is saved. After a
required number of generations the optimum value using GA is obtained. The
results and convergence will vary depending upon GA parameters.
Example 2. The figure shown below gives the mileage of the feasible links connecting
nine offshore natural gas wellheads with an inshore delivery point. Because the location
of well head 1 is the closest to shore; it is equipped with sufficient pumping and storage
capacity to pump the output of the remaining eight wells to the delivery point. Determine
the minimum pipeline network using GA that links the well heads to the delivery point.
(Shortest path problem)
Delivery point
5 1
2
20
6 7 4 14
9
6
10 5 5
3 20 13
15 5
4 8
12 7
3
Solution 7
7
Assumptions
Number of population =6 6
Probability of crossover =0.3
Probability of mutation =0.01
Number of generations = 1
a. Initialize integer population randomly such that the last digit ends with 1 since it
is the delivery point
(Here the well positions are represented by integer value. The problem is represented
by selecting the integer length to 9 with the opinion that the minimum pipe length
need not be represented with more wells. It is not necessary the suggested method is
the only way of representing the chromosomal strings the problem in hand)
Fitness value
If the string generated is not suitable or the pipes are not connected, then a penalty is
added with the objective value (Sum of the distance without interruption) depending
upon the minimum blockage in the network. More the interruption higher the penalty.
Here the penalty factor to be added with the objective value if there is one
interruption between the network sequence is 20 (Maximum distance between any of
the two wells)
Initial Objective value Fitness
Population (Without interruption) value
243765981 - 103
438697521 - 112
964327581 - 100
987564321 53 53
789564321 54 54
785324691 - 193
Two strings are chosen randomly one time and position – based crossover is done
2th & 4th string crossed (Note: Four random selected positions chosen, except the last
node)
4 3 8 6 9 7 5 2 1 Parent 1
9 8 7 5 6 4 3 2 1 Parent 2
9 3 8 6 7 4 5 2 1 Child 1
9 4 7 8 6 5 3 2 1 Child 2
e. The same procedure is repeated from (b to d) and the best fitness value so far
obtained and the corresponding network pipe sequence is saved. After a required
number of generations the optimum value using GA is obtained. The results and
convergence will vary depending upon GA parameters.
Example 3. Find the shortest highway route using any GA model between two cities. The
network in the figure below provides the possible routes between the starting city at node 1
and the destination city at node 8. The routes pass through intermediate cities designated by
nodes 2 to 5. (Shortest path problem).
12
2
11 5 11
7 7
8 9 8
8 14 6
1 3
9
5 6
10 10 7
13
4
Solution
Assumptions
Number of population =6
Probability of crossover =0.3
Probability of mutation =0.01
Number of generations = 1
a. The first and the last city position are always fixed as 1 & 8 for evaluation of
objective function. Only 2 city positions are possible between nodes 2 and 5. So the
binary population is initialized randomly representing 2 and 5. The problem is
represented by selecting the 6 binary bit lengths. (It is not necessary that the
suggested method is the only way of representing the chromosomal strings for the
problem in hand)
Fitness value
If the string generated is not suitable or the city nodes are not connected, then a
penalty is added with the objective value (Sum of the distance without interruption)
depending upon the minimum blockage in the transport network. More the
interruption higher the penalty. Here the penalty factor to be added with the objective
value if there is one interruption between the network sequence is 14 (Maximum
distance between any of the two city nodes)
Generation 1
= 1 (Round (6*6*0.01) to
next integer value)
The mutation position randomly chosen in row/column wise is (4, 6)
e. The same procedure is repeated from (b to d) and the best fitness value so far
obtained and the corresponding city node sequence is saved. After a required number
of generations the optimum value using GA is obtained. The results and convergence
will vary depending upon GA parameters.
REFERENCE
[1] “Artificial Intelligence and Intelligent Systems” N.P.Padhy “Oxford University Press”
First Edition 2005