GENETIC
ALGORITHM
GENETIC ALGORITHM
INTRODUCTION
Genetic Algorithm (GA) is a search-based
optimization technique based on the principles
of Genetics and Natural Selection. It is
frequently used to find optimal or near-optimal
solutions to difficult problems that otherwise
would take a lifetime to solve.
●
INTRODUCTION TO
OPTIMIZATION
●
Optimization is the process of making
something better.
What are Genetic
Algorithms?
● Nature has always been a great source of
inspiration to all mankind. Genetic Algorithms
(GAs) are search based algorithms based on
the concepts of natural selection and genetics.
GAs are a subset of a much larger branch of
computation known as Evolutionary
Computation.
●
BASIC TERMINOLOGY
●
Population – It is a subset of all the possible
(encoded) solutions to the given problem.
●
Chromosomes – A chromosome is one
such solution to the given problem. (46 in
human)
●
Gene – A gene is one element position of a
chromosome.
● Allele – It is the value a gene takes for
a particular chromosome.
Genetic Algorithm in Artificial Intelegence.pptx
Genetic Algorithm in Artificial Intelegence.pptx
●
Genotype – Genotype is the population in the computation
space. In the computation space, 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 space in which solutions are represented in
a way they are represented in real world situations.
●
Decoding and Encoding – For simple problems, the
phenotype and genotype spaces are the same. However,
in most of the cases, the phenotype and genotype spaces
are different. Decoding is a process of transforming a
solution from the genotype to the phenotype space, while
encoding is a process of transforming from the phenotype
to genotype space.Decoding should be fast as it is carried
out repeatedly in a GA during the fitness value calculation.
Decoding and Encoding
● Fitness Function – A fitness function simply
defined is a function which takes the solution as
input and produces the suitability of the solution as
the output. In some cases, the fitness function and
the objective function may be the same, while in
others it might be different based on the problem.
Genetic Operators – These alter the genetic
composition of the offspring. These include
crossover, mutation, selection, etc.
●
Knapsack Problem
The knapsack problem or rucksack
problem is a problem in combinatorial
optimization: Given a set of items,
each with a weight and a value,
determine the number of each item to
include in a collection so that the total
weight is less than or equal to a given
limit and the total value is as large as
possible. It derives its name from the
problem faced by someone who is
constrained by a fixed-size knapsack
and must fill it with the most valuable
items.
BASIC STRUCTURE OF GENETIC ALGORITHM
Genetic Algorithm in Artificial Intelegence.pptx
// Valid Genes
const string GENES = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP"
"QRSTUVWXYZ 1234567890, .-;:_!"#%&/()=?@${[]}";
// Target string to be generated
const string TARGET = "I love Pakistan";
// Create random genes for mutation
char mutated_genes()
// create chromosome or string of genes
string create_gnome()
// Class representing individual in population
class Individual
{
public:
string chromosome;
int fitness;
Individual(string chromosome);
Individual mate(Individual parent2);
int cal_fitness();
};
GENOTYPE REPRESENTATION
● BINARY REPRESENTATION
● REAL VALUED REPRESENTATION
● INTEGER REPRESENTATION
● PERMUTATION REPRESENTATION
GA- POPULATION
●
Population is a subset of solutions in the
current generation
Set of chromosomes
●
● POPULATION INITIALIZATION
1. RANDOM INITIALIZATION
2. HEURISTIC INITIALIZATION
• Random Initialization − Populate the initial population with
completely random solutions.
• Heuristic initialization − Populate the initial population
using a known heuristic for the problem.
It has been observed that the entire population should not be initialized
using a heuristic, as it can result in the population having similar
solutions and very little diversity. It has been experimentally observed
that the random solutions are the ones to drive the population to
optimality. Therefore, with heuristic initialization, we just seed the
population with a couple of good solutions, filling up the rest with
random solutions rather than filling the entire population with heuristic-
based solutions.
It has also been observed that heuristic initialization in some cases,
only affects the initial fitness of the population, but in the end, it is the
diversity of the solutions which leads to optimality.
● POPULATION MODEL
1. STEADY STATE
2. GENERATIONAL
Steady State
In steady state GA, we generate one or two
offspring in each iteration and they replace one
or two individuals from the population. A steady-
state GA is also known as Incremental GA.
Generational
In a generational model, we generate ‘n’ off-
springs, where n is the population size, and the
entire population is replaced by the new one at
the end of the iteration.
FITNESS FUNCTION
●
Takes a candidate solution to the problem as
input and produces as output
how “fit” or how “good” the solution is
concerning the problem in
consideration.
In most cases, the fitness function and
the objective function are the same as
the objective is to either maximize or
minimize the given objective function.
●
FITNESS FUNCTION
• The fitness function should be
sufficiently fast to compute.
• It must quantitatively measure how fit
a given solution is or how fit
individuals can be produced from the
given solution.
• In some cases, calculating the fitness
function directly might not be possible
due to the inherent complexities of the
problem at hand. In such cases, we do
fitness approximation to suit our
needs.
FITNESS FUNCTION
• The following image shows the fitness
calculation for a solution of the 0/1
Knapsack. It is a simple fitness
function that just sums the profit
values of the items being picked
(which have a 1), scanning the
elements from left to right till the
knapsack is full.
Genetic Algorithm in Artificial Intelegence.pptx
GA- PARENT SELECTION
Parent Selection is the process of selecting
parents who mate and recombine to
create offspring for the next generation.
Parent selection is very crucial to the
convergence rate of the GA as good
parents drive individuals to better and
fitter solutions.
GA- PARENT SELECTION
However, care should be taken to prevent one
extremely fit solution from taking over the entire
population in a few generations, as this leads to
the solutions being close to one another in the
solution space thereby leading to a loss of
diversity. Maintaining good diversity in the
population is extremely crucial for the success of
a GA. This taking up of the entire population by
one extremely fit solution is known
as premature convergence and is an
undesirable condition in a GA.
Premature convergence occurs when a
population converges to a single solution,
but that solution isn't as good as
GA- PARENT SELECTION
• Fitness Proportionate Selection is one
of the most popular ways of parent
selection.
• In this, every individual can become a
parent with a probability which is
proportional to its fitness.
• Therefore, fitter individuals have a higher
chance of mating and propagating their
features to the next generation.
• Therefore, such a selection strategy
applies selection pressure to the more fit
individuals in the population, evolving into
better individuals over time.
GA- PARENT 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.
• Two implementations of fitness proportionate
selection are possible −
• Roulette Wheel Selection
• 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.
GA- PARENT SELECTION
●
Fitness Proportionate Selection
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.
● Stochastic Universal Sampling (SUS)
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 highly fit
individuals to be chosen at least once.
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.
● Tournament Selection
Rank Selection
Chromosom
e
Fitness
Value
Rank
A 8.1 1
B 8.0 4
C 8.05 2
D 7.95 6
E 8.02 3
In this, we remove the concept of a fitness value
while selecting a parent.
However, every individual in the population is
ranked according to their fitness.
The selection of the parents depends on the rank of
each individual and not the fitness.
The higher-ranked individuals are preferred more
than the lower-ranked ones.
Rank Selection
In this strategy, we randomly select parents from
the existing population. There is no selection
pressure towards fitter individuals and therefore
this strategy is usually avoided.
GA- CROSSOVER
●
one parent is selected and one or more off-
springs are produced using the genetic material
of the parents
One 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 offspring.
● Multi Point Crossover
● Uniform Crossover
Multi point crossover is a generalization of the one-point
crossover wherein alternating segments are swapped to
get new off-springs.
In a uniform crossover, we don’t divide the chromosome into
segments, rather we treat each gene separately. In this, we
essentially flip a coin for each chromosome to decide whether or not
it’ll be included in the offspring. We can also bias the coin to one
parent, to have more genetic material in the child from that parent.
GA- MUTATION
-Bit Flip Mutation
In simple terms, mutation may be defined as a small
random tweak in the chromosome, to get a new
solution.
Mutation Operators
We describe some of the most commonly used
mutation operators.
Like the crossover operators, this is not an exhaustive
list and the GA designer might find a combination of
these approaches or a problem-specific mutation
operator more useful.
In this bit flip mutation, we select one or more
random bits and flip them. This is used for binary-
encoded GAs.
GA- MUTATION
-Random Resetting
Random Resetting is an extension of the bit flip for
the integer representation. In this, a random value
from the set of permissible values is assigned to a
randomly chosen gene.
-Swap Mutation
In swap mutation, we select two positions on the
chromosome at random and interchange the
values. This is common in permutation-based
encodings.
● Scramble Mutation
● Inversion Mutation
Scramble mutation is also popular with permutation
representations. In this, from the entire
chromosome, a subset of genes is chosen and their
values are scrambled or shuffled randomly.
In inversion mutation, we select a subset of genes
like in scramble mutation, but instead of shuffling
the subset, we merely invert the entire string in
the subset.
GA- SURVIVOR SELECTION
• The Survivor Selection Policy determines
which individuals are to be kicked out and
which are to be kept in the next
generation.
• It is crucial as it should ensure that the
fitter individuals are not kicked out of the
population, while at the same time,
diversity should be maintained in the
population.
GA- SURVIVOR SELECTION
Age-Based Selection
In Age-Based Selection, we don’t have a notion
of fitness. It is based on the premise that each
individual is allowed in the population for a finite
generation where it is allowed to reproduce, after
that, it is kicked out of the population no matter
how good its fitness is.
For instance, in the following example, the age is
the number of generations for which the
individual has been in the population. The oldest
members of the population i.e. P4 and P7 are
kicked out of the population and the ages of the
rest of the members are incremented by one.
GA- SURVIVOR SELECTION
● Age Based Selection
GA- SURVIVOR SELECTION
Fitness-Based Selection
In this fitness-based selection, the children tend
to replace the least fit individuals in the
population. The selection of the least fit
individuals may be done using a variation of any
of the selection policies described before –
tournament selection, fitness proportionate
selection, etc.
For example, in the following image, the children
replace the least fit individuals P1 and P10 of the
population. It is to be noted that since P1 and P9
have the same fitness value, the decision to
remove which individual from the population is
arbitrary.
●
Fitness Based Selection
GA- TERMINATION CONDITION
●
When there has been no improvement in the
population for X iterations.
When we reach an absolute number of
generations.
When the objective function value has reached
a certain pre-defined value
●
●

More Related Content

ODP
Genetic algorithm ppt
PPTX
Genetic Algorithms : A class of Evolutionary Algorithms
PPT
0101.genetic algorithm
PPT
Genetic algorithm
PDF
Genetic Algorithms in Artificial Intelligence
PPT
Evolutionary algorithms
PDF
Introduction to Optimization with Genetic Algorithm (GA)
PDF
RM 701 Genetic Algorithm and Fuzzy Logic lecture
Genetic algorithm ppt
Genetic Algorithms : A class of Evolutionary Algorithms
0101.genetic algorithm
Genetic algorithm
Genetic Algorithms in Artificial Intelligence
Evolutionary algorithms
Introduction to Optimization with Genetic Algorithm (GA)
RM 701 Genetic Algorithm and Fuzzy Logic lecture

Similar to Genetic Algorithm in Artificial Intelegence.pptx (20)

PPT
4.Genetic-Algorithms.ppt
PDF
Selection in Evolutionary Algorithm
PPTX
Genetic algorithm raktim
PPTX
Genetic algorithm_raktim_IITKGP
PPTX
Genetic algorithm optimization technique.pptx
PPTX
introduction of genetic algorithm
PPT
Genetic-Algorithms forv artificial .ppt
PPT
Genetic-Algorithms.ppt
PPT
AI_PPT_Genetic-Algorithms.ppt
PPT
Genetic-Algorithms.ppt
PPT
Genetic-Algorithms for machine learning and ai.ppt
PPT
Genetic-Algorithms-computersciencepptnew.ppt
PPTX
Genetic Algorithm
PPT
Genetic Algorithms
PPTX
Genetic Algorithm
PDF
Parallel evolutionary approach paper
DOCX
introduction to machine learning unit iV
PPTX
Genetic Algorithm
PPT
Genetic algorithms
PPTX
4.Genetic-Algorithms.ppt
Selection in Evolutionary Algorithm
Genetic algorithm raktim
Genetic algorithm_raktim_IITKGP
Genetic algorithm optimization technique.pptx
introduction of genetic algorithm
Genetic-Algorithms forv artificial .ppt
Genetic-Algorithms.ppt
AI_PPT_Genetic-Algorithms.ppt
Genetic-Algorithms.ppt
Genetic-Algorithms for machine learning and ai.ppt
Genetic-Algorithms-computersciencepptnew.ppt
Genetic Algorithm
Genetic Algorithms
Genetic Algorithm
Parallel evolutionary approach paper
introduction to machine learning unit iV
Genetic Algorithm
Genetic algorithms
Ad

More from usmanahmadawan (11)

PPT
Introduction to C Language chapter 01.ppt
PPTX
Casecading Style Sheets for Hyper Text Transfer Protocol.pptx
PPTX
weak and strong ai in artifitial inteligence.pptx
PPTX
Constraint Specific Problem Problem.pptx
PPT
Agents and its types in Arificial Intelgent.ppt
PPTX
07_JMS_Enterprice Java Beens Technology.pptx
PPTX
Chapter_2 Computer Networks Basics....pptx
PPTX
Chapter_1 Computer Networks Basics....pptx
PPT
Paging technique in memory menagement.ppt
PDF
Computer Crime & Security about computer
PDF
Chap01 (ics12)
Introduction to C Language chapter 01.ppt
Casecading Style Sheets for Hyper Text Transfer Protocol.pptx
weak and strong ai in artifitial inteligence.pptx
Constraint Specific Problem Problem.pptx
Agents and its types in Arificial Intelgent.ppt
07_JMS_Enterprice Java Beens Technology.pptx
Chapter_2 Computer Networks Basics....pptx
Chapter_1 Computer Networks Basics....pptx
Paging technique in memory menagement.ppt
Computer Crime & Security about computer
Chap01 (ics12)
Ad

Recently uploaded (20)

PDF
Skin Care and Cosmetic Ingredients Dictionary ( PDFDrive ).pdf
PDF
Uderstanding digital marketing and marketing stratergie for engaging the digi...
PDF
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 2).pdf
PDF
AI-driven educational solutions for real-life interventions in the Philippine...
PDF
LIFE & LIVING TRILOGY- PART (1) WHO ARE WE.pdf
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
PDF
Empowerment Technology for Senior High School Guide
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
PDF
HVAC Specification 2024 according to central public works department
PPTX
Computer Architecture Input Output Memory.pptx
PDF
What if we spent less time fighting change, and more time building what’s rig...
PPTX
Core Concepts of Personalized Learning and Virtual Learning Environments
PDF
Complications of Minimal Access-Surgery.pdf
PDF
English Textual Question & Ans (12th Class).pdf
PDF
International_Financial_Reporting_Standa.pdf
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PDF
FORM 1 BIOLOGY MIND MAPS and their schemes
PDF
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 1).pdf
PDF
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
Skin Care and Cosmetic Ingredients Dictionary ( PDFDrive ).pdf
Uderstanding digital marketing and marketing stratergie for engaging the digi...
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 2).pdf
AI-driven educational solutions for real-life interventions in the Philippine...
LIFE & LIVING TRILOGY- PART (1) WHO ARE WE.pdf
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
Empowerment Technology for Senior High School Guide
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
HVAC Specification 2024 according to central public works department
Computer Architecture Input Output Memory.pptx
What if we spent less time fighting change, and more time building what’s rig...
Core Concepts of Personalized Learning and Virtual Learning Environments
Complications of Minimal Access-Surgery.pdf
English Textual Question & Ans (12th Class).pdf
International_Financial_Reporting_Standa.pdf
Paper A Mock Exam 9_ Attempt review.pdf.
FORM 1 BIOLOGY MIND MAPS and their schemes
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 1).pdf
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
B.Sc. DS Unit 2 Software Engineering.pptx

Genetic Algorithm in Artificial Intelegence.pptx

  • 2. GENETIC ALGORITHM INTRODUCTION Genetic Algorithm (GA) is a search-based optimization technique based on the principles of Genetics and Natural Selection. It is frequently used to find optimal or near-optimal solutions to difficult problems that otherwise would take a lifetime to solve. ●
  • 3. INTRODUCTION TO OPTIMIZATION ● Optimization is the process of making something better.
  • 4. What are Genetic Algorithms? ● Nature has always been a great source of inspiration to all mankind. Genetic Algorithms (GAs) are search based algorithms based on the concepts of natural selection and genetics. GAs are a subset of a much larger branch of computation known as Evolutionary Computation. ●
  • 5. BASIC TERMINOLOGY ● Population – It is a subset of all the possible (encoded) solutions to the given problem. ● Chromosomes – A chromosome is one such solution to the given problem. (46 in human) ● Gene – A gene is one element position of a chromosome. ● Allele – It is the value a gene takes for a particular chromosome.
  • 8. ● Genotype – Genotype is the population in the computation space. In the computation space, 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 space in which solutions are represented in a way they are represented in real world situations. ● Decoding and Encoding – For simple problems, the phenotype and genotype spaces are the same. However, in most of the cases, the phenotype and genotype spaces are different. Decoding is a process of transforming a solution from the genotype to the phenotype space, while encoding is a process of transforming from the phenotype to genotype space.Decoding should be fast as it is carried out repeatedly in a GA during the fitness value calculation.
  • 10. ● Fitness Function – A fitness function simply defined is a function which takes the solution as input and produces the suitability of the solution as the output. In some cases, the fitness function and the objective function may be the same, while in others it might be different based on the problem. Genetic Operators – These alter the genetic composition of the offspring. These include crossover, mutation, selection, etc. ●
  • 11. Knapsack Problem The knapsack problem or rucksack problem is a problem in combinatorial optimization: Given a set of items, each with a weight and a value, determine the number of each item to include in a collection so that the total weight is less than or equal to a given limit and the total value is as large as possible. It derives its name from the problem faced by someone who is constrained by a fixed-size knapsack and must fill it with the most valuable items.
  • 12. BASIC STRUCTURE OF GENETIC ALGORITHM
  • 14. // Valid Genes const string GENES = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP" "QRSTUVWXYZ 1234567890, .-;:_!"#%&/()=?@${[]}"; // Target string to be generated const string TARGET = "I love Pakistan"; // Create random genes for mutation char mutated_genes() // create chromosome or string of genes string create_gnome() // Class representing individual in population class Individual { public: string chromosome; int fitness; Individual(string chromosome); Individual mate(Individual parent2); int cal_fitness(); };
  • 15. GENOTYPE REPRESENTATION ● BINARY REPRESENTATION ● REAL VALUED REPRESENTATION
  • 16. ● INTEGER REPRESENTATION ● PERMUTATION REPRESENTATION
  • 17. GA- POPULATION ● Population is a subset of solutions in the current generation Set of chromosomes ●
  • 18. ● POPULATION INITIALIZATION 1. RANDOM INITIALIZATION 2. HEURISTIC INITIALIZATION • Random Initialization − Populate the initial population with completely random solutions. • Heuristic initialization − Populate the initial population using a known heuristic for the problem. It has been observed that the entire population should not be initialized using a heuristic, as it can result in the population having similar solutions and very little diversity. It has been experimentally observed that the random solutions are the ones to drive the population to optimality. Therefore, with heuristic initialization, we just seed the population with a couple of good solutions, filling up the rest with random solutions rather than filling the entire population with heuristic- based solutions. It has also been observed that heuristic initialization in some cases, only affects the initial fitness of the population, but in the end, it is the diversity of the solutions which leads to optimality.
  • 19. ● POPULATION MODEL 1. STEADY STATE 2. GENERATIONAL Steady State In steady state GA, we generate one or two offspring in each iteration and they replace one or two individuals from the population. A steady- state GA is also known as Incremental GA. Generational In a generational model, we generate ‘n’ off- springs, where n is the population size, and the entire population is replaced by the new one at the end of the iteration.
  • 20. FITNESS FUNCTION ● Takes a candidate solution to the problem as input and produces as output how “fit” or how “good” the solution is concerning the problem in consideration. In most cases, the fitness function and the objective function are the same as the objective is to either maximize or minimize the given objective function. ●
  • 21. FITNESS FUNCTION • The fitness function should be sufficiently fast to compute. • It must quantitatively measure how fit a given solution is or how fit individuals can be produced from the given solution. • In some cases, calculating the fitness function directly might not be possible due to the inherent complexities of the problem at hand. In such cases, we do fitness approximation to suit our needs.
  • 22. FITNESS FUNCTION • The following image shows the fitness calculation for a solution of the 0/1 Knapsack. It is a simple fitness function that just sums the profit values of the items being picked (which have a 1), scanning the elements from left to right till the knapsack is full.
  • 24. GA- PARENT SELECTION Parent Selection is the process of selecting parents who mate and recombine to create offspring for the next generation. Parent selection is very crucial to the convergence rate of the GA as good parents drive individuals to better and fitter solutions.
  • 25. GA- PARENT SELECTION However, care should be taken to prevent one extremely fit solution from taking over the entire population in a few generations, as this leads to the solutions being close to one another in the solution space thereby leading to a loss of diversity. Maintaining good diversity in the population is extremely crucial for the success of a GA. This taking up of the entire population by one extremely fit solution is known as premature convergence and is an undesirable condition in a GA. Premature convergence occurs when a population converges to a single solution, but that solution isn't as good as
  • 26. GA- PARENT SELECTION • Fitness Proportionate Selection is one of the most popular ways of parent selection. • In this, every individual can become a parent with a probability which is proportional to its fitness. • Therefore, fitter individuals have a higher chance of mating and propagating their features to the next generation. • Therefore, such a selection strategy applies selection pressure to the more fit individuals in the population, evolving into better individuals over time.
  • 27. GA- PARENT 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. • Two implementations of fitness proportionate selection are possible − • Roulette Wheel Selection • 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.
  • 28. GA- PARENT SELECTION ● Fitness Proportionate Selection 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.
  • 29. ● Stochastic Universal Sampling (SUS) 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 highly fit individuals to be chosen at least once.
  • 30. 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.
  • 32. Rank Selection Chromosom e Fitness Value Rank A 8.1 1 B 8.0 4 C 8.05 2 D 7.95 6 E 8.02 3 In this, we remove the concept of a fitness value while selecting a parent. However, every individual in the population is ranked according to their fitness. The selection of the parents depends on the rank of each individual and not the fitness. The higher-ranked individuals are preferred more than the lower-ranked ones.
  • 33. Rank Selection In this strategy, we randomly select parents from the existing population. There is no selection pressure towards fitter individuals and therefore this strategy is usually avoided.
  • 34. GA- CROSSOVER ● one parent is selected and one or more off- springs are produced using the genetic material of the parents One 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 offspring.
  • 35. ● Multi Point Crossover ● Uniform Crossover Multi point crossover is a generalization of the one-point crossover wherein alternating segments are swapped to get new off-springs. In a uniform crossover, we don’t divide the chromosome into segments, rather we treat each gene separately. In this, we essentially flip a coin for each chromosome to decide whether or not it’ll be included in the offspring. We can also bias the coin to one parent, to have more genetic material in the child from that parent.
  • 36. GA- MUTATION -Bit Flip Mutation In simple terms, mutation may be defined as a small random tweak in the chromosome, to get a new solution. Mutation Operators We describe some of the most commonly used mutation operators. Like the crossover operators, this is not an exhaustive list and the GA designer might find a combination of these approaches or a problem-specific mutation operator more useful. In this bit flip mutation, we select one or more random bits and flip them. This is used for binary- encoded GAs.
  • 37. GA- MUTATION -Random Resetting Random Resetting is an extension of the bit flip for the integer representation. In this, a random value from the set of permissible values is assigned to a randomly chosen gene. -Swap Mutation In swap mutation, we select two positions on the chromosome at random and interchange the values. This is common in permutation-based encodings.
  • 38. ● Scramble Mutation ● Inversion Mutation Scramble mutation is also popular with permutation representations. In this, from the entire chromosome, a subset of genes is chosen and their values are scrambled or shuffled randomly. In inversion mutation, we select a subset of genes like in scramble mutation, but instead of shuffling the subset, we merely invert the entire string in the subset.
  • 39. GA- SURVIVOR SELECTION • The Survivor Selection Policy determines which individuals are to be kicked out and which are to be kept in the next generation. • It is crucial as it should ensure that the fitter individuals are not kicked out of the population, while at the same time, diversity should be maintained in the population.
  • 40. GA- SURVIVOR SELECTION Age-Based Selection In Age-Based Selection, we don’t have a notion of fitness. It is based on the premise that each individual is allowed in the population for a finite generation where it is allowed to reproduce, after that, it is kicked out of the population no matter how good its fitness is. For instance, in the following example, the age is the number of generations for which the individual has been in the population. The oldest members of the population i.e. P4 and P7 are kicked out of the population and the ages of the rest of the members are incremented by one.
  • 41. GA- SURVIVOR SELECTION ● Age Based Selection
  • 42. GA- SURVIVOR SELECTION Fitness-Based Selection In this fitness-based selection, the children tend to replace the least fit individuals in the population. The selection of the least fit individuals may be done using a variation of any of the selection policies described before – tournament selection, fitness proportionate selection, etc. For example, in the following image, the children replace the least fit individuals P1 and P10 of the population. It is to be noted that since P1 and P9 have the same fitness value, the decision to remove which individual from the population is arbitrary.
  • 44. GA- TERMINATION CONDITION ● When there has been no improvement in the population for X iterations. When we reach an absolute number of generations. When the objective function value has reached a certain pre-defined value ● ●