Mutation Algorithms for Real-Valued Parameters (GA)
Last Updated :
11 Mar, 2024
Genetic Algorithms(GAs) are adaptive heuristic search algorithms that belong to the larger part of evolutionary algorithms. In each generation chromosomes(our solution candidates) undergo mutation and crossover and selection to produce a better population whose chromosomes are nearer to our desired solution. Mutation Operator is a unary operator and it needs only one parent to work on. It does so by selecting a few genes from our selected chromosome (parent) and then by applying the desired mutation operator on them.
In this article, I will be talking about four Mutation Algorithms for real-valued parameters –
1) Uniform Mutation
2) Non-Uniform
3) Boundary Mutation
4) Gaussian Mutation
Here ,we are considering a chromosome with n real numbers (which are our genes) and xi represents a gene and i belongs to [1,n].
Uniform Mutation –
In uniform mutation we select a random gene from our chromosome, let’s say xi and assign a uniform random value to it.
Let xi be within the range [ai,bi] then we assign U(ai,bi) to xi
U(ai,bi) denotes a uniform random number from within the range [ai,bi].
Algorithm –
1. Select a random integer number i from [1,n]
2. Set xi to U(ai,bi).
Boundary Mutation –
In boundary mutation we select a random gene from our chromosome , let’s say xi and assign the upper bound or the lower bound of xi to it.
Let xi be within the range [ai,bi] then we assign either ai or bi to xi.
We also select a variable r= U(0,1) ( r is a number between 0 and 1).
If r is greater than or equal to 0.5 , assign bi to xi else assign ai to xi.
Algorithm –
1. select a random integer number i form [1,n]
2. select a random real value r from (0,1).
3. If(r >= 0.5)
Set xi to bi
else
Set xi to ai
Non-Uniform Mutation –
In non-uniform mutation we select a random gene from our chromosome, let’s say xi and assign a non-uniform random value to it.
Let xi be within the range [ai,bi] then we assign a non-uniform random value to it.
We use a function,
f(G)=(r2*(1-G/Gmax))b ,
where r2 = a uniform random number between (0,1)
G = the current generation number
Gmax = the maximum number of generations
b = a shape parameter
Here we select a uniform random number r1 between (0,1).
If r greater than or equal to 0.5 we assign (bi-xi) * f(G) to xi else we assign (ai+ xi) * f(G).
Algorithm –
1. Select a random integer i within [1,n]
2. select two random real values r1 ,r2 from (0,1).
3. If(r1 >= 0.5)
Set xi to (bi-xi) * f(G)
else
Set xi to (ai+ xi) * f(G)
Gaussian Mutation –
Gaussian Mutation makes use of the Gauss error function . It is far more efficient in converging than the previously mentioned algorithms. We select a random gene let’s say xi which belongs to the range [ai,bi]. Let the mutated off spring be x’i. Every variable has a mutation strength operator (σi). We use σ= σi/(bi-ai) as a fixed non-dimensionalized parameter for all n variables;
Thus the offspring x’i is given by —
x’i= xi + √2 * σ * (bi-ai)erf-1(u’i)
Here erf() denotes the Gaussian error function.
erf(y)=2⁄√π ∫y0 e-t2 dt
For calculation ui’ we first select a random value ui from within the range (0,1) and then use the following formula
if(ui>=0.5)
u’i=2*uL*(1-2*ui)
else
u’i=2*uR*(2*ui-1)
Again uL and uR are given by the formula
uL=0.5(erf( (ai-xi)⁄(√2(bi-ai)σ) )+1)
uR=0.5(erf( (bi-xi)⁄(√2(bi-ai)σ) )+1)
Similar Reads
Mutation Algorithms for String Manipulation (GA)
Genetic Algorithms(GAs) are adaptive heuristic search algorithms that belong to the larger part of evolutionary algorithms. In each generation chromosomes(our solution candidates) undergo mutation and crossover and then selection to produce a better population whose candidates are nearer to our desi
2 min read
Steady State Genetic Algorithm (SSGA)
Prerequisite - Genetic Algorithm SSGA stands for Steady-State Genetic Algorithm. It is steady-state meaning that there are no generations. It differs from the Simple Genetic Algorithm, as in that tournament selection does not replace the selected individuals in the population, and instead of adding
2 min read
Analysis of Algorithms | Big - Î (Big Theta) Notation
In the analysis of algorithms, asymptotic notations are used to evaluate the performance of an algorithm by providing an exact order of growth. This article will discuss Big - Theta notations represented by a Greek letter (Î). Definition: Let g and f be the function from the set of natural numbers t
6 min read
Traveling Salesman Problem using Genetic Algorithm
AuPrerequisites: Genetic Algorithm, Travelling Salesman ProblemIn this article, a genetic algorithm is proposed to solve the travelling salesman problem. Genetic algorithms are heuristic search algorithms inspired by the process that supports the evolution of life. The algorithm is designed to repli
15+ min read
ML - Convergence of Genetic Algorithms
Introduction: Genetic algorithms are probabilistic search optimization techniques, which operate on a population of chromosomes, representing potential solutions to the given problem.In a standard genetic algorithm, binary strings of 1s and 0s represent the chromosomes. Each chromosome is assigned a
2 min read
Simple Genetic Algorithm (SGA)
Prerequisite - Genetic Algorithm Introduction : Simple Genetic Algorithm (SGA) is one of the three types of strategies followed in Genetic algorithm. SGA starts with the creation of an initial population of size N.Then, we evaluate the goodness/fitness of each of the solutions/individuals. After tha
1 min read
Encoding Methods in Genetic Algorithm
Biological Background : Chromosome: All living organisms consist of cells. In each cell, there is the same set of Chromosomes. Chromosomes are strings of DNA and consist of genes, blocks of DNA. Each gene encodes a trait, for example, the color of the eye. Reproduction: During reproduction, combinat
3 min read
Boundary Value Analysis : Nature of Roots of a Quadratic equation
Consider a problem for the determination of the nature of the roots of a quadratic equation where the inputs are 3 variables (a, b, c) and their values may be from the interval [0, 100]. The output may be one of the following depending on the values of the variables: Not a quadratic equation,Real ro
12 min read
Runge-Kutta 4th Order Method to Solve Differential Equation
Given the following inputs, An ordinary differential equation that defines value of dy/dx in the form x and y.Initial value of y, i.e., y(0) Thus we are given below.[Tex]\frac{\mathrm{dy} }{\mathrm{d} x} = f(x, y),y(0)= y_o [/Tex]The task is to find the value of the unknown function y at a given poi
10 min read
SPSA (Simultaneous Perturbation Stochastic Approximation) Algorithm using Python
SPSA is an algorithm of optimisation invented by James C. Spall specially useful for noisy cost functions and the ones which the exact gradient is not available. The general Idea is to increase the quality of the answer by estimating the gradient of the cost functions and using it to update the para
6 min read