Professional Documents
Culture Documents
Soumen Paul Department of Computer Science and Informatics Haldia Institute of Technology ICARE Complex, HIT Campus, P.O - HIT, PIN 721657 Haldia, West Bengal
Soumen Paul Department of Computer Science and Informatics Haldia Institute of Technology ICARE Complex, HIT Campus, P.O - HIT, PIN 721657 Haldia, West Bengal
Department of Computer
Science and Informatics
Haldia Institute of Technology
Search and optimization
Exploration
Definition of Genetic
Algorithm
The Genetic algorithm (GA) is a
randomized search and
optimization technique guided by
the principle of natural genetic
systems.
Recently, there has been a great
deal of interest in GAs and their
application to various engineering
fields.
Application of GA
The GA is being applied to a wide range of
optimization and learning problems in many
domains. GA is being applied to a wide range
of optimization and learning problems in many
domains. GA also lend themselves well to
power system optimization problems, since
there known to exibit robustness, require no
auxulliary, and can offer significant advantages
in solution methodology and optimization
performance.
Genetic Algorithm………
The main advantage of the GA
formulation is that fairly accurate
results may be obtained using a
very simple algorithm.
The objective of fitness function is
a judge of GA’s attempts. GAs do
not know how to derive a
problem’s solution, but they do
know, from the objective function,
how close they are to a better soln.
GA versus Conventional
Optimization and search
Procedure
Sometimes near optimal solutions
that can be generated quickly,
using GAs, are more desirable
than optimal solutions which
require a large amount of time.
Using GAs, problems can be
modelled as optimization
problems.
GA versus Conventional
Optimization and search
Procedure……….
GAs work with a coding of the
parameter set, not the parameters
themselves. Therefore they can
easily handle integral or discrete
variables.
GAs can provide globally optimum
solutions.
GA versus Conventional
Optimization and search
Procedure……….
GA use only objective function
information, not derivatives or
other auxiliary knowledge.
Therefore, they can deal with the
non-smooth, non-continuous, and
non differentiable functions.
GA use probabilistic transition
rules, not deterministic rules.
GA Problem Formulation
States: A population of individuals, each
with an associated fitness value
Operators: Transform the population
into a new generation, using Darwinian
principle of reproduction and survival of
the fittest
Goal test: Criterion for terminating the
search
Formalization
Representation scheme
Fitness measures
Parameters for controlling the
algorithm
Genetic Representation
Scheme
Binary representation:
Binary representation consists of
binary coding, the strings are made
up of 1’ and 0’ (i.e
11110010101011). The length of
the string is determined by the
precision desired for the solution.
Binary coding
2 11 Remainder
2 5 1
2 2 1
2 1 0
Binary equivalent of 11 is 1011
Procedures of GA
Suppose we wish to maximize a function of k
variables, f(x1,x2,….xk): Rk->R. Suppose further
that each variable xi can take values from a
domain Di=[ai,bi] and f(x1,x2,….xk) > 0 for all xi in
Di. We wish to optimize the function f with
required precision say upto 6 decimal places for
the variables. Then Di must be cut into (bi-ai)*106
equal sized ranges.
Procedures of GA
Let mi be the smallest integer such that 2mi-
1<=(b -a )*106 <=2m . Then m be the size of
i i i i
the Chromosome.
After selection of the population strings is over,
the genetic manipulation process consisting of
two steps is carried out. In the first step, the
crossover operation that recombines the bits
(genes) of each two selected strings
(chromosomes) is executed. Various types of
crossover operators are found in the literature.
The single point and two points crossover
operations are illustrated in fig. 15.2 and 15.3
respectively. The crossover points of any
twochromosomes are selected randomly.
2 step of Genetic Algorithm
nd
The second step in the genetic manipulation
process is termed mutation, where the bits at
one or more randomly selected positions of the
chromosomes are altered. The mutation
process helps to overcome trapping at local
maxima. The offsprings produced by the
genetic manipulation process are the next
population to be evaluated.
Crossover in Genetic Algorithm
Mutation in Genetic Algorithm
Crossover Rate
In GA literature, the term cross over
rate is usually denoted as PC, the
probability of crossover. The
probability varies from 0 to 1. This is
calculated in GA by finding out the
ratio of the number of pairs to be
crossed to some fixed population.
Typically for a population size 30 to
200, cross over rates are ranged from
0.5 to 1.
Mutation Rate Pm
Mutation rate is the probability of
mutation which is used to calculate
number of bits to be muted. The
mutation operator preserves the
diversity among the population which
is also very important for the search.
Typically, the simple genetic
algorithm uses the population size of
30 to 200 with the mutation rates
varying from 0.001 to 0.5.
Sample Problem I
Example 15.1: The GA cycle is illustrated in this
example for maximizing a function f(x) = x2 in the
interval 0 ≤ x ≤ 31. In this example the fitness
function is f (x) itself. The larger is the functional
value, the better is the fitness of the string. In this
example, we start with 4 initial strings. The fitness
value of the strings and the percentage fitness of
the total are estimated in the 1st table
Solution by GA
Since fitness of the second string is large, we
select 2 copies of the second string and one
each for the first and fourth string in the mating
pool.The selection of the partners in the mating
pool is also done randomly.
Here in 2nd table , we selected partner of string
1 to be the 2-nd string and partner of 4-th string
to be the 2nd string.
Solution by GA……..
The crossover points for the first-second
and second-fourth strings have been
selected after o-th and 2-nd bit positions
respectively in 2nd table. The second
generation of the population without
mutation in the first generation is presented
in 3rd table
Initial population and their fitness
values
Table 1: Initial population and their fitness values
Mating pool strings and crossover
Table 2: Mating pool strings and crossover
Fitness value in second generation
1 2
6 3
5 4
Distance Table
1 0
2 10 0
3 17 10 0
4 20 17 10 0
5 17 20 17 10 0
6 10 17 20 17 10 0
1 2 3 4 5 6
Solution of TSP by GA
(Parent 1)P1: 1 3 4 2 5 6
(Parent 2)P2: 1 2 3 6 5 4