GA Optimisation
GA Optimisation
Algorithm (GA)
Jayeeta Mitra
Associate Professor
AGFE, IIT Kharagpur
• Gradient descent method is an iterative first order
optimization algorithm to find a local maxima/minima of a
given function. Commonly used in Machine learning (ML) and
Deep Learning (DL).
• Due to its importance and ease of implementation it is used
commonly in many applications including control engineering,
chemical, mechanical robotics etc.
• To use this function has to be
E = f (v, w); Δv = -η ; Δw = - η
differentiable and
convex
•
Optimisation
• Genetic algorithm is a population based probabilistic search
and optimization technique works on Darwin’s principle of
natural selection.
M = m1 + m2 + m3 +….
N = 1.65 + 20.21 M
Steps in GA
• Random generation of initial population string.
• calculate fitness value (objective function in case
of maximisation problem)of each solution in the
population.
• Let f(x) to be minimised, then we can have
maximisation objective function by the
following:
• Maximise –f(x) using duality principle
• Maximise 1/f(x), for f(x)≠0
• Maximise 1/(1+f(x)), for f(x) ≥ 0 etc.
GA Parameters
1Generation of GA Reproduction/selection
Fitness value
Crossover
Mutation
• Ranking selection:
• Let us assume 4 population-4 fitness values f1, f2, f3 and f4
contributes 80%, 10%, 7% and 3% of the total fitness
value.
• The strings are arranged in ascending order of their
fitness value. – f4, f3, f2, f1.
• Rank them. f4-1, f3-2, f2-3, f1-4
• Then proportionate selection scheme based on the
assigned rank is adopted.
Reproduction
• The % area tobe occupied by a particular string (ith ) is given
by the expression (Ri/∑R) x 100, Where Ri is the rank of ith
string.
• Thus the string f1, f2, f3 and f4 will occupy 40%, 30%, 20% and
10% of the total area respectively and consequently their
probabilities or being selected in the mating pool become
equal to 0.4, 0.3, 0.2 and 0.1. rank based proportionate
selection scheme is better than the fitness based proportionate
selection
Reproduction
• Tournament selection:
• N tournaments were played between the n population.
Each string selected for tournament twice but the
probability of their win may be o, 1 or two times based
on their fitness.
Vb =
Steps……contd.
4. M = ;N
8. xi = (Xi -XM)/XD
9. Yj = f (xi) =
Steps…….contd.
• The parameter c is the cost of can material per square cm, and
diameter d and height h are allowed to vary in [dmin, dmax] and
[hmin, hmax] cm, respectively.
• Represent the parameter values in binary strings.
• Let us assume that we shall use five bits to code each of the two
design parameters d and h, thereby making the overall string
length equal to 10.
• The following string represents a can of diameter 8 cm and height 10
cm,
• A value of 0 at this bit (the most significant bit) allows the can to have
diameter values in the range [0, 15] cm, whereas the other value 1
allows the can to have diameter values in the range [16, 31] cm.
• Clearly, this bit (or gene) is responsible for dictating the slimness of the
can
• Each bit position or combination of two or more bit positions can also
be explained to have some feature of the can, but some are interesting
and important and some are not that important.
• Now that we have achieved a string representation of design
solution, we are ready to apply some genetic operations to such
strings to hopefully find better and better solutions.
• Assigning fitness to a solution: In most cases, however, the fitness
is made equal to the objective function value. For example, the
fitness of the above can be represented by the 10-bit string is