Unit 4
Unit 4
Unit 4
Unit 4
Background of Genetic Algorithm
• The basic building blocks in living bodies are cells. Each cell carries the
basic unit of heredity, called gene
• For a particular specie, number of chromosomes is fixed.
• Examples
• Mosquito: 6
• Frogs: 26
• Human: 46
A brief account on genetics
Genotype Phenotype
The hereditary information of the organism in the form of gene in The characters of an organism which are visible are known as
the DNA and remains the same throughout the life. phenotypes.
Same genotype produces same phenotype. Same phenotype may or may not belong to same genotype.
Present inside the body as genetic material. Expression of genes as the external appearence.
The genotype is inherited from the parent to the offspring. The phenotype is not inherited from the parent.
It can be determined by scientific methods such as the polymerase It can be determined by observing the organism.
chain reaction.
For eg., Blood group, eye colour, height, genetic diseases. For eg., Weight, physique, beak of birds
Working of Genetic Algorithm
• 1) GA is an iterative process.
• 2) It is a searching technique.
• 3) Working cycle with / without convergence.
• 4) Solution is not necessarily guaranteed. Usually, terminated with a
local optima
Working of Genetic Algorithm
• In this scheme, the probability for an individual is being selected in the mating pool is considered to be
proportional to its fitness.
Roulette-Wheel selection mechanism:
Roulette-Wheel selection mechanism:
Roulette-Wheel selection mechanism: An Example
Rank-based selection
• Reproduction:
• Crossover
• Mutation
• In crossover, there is an exchange of properties between two parents and as a result of which two offspring
solutions are produced.
• The crossover point(s) (also called k‐point(s)) is(are) decided using a random number generator generating
integer(s) in between 1 and L, where L is the length of the chromosome.
Then we perform exchange of gene values with respect to the k‐point(s)
Crossover operations
1) In case of multi‐point crossover, a number of crossover points are selected along the length of the string, at
random.
2) The bits lying between alternate pairs of sites are then swapped.
Uniform Crossover
.
Mutation Technique: Reversing
Termination and/or convergence criteria