Real Coded Genetic Algorithm
Real Coded Genetic Algorithm
ALGORITHM
Population Size, Np
Crossover probability, pc
Mutation probability, pm
Distribution index for crossover, etac
Distribution index for mutation, etam
Number of variables, D
Lower and upper bounds for each variable, lb(1:D) & ub(1:D)
Number of iterations, T
PSEUDOCODE for real coded GA
INPUT: Fitness function, lb, ub, Np, T, Pc, Pm, ŋc, ŋm, k
1. Initialize a random population, P
2. Evaluate fitness(f) of P
for t = 1 to T
Perform Tournament selection of tournament size, k
for i = 1 to Np/2
Randomly choose two parents
if r<Pc
Generate two offspring using SBX-Crossover
Bound the offspring
else
Copy the selected parent as offspring
end
end
Pseudocode continued..
for i = 1 to Np
if r<Pm
Perform polynomial mutation of ith offspring
Bound the mutated offspring
else
No change in the ith offspring
end
end
Evaluate the fitness of offspring
Combine population and offspring to perform (mu + lambda) strategy.
end
SBX Crossover(if rc<pc)
Generate a random number ‘u(j)’ for each variable ‘j’ that needs to be optimized.
Compute beta (for each variable):
According to the different beta values obtained for each variable ‘j’, if Pa’ = Parent 1 & Pb’ = Parent 2, then Offspring 1 and Offspring 2
are to be calculated as:
where
Oa = Offspring1
Ob = Offspring 2
The two offspring are symmetric about the parents to avoid any bias.
Polynomial Mutation(if rm<pm)
Generate a random number ‘r(j)’ for each variable ‘j’ that needs to be optimized.
Compute delta (for each variable):
Taking different delta, upper bound and lower bound values for each variable one by one.
When r = 0, delta = -1 & when r = 1, delta = 1; these are respectively the boundary values for delta. Hence delta
ranges from [-1,1].
THANK YOU!
Important aspects to remember