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

Genetic Algorithms UNIT-4

Uploaded by

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

Genetic Algorithms UNIT-4

Uploaded by

Jahnavi Janu
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 36

UNIT-4

Genetic Algorithms
Genetic Algorithm (GA) is a search-based optimization techni

ased on the principles of Genetics and Natural Selection


GAs were developed by John Holland and his students and

olleagues at the University of Michigan in 1965


ut the first article is published on 1975.
wo Fundamental Biological Processes is:

Genetics : Gregor John Mendel(1865)

Evolution : Charles Darwin in (1875)


Limitations of Traditional Methods
Computationally Expensive
Methods may not be suitable for parallel
Computing
Discrete Variables are difficult to handle
Methods may not necessary adaptive
dvantages of GA’s

Does not require any derivative information.

s faster and more efficient as compared to the


traditional methods.

Optimizes both continuous and discrete functions


and also multi-objective problems.

Always gets an answer to the problem.


Limitations of GA’s
GAs are not suited for all problems.

Fitness value is calculated repeatedly


which
might be computationally expensive
for some
problems.
Basic Terminology
Population
Chromosomes
Gene
Allele
Genotype
Phonotype
Population
It is a subset of all the possible (encoded) solutions to the given problem
The population for a GA is analogous to the population for human being
except that instead of human beings.

Chromosomes
A chromosome is one such solution to the given
problem.
Ex:
GeneMosquito :6 Frogs : 26 Human : 46 Gold Fish
A gene is one element position of a chromosome.
: 94

Allele
It is the value a gene takes for a particular
chromosome.
Genotype
Genotype is the population in the computation space.
It Provides the solutions are represented in a way
which can be easily understood and manipulated
using a computing system.

Phenotype

Phenotype is the population in the actual real world


solution which are represented in a way they are
represented in real world situations.
Basic
Operators
Operators in Genetic Algorithms are

Selection Operator
Crossover Operator
 Mutation Operator
Selection operator gives preference to better
solutions, allowing them to pass on their “genes” to the
next generation of the Algorithm
This Operator may also simply pass to the Best
Solutions.

Crossover
This represents mating between individuals. Two
individuals are selected using selection operator and
crossover sites are chosen randomly. Then the genes at
these crossover sites are exchanged thus creating a
completely new individual.
https://www.youtube.com/watch?v=SBqZvFVwtvA&t=39s
Mutation

This Operator encourages Genetic Diversity


amongst solutions and attempts to prevent the
Genetic Algorithm
Basic Structure of GA

Basic Principle of GA
Inheritance Operator
Once a new generation is ready to be created, all of the
individuals that have been successful and have been chosen for
reproduction are randomly paired together .

These individuals are passed on through a combination of


crossover and mutation.

While crossover and mutation are the common


genetic operators used in inheritance.
Crossover
Crossover is the process of taking
two parent
solutions and producing from them
a child.

After the selection process, the


population is enriched with better
individuals.

Crossover operator is applied to the


mating pool with the hope that it
The various crossover
techniques are

• Single-Point Crossover
• Two-Point Crossover
• Multi-Point Cross Over
Single-Point Crossover
Two-Point
Crossover
Multi-Point Cross Over
Inversion:-

Inversion operator inverts the bits


between two random sites.
01 0011 1
Then, 0111001
Linear end-inversion

Linear end-inversion performs linear


inversion with a specified probability of
0.75.

If linear inversion was not performed, the


end inversion would be performed with
equal probability of 0.125 at either the
left or right end of the string
Deletion
i).Deletion and duplication:
Here any two or three bits in random are
selected and their previous bits are
duplicated.
Deletion and regeneration:

Here bits between the cross site are


deleted and regenerated randomly.
Mutation Operator
After cross over, the strings are subjected to mutation.
Mutation of a bit involves flipping it, changing 0 to 1
and vice versa with a small mutation probability Pm.

The bit wise mutation is performed bit-by-bit by


flipping a coin with a probability of Pm.

Flipping a coin with a probability of Pm is


simulated.
A number between 0 to 1 is chosen at random.

If the random number is smaller than Pm then the


outcome of coin flipping is true, otherwise the
outcome is false.
Bit-Wise Operator

One’s Complement ( ~ )Operator

The One’s complement operator (~) is a unary operator


that causes the bits of its operand to be inverted (i.e.
reversed), so that 1 becomes 0 and 0 becomes 1.

Bit-Wise AND (&) Operator


A bit-wise AND (&) expressions written 1 if both the bits
have a value 1, otherwise it returns a value 0.

Bit-Wise Exclusive ( ^ ) Operator

A bit-wise exclusive-OR (A) expressions returns 1 if one


of the bit have a value of 1 and the other has a value of 0
otherwise it returns a value 0.
Bit-Wise OR ( I ) Operator
A bit-wise OR (|) operator returns a value 1 if one or more bits have
a value 1 otherwise it returns a value 0.

Shift Left Operator («)


The shift left operator causes all the bits in the first operand to be
shifted to the left by the number of positions indicated by the second
operand. The left most bit in the original bit pattern is lost.
The right most bit positions that become, vacant are to be filled with
0s.

Shift Right Operator (>>)

The shift right operator causes all the bits in the first operand to be
shifted to the right by the number of positions indicated by the
second operand. The right most bit in the original bit pattern is lost.
The left most bit positions that become vacant are to be filled with
0s.

You might also like