0% found this document useful (0 votes)
15 views

Genetic Algorithm

Genetic algorithms are a technique for solving optimization problems based on Darwinian evolution principles. They work by initializing a population of random solutions and using genetic operators like selection, crossover and mutation to create new solutions over multiple generations. The fittest solutions survive and reproduce, while less fit solutions die out. Genetic algorithms have been applied to problems in many domains by representing potential solutions as chromosomes that undergo a simulated evolution process to gradually improve overall fitness.

Uploaded by

Anishamol
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Genetic Algorithm

Genetic algorithms are a technique for solving optimization problems based on Darwinian evolution principles. They work by initializing a population of random solutions and using genetic operators like selection, crossover and mutation to create new solutions over multiple generations. The fittest solutions survive and reproduce, while less fit solutions die out. Genetic algorithms have been applied to problems in many domains by representing potential solutions as chromosomes that undergo a simulated evolution process to gradually improve overall fitness.

Uploaded by

Anishamol
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 110

GENETIC ALGORITHM

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Classes of Search Techniques
Search Techniqes

Calculus Base Guided random search Enumerative


Techniqes techniqes Techniqes

Fibonacci Sort DFS Dynamic BFS


Programming

Tabular Search Hill Climbing Simulated Evolutionary


Anealing Algorithms

Genetic Genetic
Programming Algorithms

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
APPLICATIONS OF
GENETIC ALGORITHMS

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
General Introduction to GAs
 Genetic algorithms (GAs) are a technique to solve problems which
need optimization.

 GAs are a subclass of Evolutionary Computing and are random


search algorithms.

 GAs are based on Darwin’s theory of evolution.

 History of GAs:
• Evolutionary computing evolved in the 1960s.
• GAs were created by John Holland in the mid-1970s.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Biological Background – The Cell
 Every cell is a complex of many small “factories”
 working together.
 The center of this all is the cell nucleus.
 The nucleus contains the genetic information.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Biological Background– Chromosomes
 Genetic information is stored in the chromosomes.

 Each chromosome is build of DNA.

 Chromosomes in humans form pairs.

 There are 23 pairs.

 The chromosome is divided in parts: genes.

 Genes code for properties.

 The posibilities of the genes for one property is called: allele.

 Every gene has an unique position on the chromosome: locus.


Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Biological Background– Genetics
 The entire combination of genes is called genotype.
 A genotype develops into a phenotype.
 Alleles can be either dominant or recessive.
 Dominant alleles will always express from the genotype to the
fenotype.
 Recessive alleles can survive in the population for many
generations without being expressed.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Biological Background– Reproduction
 Reproduction of genetical
information:
• Mitosis,
• Meiosis.

 Mitosis is copying the same


genetic information to new
offspring: there is no
exchange of information.

 Mitosis is the normal way of


growing of multicell structures,
like organs.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Biological Background– Reproduction

 After meiotic division 2 gametes


appear in the process.

 In reproduction two gametes


conjugate to a zygote wich will
become the new individual.

 Hence genetic information is


shared between the parents in
order to create new offspring.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Biological Background (6) – Natural Selection
 The origin of species: “Preservation of favorable variations and
rejection of unfavorable variations.”

 There are more individuals born than can survive, so there is a


continuous struggle for life.

 Individuals with an advantage have a greater chance for survive:


survival of the fittest. For example, Giraffes with long necks.

 Genetic variations due to crossover and mutation.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Genetic Algorithm (1) – Search Space
 Most often one is looking for the
best solution in a specific subset
of solutions. 2.5

 This subset is called the search


space (or state space). 2

 Every point in the search space is 1.5

a possible solution.
 Therefore every point has a
1

fitness value, depending on the 0.5

problem definition.

0

GAs are used to search the search 0 100 200 300 400 500 600 700 800 900 1000

space for the best solution, e.g. a


minimum.
 Difficulties are the local minima
and the starting point of the
search. Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Genetic Algorithm– Basic Algorithm
 Starting with a subset of n randomly chosen solutions from the
search space (i.e. chromosomes).
This is the population.

 This population is used to produce a next generation of


individuals by reproduction.

 Individuals with a higher fitness have more chance to reproduce


(i.e. natural selection).

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Comparison of Natural and GA Terminology

Natural Genetic Algorithm


Chromosome String
Gene Feature or character
Allele Feature value
Locus String position
Genotype Structure
Phenotype Parameter set, a decoded structure

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
• All individuals in population
evaluated by fitness function.

• Individuals allowed to
reproduce (selection),
crossover, mutate.

Flowchart of GA
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Genetic Algorithm (3) – Basic Algorithm

Outline of the basic algorithm

0 START : Create random population of n chromosomes


1 FITNESS : Evaluate fitness f(x) of each chromosome in the
population
2 NEW POPULATION
1 REPRODUCTION/SELECTION : Based on f(x)
2 CROSS OVER : Cross-over chromosomes
3 MUTATION : Mutate chromosomes

3 REPLACE : Replace old with new population: the new generation


4 TEST : Test problem criterium
5 LOOP : Continue step 1 – 4 untill criterium is satisfied

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
OPERATORS IN GA

• Coding
• Selection
• Crossover/Recombination
• Mutation

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
ENCODING/CODING
• Process of representing individual gene
• Depends mainly on solving the problem
• Different coding techniques are
– Binary encoding
– Octal encoding
– Hexadecimal encoding
– Permutation/Real number Encoding
– Value encoding
– Tree encoding
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Binary Encoding
• Each chromosome encodes a binary string
• Each bit represent some characteristics

CHROMOSOME 1 110100011010
CHROMOSOME 2 110111111010

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Octal Encoding
• Each chromosome encodes an octal string
• From 0- 7

CHROMOSOME 1 03467216
CHROMOSOME 2 72561423

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Hexadecimal Encoding
• Each chromosome encodes a hexadecimal string
• From 0- 9,A-F

CHROMOSOME 1 9CE7
CHROMOSOME 2 3DBA

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Permutation Encoding
• Each chromosome encodes a string of numbers
represented in sequence
• Only useful for ordering problem
CHROMOSOME 1 153264798
CHROMOSOME 2 856723149

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Value Encoding
• Each chromosome encodes a string of values and
values can be anything concerning the problem

CHROMOSOME 1 1.2354 3.5687 4.7894 5.897461


CHROMOSOME 2 ASDFGERTYUILKJGF
CHROMOSOME 3 (back),(back),(forward), (right), (left)

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
SELECTION
• Selection is the process of choosing 2 parents
from population for crossing
• After deciding an encoding next step is to
decide how to perform selection
• Selection is the method that randomly pick
chromosomes out of the population according
to their evaluation function
• The higher the fitness function value , the better
chance that an individual will be selected
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
SELECTION
• The selection pressure is defined as the degree to which the
better individuals are favored
• The higher the selection pressured, the more the individuals are
favored
• The convergence rate of GA is largely determined by the
magnitude of the selection pressure
• Higher selection pressure resulting in the higher convergence
rate
• If the selection pressure is too low, the convergence rate will be
slow and the GA will take unnecessarily longer to find the
optimal solution
• If the selection pressure is too high , there is an increased change
of the GA prematurely converging to an incorrect solution
Arsha
Computer
J K,AP,Computer
Science and Engineering,
Science and
Engineering,
VJCET,VJCET,
Vazhakulam
Vazhakulam
SELECTION
• Two type of selection scheme
– Proportionate based selection
• Pick out the individuals based upon their fitness values
relative to the fitness of other individuals in the
population
• Selection pressure depends on the fitness
– Ordinal based selection
• Not based on their fitness value
• Upon the rank within the population
• Selection pressure is independent of the fitness

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
SELECTION
• Various selection methods are
– Roulette Wheel Selection
– Random Selection
– Rank Selection
– Tournament Selection
– Boltzmann Selection
– Stochastic Universal Sampling

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Roulette Wheel Selection

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Roulette Wheel Selection
• Consider a circular wheel.
• The wheel is divided into n pies, where n is the number
of individuals in the population.
• Each individual gets a portion of the circle which is
proportional to its fitness value.
• In a roulette wheel selection, the circular wheel is
divided as described before.
• A fixed point is chosen on the wheel circumference as
shown and the wheel is rotated.
• The region of the wheel which comes in front of the
fixed point is chosen as the parent.
• For the second parent, the same process is repeated.
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Roulette Wheel Selection
• It is clear that a fitter individual has a greater pie on
the wheel and therefore a greater chance of landing
in front of the fixed point when the wheel is
rotated.
• Therefore, the probability of choosing an individual
depends directly on its fitness.
• Implementation wise, we use the following steps –
– Calculate S = the sum of a fitnesses.
– Generate a random number between 0 and S.
– Starting from the top of the population, keep adding the
finesses to the partial sum P, till P<S.
– The individual for which P exceeds S is the chosen
individual.
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Roulette Wheel Selection

• Easier to implement
• But Noisy
• Depends on the variance of fitness in the
population

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Random Selection
• Randomly selects a parent from the population
• A little more disruptive

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Rank Selection
• Rank selection ranks the population and every
chromosome receives fitness from the ranking
• The worst has fitness 1 and the best has fitness N
• It results in slow convergence but prevents too
quick convergence
• It also keep up selection pressure when the
fitness variance is low
• Preserve diversity

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Rank Selection
• There are many ways for rank selection
– Select a pair of individual at random. Generate a
random number R between 0 and 1 . If R<r use the
first individual as parent. This is repeated to select the
second parent. The value of r is a parameter to this
method
– Select two individuals at random. The individual with
a highest evaluation become the parent. Repeat to
find the second parent

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Tournament Selection

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Tournament Selection
• In K-Way tournament selection, we select K
individuals from the population at random and
select the best out of these to become a parent.
• The same process is repeated for selecting the
next parent.
• Tournament Selection is also extremely popular
in literature as it can even work with negative
fitness values.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Boltzmann Selection
• This method simulates the process of slow cooling of molten
metal to achieve the minimum function value in a
minimization problem
• Controlling a temperature like parameter introduced with the
concept of Boltzmann probability distribution simulate the
cooling phenomenon
• In Boltzmann selection, a continuously varying temperature
controls the rate of selection according to a preset schedule
• The temperature start out high, which means that the
selection pressure is low
• The temperature is gradually lowered, which gradually
increase the selection pressure
• Thereby allowing the GA to narrow in more closely to the
best part of the search
Arshaspace
J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Stochastic Universal Sampling
• Stochastic Universal Sampling is quite similar to
Roulette wheel selection, however instead of having
just one fixed point, we have multiple fixed points as
shown in the following image.
• Therefore, all the parents are chosen in just one spin
of the wheel.
• Also, such a setup encourages the highly fit
individuals to be chosen at least once.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
CROSSOVER
• Cross over is a process of taking two parent
solution and producing from them a child
• After the selection process the population is
enriched with better individuals
• Reproduction makes the clone of good strings
but does not create new one
• Crossover operator is applied to the matting
pool with a hope that it creates a better
offspring

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
CROSSOVER
• Cross over is a recombination operator that
proceeds in three steps
1. The reproduction operator select at random a
pair of 2 individual strings for the matting
2. A cross site is selected at random along the
string length
3. Finally, the position values are swapped
between the two strings following the cross
site

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
CROSSOVER
• Various crossover techniques are
– Single- point Crossover
– Two- point crossover
– Multipoint cross over/N point cross over
– Uniform Crossover
– Three parent Crossover
– Crossover with reduced Surrogate
– Shuffle crossover
– Precedence Preservative Crossover
– Ordered crossover
– Partially matched crossover
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Single-Point Crossover
• In this one-point crossover, a random crossover point is
selected and the tails of its two parents are swapped to
get new off-springs.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Two-Point Crossover
• Two crossover points are chosen and the content between
these points are exchanged between two matted parents

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Two-Point Crossover
• But with one point cross over , the head and tail of
one chromosome cannot be passed together to the
offspring
• If both the head and tail of chromosome contain
good genetic information, none of the offspring
obtain directly with the one point crossover
• Using two point crossover one can overcome these
drawbacks so it is better than one point cross over

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Multi-Point Crossover/
(N-Point crossover)
• Multi point crossover is a generalization of the one-point
crossover wherein alternating segments are swapped to
get new off-springs.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Uniform Crossover

PARENT 1 10110011
PARENT 2 00011010
MASK 11010110
CHILD 1 10011010
CHILD 2 00110011

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Uniform Crossover
• Each gene in the offspring is created by copying the corresponding
gene from the one or other parent chosen according to the random
generated binary crossover mask of same length as the
chromosome
• Where there is a 1 in the crossover point, the gene is copied from
the first parent
• Where there is a 0 in the mask , the gene is copied from the second
parent
• A new crossover mask is generated for each parent pair
• Offspring therefore contain a mixture of gene from each parent
• The number of effective crossing point is not fixed , but will be the
average of L/2 where L is the chromosome length

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Uniform Crossover

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Genetic Algorithm – Uniform Crossover
Generate uniformly random number.

X1 = 0110001010
X2 = 1100000111
Uniformly generated = 1 0 0 0 0 0 1 0 0 0
As a result, the new population becomes,

X1 = 1110000010

X2 = 0100001111

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Three- Parent Crossover

PARENT 1 11010001
PARENT 2 01101001
PARENT 3 01101100
CHILD 01101001

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Three- Parent Crossover
• Three parents are randomly chosen
• Each bit of the first parent is compared with
the bit of second parent.
• If both are same, the bit is taken for the
offspring
• Otherwise bit from the third parent is taken
for the offspring

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Crossover with Reduced Surrogate
The reduced surrogate operator constrains
crossover to always produce new individuals
wherever possible.

This is implemented by restricting the location of


crossover points such that crossover points
only occur where gene values differ.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Shuffle Crossover
Shuffle crossover is related to uniform crossover.
A single crossover position (as in single-point
crossover) is selected.
But before the variables are exchanged, they are
randomly shuffled in both parents.

After recombination, the variables in the


offspring are un shuffled.

This removes positional bias as the variables are


randomly reassigned each time crossover is
performed. Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Precedence Preservative Crossover
(PPX)
• Developed for vehicle routing problems
• The operator passes on precedence relation of
operations given in two parental permutations to
one offspring at the same rate, while no new
precedence relations are introduced

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
1. A vector of length Sigma, sub i=1to mi, representing the
number of operations involved in the problem, is randomly
filled with elements of the set {1, 2}.
2. This vector defines the order in which the operations are
successively drawn from parent 1 and parent 2.
3. We can also consider the parent and offspring
permutations as lists, for which the operations append
and delete are defined.
4. First we start by initializing an empty offspring.
5. The leftmost operation in one of the two parents is selected
in accordance with the order of parents given in the vector.
6. After an operation is selected it is deleted in both parents.
7. Finally the selected operation is appended to the offspring.
8. This step is repeated until both parents are empty and the
offspring contains all operations involved.
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Precedence Preservative Crossover
(PPX)

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Ordered Crossover
• Ordered two-point crossover is used when the problem is of
order based, for example in U-shaped assembly line
balancing etc.
• Given two parent chromosomes, two random crossover
points are selected partitioning them into a left, middle and
right portion.
• The ordered two-point crossover behaves in the following
way:
child 1 inherits its left and right section from parent 1,
and its middle section is determined by the genes in the
middle section of parent 1 in the order in which the values
appear in parent 2.
• A similar process is applied to determine child 2.
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Partially Matched Crossover
(PMX)
• PMX can be applied usefully in the TSP.
• Indeed, TSP chromosomes are simply sequences of
integers, where each integer represents a different city
and the order represents the time at which a city is
visited.
• Under this representation, known as permutation
encoding, we are only interested in labels .
• It may be viewed as a crossover of permutations that
guarantees that all positions are found exactly once in
each offspring, i.e. both 3 offspring receive a full
complement of genes, followed by the corresponding
filling in of alleles from their parents.
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Partially Matched Crossover
(PMX)
• PMX proceeds as follows:
1. The two chromosomes are aligned.
2. Two crossing sites are selected uniformly at random
along the strings, defining a matching section
3. The matching section is used to effect a cross through
position by-position exchange operation
4. Alleles are moved to their new positions in the offspring

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Consider the two strings shown in Fig
 Where, the dots mark the selected cross points.
The matching section defines the position-wise exchanges
that must take place in both parents to produce the offspring.
The exchanges are read from the matching section of one
chromosome to that of the other.
In the example, the numbers that exchange places are 5 and
2, 6 and 3, and 7 and 10.
The resulting offspring are as shown

exchange places are 5 and 2, 6 and 3, and 7 and 10.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Crossover Probability
The basic parameter in crossover technique is the crossover
probability (Pc).
Crossover probability is a parameter to describe how often
crossover will be performed.
 If there is no crossover, offspring are exact copies of
parents. If there is crossover, offspring are made from parts
of both parent’s chromosome.
 If crossover probability is 100%, then all offspring are
made by crossover.
 If it is 0%, whole new generation is made from exact
copies of chromosomes from old population (but this does
not mean that the new generation is the same!).

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Mutation
 After crossover, the strings are subjected to mutation.
Mutation prevents the algorithm to be trapped in a
local minimum.
 Mutation plays the role of recovering the lost genetic
materials as well as for randomly disturbing genetic
information.
 It is an insurance policy against the irreversible loss of
genetic material. Mutation has traditionally considered
as a simple search operator.
 If crossover is supposed to exploit the current solution
to find better ones, mutation is supposed to help for the
exploration of the whole search space.
 Mutation of a bit involves flipping a bit, changing 0 to 1
and vice-versa.
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Mutation Methods
Flipping
Interchanging
Reversing

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Flipping
Flipping of a bit involves changing 0 to 1 and 1 to
0 based on a mutation chromosome generated.
A parent is considered and a mutation
chromosome is randomly generated.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Interchanging
Two random positions of the string are
chosen and the bits corresponding to
those positions are interchanged.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Reversing
A random position is chosen and the bits
next to that position are reversed and
child chromosome is produced.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Mutation Probability
 The important parameter in the mutation technique is
the mutation probability (Pm).
 The mutation probability decides how often parts of
chromosome will be mutated.
 If there is no mutation, offspring are generated
immediately after crossover (or directly copied)
without any change.
 If mutation is performed, one or more parts of a
chromosome are changed. If mutation probability is
100%, whole chromosome is changed.
 if it is 0%, nothing is changed.
 Mutation generally prevents the GA from falling into
local extremes.
 Mutation should not occur very often, because then GA
will in fact change to random search.
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Replacement
• Replacement is the last stage of any breeding
cycle. Two parents are drawn from a fixed size
population, they breed two children, but not all
four can return to the population, so two must
be replaced. The technique used to decide
which individual stay in a population and which
are replaced in on a par with the selection in
influencing convergence. Basically, there are
two kinds of methods for maintaining the
population; generational updates and steady
state updates.
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Generational update scheme
The basic generational update scheme
consists in producing N children from a
population of size N to form the
population at the next time step
(generation), and this new population of
children completely replaces the parent
selection. Clearly this kind of update
implies that an individual can only
reproduce with individuals from the
same generation.
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Steady state update
In a steady state update, new individuals
are inserted in the population as soon as
they are created, as opposed to the
generational update where an entire new
generation is produced at each time step.
The insertion of a new individual usually
necessitates the replacement of another
population member. The individual to be
deleted can be chosen as the worst
member of the population.
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Random Replacement
The children replace two randomly chosen
individuals in the population. The parents
are also candidates for selection. This can
be useful for continuing the search in
small populations, since weak individuals
can be introduced into the population.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Weak Parent Replacement
In weak parent replacement, a weaker
parent is replaced by a strong child.

With the four individuals only the fittest


two, parent or child, return to population.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Both Parents Replacement
Both parents replacement is simple. The child
replaces the parent. In this case, each
individual only gets to breed once. As a
result, the population and genetic material
moves around but leads to a problem when
combined with a selection technique that
strongly favors fit parents: the fit breed and
then are disposed of.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Search Termination
(Convergence Criteria)
 Maximum generations–The genetic algorithm stops when
the specified number of generation’s have evolved.
 Elapsed time–The genetic process will end when a
specified time has elapsed.
Note: If the maximum number of generation has been
reached before the specified time has elapsed, the process
will end.
 No change in fitness–The genetic process will end if there
is no change to the population’s best fitness for a specified
number of generations.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Search Termination
(Convergence Criteria)
Stall generations–The algorithm stops if
there is no improvement in the objective
function for a sequence of consecutive
generations of length Stall generations.
Stall time limit–The algorithm stops if
there is no improvement in the objective
function during an interval of time in
seconds equal to Stall time limit.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Stopping condition for GA flow
 Best Individual: A best individual convergence criterion
stops the search once the minimum fitness in the
population drops below the convergence value. This brings
the search to a faster conclusion guaranteeing at least one
good solution.
 Worst individual: Worst individual terminates the search
when the least fit individuals in the population have fitness
less than the convergence criteria. This guarantees the
entire population to be of minimum standard, although the
best individual may not be significantly better than the
worst. In this case, a stringent convergence value may
never be met, in which case the search will terminate after
the maximum has been exceeded.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Stopping condition for GA flow
 Sum of Fitness: In this termination scheme, the
search is considered to have satisfaction
converged when the sum of the fitness in the
entire population is less than or equal to the
convergence value in the population record.
 Median Fitness: Here at least half of the
individuals will be better than or equal to the
convergence value, which should give a good range
of solutions to choose from.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Why do Genetic Algorithms Work?
The search heuristics of GA are based upon
Holland’s scheme theorem.
A schema is defined as templates for describing a
subset of chromosomes with similar sections.
The schemata consist of bits 0, 1 and meta-
character.
The template is a suitable way of describing
similarities among Patterns in the
chromosomes Holland derived an expression
that predicts the number of copies of a
particular schema would have in the next
generation after undergoing exploitation,
crossover and mutation.
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Why do Genetic Algorithms Work?
It should be noted that particularly good
schemata will propagate in future generations.
Thus, schema that are low-order, well defined
and have above average fitness are preferred
and are termed building blocks.
This leads to a building block principle of GA: low
order, well-defined, average fitness schemata
will combine through crossover to form high
order, above average fitness schemata.
Since GAs process may schemata in a given
generation they are said to have the property of
implicit parallelism.
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Genetic Algorithm – An Example
 Simple problem: max x2 over {0, 1, …, 31}

 GA approach:
• Representation: binary code, e.g. 01101  13
• Population size: 4
• 1-point xover, bitwise mutation
• Roulette wheel selection
• Random initialisation

 One generational cycle performed manually is shown here.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Example : Selection

4 1
31% 14%

5% 3
49%
2
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Example : Crossover

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Example : Mutation

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Simple Genetic Algorithm
 Has been subject of many (early) studies

• still often used as benchmark for novel Gas.

 Shows many shortcomings, e.g.

• Representation is too restrictive.


• Mutation & crossovers only applicable for bit-string & integer
representations.
• Selection mechanism sensitive for converging populations with
close fitness values.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
Comparison of GA with Traditional Optimization
Techniques
 GA works with the coding of solution set and not with the solution
itself.

 GA uses population of solutions rather than a single solution for


searching.

 GA uses fitness function for evaluation rather the derivatives.

 GA uses probabilistic transition and not deterministic rules.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
References
 Holland, J. (1992), Adaptation in natural and artificial systems ,
2nd Ed. Cambridge: MIT Press.

 Davis, L. (Ed.) (1991), Handbook of genetic algorithms. New York:


Van Nostrand Reinhold.

 Goldberg, D. (1989), Genetic algorithms in search, optimization


and machine learning. Addison-Wesley.

 Fogel, D. (1995), Evolutionary computation: Towards a new


philosophy of machine intelligence. Piscataway: IEEE Press.

 Bäck, T., Hammel, U., and Schwefel, H. (1997), ‘Evolutionary


computation: Comments on the history and the current state’, IEEE
Trans. On Evol. Comp. 1, (1)
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
Online Resources

 http://www.spectroscopynow.com

 http://www.cs.bris.ac.uk/~colin/evollect1/evollect0/index.htm\

 IlliGAL (http://www-illigal.ge.uiuc.edu/index.php3)

 GAlib (http://lancet.mit.edu/ga/)

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
HYBRID SOFT
COMPUTING
TECHNIQUES

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
GENERAL NEURO HYBRID SYSTEMS
Definition:
A neuro-genetic hybrid or a genetic_neuro-hybrid system is one in which a
neural network employs a genetic algorithm to optimize its structural
parameters that define its architecture.

Properties of genetic neuro-hybrid systems:


1. The parameters of neural networks are encoded by genetic algorithms as a
string of properties of the network, that is, chromosomes. A large
population of chromosomes is generated, which represent the many
possible parameter sets for the given neural network.

2. Genetic Algorithm _Neural Network, or GANN, has the ability to locate the
neighborhood of the optimal solution quickly, compared to other
conventional search strategies.

Drawbacks are :
1. Large amount of memory required for handling and manipulation of
chromosomes for a given network
2. Scalability as the network becomes large
Arsha J K,AP,Computer Science and
Engineering, VJCET, Vazhakulam
BLOCK DIAGRAM OF GENETIC NEURO HYBRID
SYSTEMS

Fig 3

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
ADVANTAGES OF GENETIC NEURO HYBRID
SYSTEMS
The various advantages of neuro-genetic hybrid are as follows:

 GA performs optimization of neural network parameters with simplicity,


ease of operation, minimal requirements and global perspective.

 GA helps to find out complex structure of ANN for given input and the
output data set by using its learning rule as a fitness function.

 Hybrid approach ensembles a powerful model that could significantly


improve the predictability of the system under construction.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
GENETIC FUZZY HYBRID SYSTEMS
The hybridization of genetic algorithm and fuzzy logic can be performed in the
following two ways:

1. By the use of fuzzy logic based techniques for improving genetic algorithm
behavior and modeling GA components. This is called fuzzy genetic algorithms
(FGAs).

2. By the application of genetic algorithms in various optimization and search


problems involving fuzzy systems.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
ADVANTAGES OF GENETIC FUZZY HYBRID
SYSTEMS
GAs allow us to represent different kinds of structures, such as weights,
features together with rule parameters, etc., allowing us to code multiple
models of knowledge representation. This provides a wide variety of
approaches where it is necessary to design specific genetic components for
evolving a specific representation.

Genetic algorithm efficiently optimizes the rules, membership functions, DB and


KB of fuzzy systems. The methodology adopted is simple and the fittest
individual is identified during the process.

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam
SUMMARY
This chapter has given an overview on Hybrid Soft Computing Techniques

Arsha J K,AP,Computer Science and


Engineering, VJCET, Vazhakulam

You might also like