SlideShare a Scribd company logo
GENETIC
ALGORITHMS
ARTIFICIAL INTELLIGENCE SEMINAR, TEZPUR UNIVERSITY
Kavya Barnadhya Hazarika, CSB15055
MOTIVATION
• Biological Systems are the most highly optimized and adaptive
systems known.
• Evolution produces optimal, adaptive systems. (John Holland,
pioneer of Genetic Algorithms, University of Michigan, 1975)
• Idea is to develop computer algorithms that “Evolve” in ways
that resemble natural selection which can solve complex
problems.
• Genetic Algorithms come in handy to solve NP-Hard problems
where even the most powerful computing systems takes years to
solve.
• Inspired by natural evolution process. “Survival of the Fittest”.
• Failure of Gradient Based Methods: Traditional calculus based methods work
by starting at a random point and moving in the direction of gradient, till we
reach the top of the hill. But, this method only works efficiently for “single-
peaked functions”. In real world situations, we have complex problems,
are made up of many peaks and many valleys, which causes such methods
fail, as they suffer from an inherent tendency of getting stuck at the local
optima.
Classification of Different Search Techniques
SearchOptimization
Calculus Based Techniques
Indirect Method
Direct Method
Guided Random Search
Techniques
Hill Climbing
Simulated Annealing
Evolutionary Algorithms
Genetic Programming
Genetic Algorithms
Enumerative Techniques
Uninformed Search
Informed Search
Ashwani Chandel, Manu Sood, “Searching and Optimization Techniques in
Artificial Intelligence: A Comparative Study & Complexity Analysis”, 2014
WHAT ARE GENETIC
ALGORITHMS?
• Genetic Algorithms(GAs) are search based algorithms under the
branch of computation “Evolutionary Computation”.
• In GAs, we have a population of possible solutions to a the given
problem. These solutions then undergo recombination and
mutation, producing new children, and the process is repeated
over various generations.
• Each individual (or candidate solution) is assigned a fitness value
(based on its objective function value) and the fitter individuals
are given a higher chance to make and yield more “fitter”
individuals.
• The process continues “evolving” better individuals until we
reach a stopping criterion.
RESEMBLANCE TO
LOCAL BEAM SEARCH
• In Local Beam Search, k randomly generated states are initiated
and at each step, all the successors of all k states are generated.
• But it suffers from a lack of diversity among the k states – they
can quickly become concentrated in a small region of the state
space, similar to hill climbing.
• A variant called STOCHASTIC BEAM SEARCH, chooses k
successors at random, with the probability of choosing a given
successor being an increasing function of its value, instead of
choosing the best k from the pool.
• It bears some resemblance to the process of NATURAL
SELECTION, whereby the “successors”(offspring) of a
“state”(organism) populate the next generation according to its
“value” (fitness).
A GENETIC ALGORITM is a
variant of STOCHASTC BEAM
SEARCH in which successor
states are generated by
combining two parent states
rather than by modifying a single
state.
BASIC
TERMINOLOGY
• Population: Subset of
all possible solutions to
the given problem.
• Chromosomes: A
chromosome is one
such solution to the
given problem.
• Gene: A gene is one
element position of a
chromosome.
• Allele: It is the value a
gene takes for a
particular
• Genotype: Population in
computational space.
• Phenotype: Population in real
world.
• Decoding/Encoding: Decoding is a
process of transforming a solution
from genotype to phenotype
space, while encoding is a process
of transforming from the
phenotype to genotype space.
• Fitness Function: Function which
takes the solution as input and
produces the suitability of the
solution as the output.
• Genetic Operators: These alter the
genetic composition of the
offspring. These include crossover,
mutation, selection, etc.
BASIC STRUCTURE
OF A GA
Loop Until
Termination
Criteria
Reached
Population Initialization
Fitness Function Calculation
Crossover
Mutation
Survivor Selection
• Generalized Pseudo-Code for a Genetic Algorithm:
GA()
initialize population
find fitness of population
while(termination criteria is reached) do
parent selection
crossover with probability pc
mutation with probability pm
decode and fitness calculation
survivor selection
find best
return best
GENOTYPE
REPRESENTATION
• One of the most important decisions to make while
implementing a genetic algorithm is deciding the
representation that we will use to represent our
solutions.
• Therefore, choosing a proper representation, having a
proper definition of mappings between the phenotype
and genotype spaces is essential.
• Although representation is highly problem specific,
some of the commonly used representations in genetic
algorithms are:
• Binary Representation
• Real Valued Representation
• Integer Representation
BINARY REPRESENTATION
• One of the most common and simplest used representation in
GAs. Here, the genotype consists of bit strings.
• Mostly used in problems where solution space consists of
Boolean decision variables – YES/NO. For example, in a 0/1
Knapsack Problem. If there are n items, we can represent a
solution by a binary string of n elements, where xth element
tells whether the item x is picked(1) or not(0).
REAL VALUED REPRESENTATION
• For problems where we want to define the genes using continuous rather
than discrete variables, the real valued representation is most natural.
INTEGER
REPRESENTATION
• For discrete valued genes where the solution space might not necessarily be
binary. For example, if we want to encode four directions – North, South,
East, West, we can encode them as (0,1,2,3).
POPULATION
• Population is a subset of solutions in the current generation
(problem). It can be defined as a set of chromosomes.
• Some desired criteria while initializing the population:
• The DIVERSITY of the population should be maintained, otherwise it may
lead to premature convergence.
• The population size shouldn’t be kept very large as it can cause the
algorithm to slow down, while a smaller population might not be enough
for a good mating pool.
• Population Initialization
• Random Initialization – Populate the initial population with completely
random solutions.
• Heuristic Initialization – Populate the initial population using a known
heuristic for the problem.
• Some Observations: It has been observed that the entire
population should not be initialized using a heuristic, as it can
result in less diversity. It has been experimentally observed that
the random solutions drive the population to optimality.
• Population Models: There are two population models widely in
use:
• Steady State – In this GA, we generate one or two off-springs in each
iteration and they replace one or two individuals from the population.
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
new one at the end of the iteration.
FITNESS FUNCTION
• The fitness function simply defined is a function
which takes a candidate solution to the problem
as input and produces as output how “fit” the
solution is respect to the problem in
consideration.
• Calculation of fitness value is done repeatedly in
a GA and therefore it should be sufficiently fast.
• It must quantitatively measure how fit a given
solution is or how fit individuals can be
produced from the given solution.
• The following image
shows the fitness
calculation for a solution
of the 0/1 Knapsack. It is
a simple fitness function
which just sums the
profit values of the items
being picked, scanning
the elements from Left to
Right till the Knapsack is
full.
PARENT SELECTION
• Parent Selection is the process of selecting parents which
mate and recombine to create off-springs for the next
generation.
• It is very crucial to the convergence rate of the GA as good
parents drive individuals to a better and fitter solutions.
• However, an extremely fit solution can take over the entire
population in a few generations, as this leads to solutions
being close to one another in the solution space thereby
leading to loss of diversity.
• This taking up of entire population by one extremely fit
solution is known as Premature Convergence.
FITNESS PROPORTIONATE 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.
• Such a selection strategy applies a selection pressure to the
more fit individuals in the population, evolving better
individuals over time. Works for positive values only.
• Two implementations of fitness proportionate selection are:
• Roulette Wheel Selection
• Stochastic Universal Sampling
ROULETTE WHEEL SELECTION
• In a roulette wheel
selection, the circular
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.
• The region of the wheel
which comes in front of
the fixed point is
chosen as the parent.
ROULETTE WHEEL SELECTION
• A fitter individual has a
greater pie on the
wheel and therefore a
greater chance of
landing in front of the
fixed point.
• Therefore, the
probability of choosing
an individual depends
directly on its fitness.
STOCHASTIC UNIVERSAL SAMPLING
• Instead of having just
one fixed point, we have
multiple fixed points as
shown in the following
image.
• Therefore, all parents
are chosen in just one
spin of the wheel.
• Such a setup
encourages the 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.
• It can even work with
negative fitness values.
RANK SELECTION
• Used mostly when the
individuals in the
population have close
fitness values (this usually
happens at the end of
run).
• This leads to each
individuals having an
almost equal share of the
pie and thus having
approximately the same
probability of getting
selected as parent.
RANK SELECTION
• In this we remove the
concept of a fitness value
while selecting a parent.
• Selection of parents
depends on the rank of
each individual and not
the fitness.
• The high ranked
individuals are preferred
more than the lower
ranked.
CROSSOVER
• In this more than one parent is selected and one
or more off-springs are produced using the
genetic material of parents. It is usually applied
in a GA with a high probability – pc.
• Crossover Operators: These crossover
operators are very generic and GA designer
might choose to implement a problem – specific
crossover operator as well. They are:
• One Point Crossover
• Multi Point Crossover
• Uniform Crossover
• Whole Arithmetic Recombination
ONE POINT CROSSOVER
A random crossover point is selected and tails of its two parents
are swapped to get new off – springs.
MULTI POINT CROSSOVER
Alternating segment are swapped to get new off – springs.
UNIFORM CROSSOVER
No segments. We treat each gene separately.
WHOLE ARITHMETIC RECOMBINATION
Weighted average of two parents are taken by the following
formulae:
• Child1 = a.x + (1-a).y
• Child2 = a.x + (1-a).y, where a is user defined, x(first
parent), y(second parent)
Here, a = 0.5, both children being identical.
MUTATION
• Mutation may be defined as a small random tweak
in the chromosome, to get a new solution. It is used
to maintain and introduce diversity in the genetic
population and is usually applied with a low
probability – pm.
• Mutation Operators: Some of the most commonly
used general mutation operators are:
• Bit Flip Mutation
• Swap Mutation
• Scramble Mutation
• Inversion Mutation
BIT FLIP MUTATION
We select one or more random bits and flip them. Mainly used
for binary encoded GAs.
SWAP MUTATION
We select two positions on the chromosome at random, and
interchange the values. Commonly used in permutation based
encodings.
INVERSION MUTATION
We select a subset of genes like in scramble mutation, but
instead of shuffling the subset, we invert the entire string in the
subset.
SURVIVOR
SELECTION
• Survivor selection policy determines which individuals
are to be kicked out and which are to be kept in the
next generation.
• Some GAs employ Elitism. It means the current fittest
member of the population is always propagated to the
next generation.
• The easiest policy is to kick random members out of
the population, but such an approach has convergence
issues, therefore following strategies are widely used:
• Age Based Selection
• Fitness Based Selection
AGE BASED SELECTION
• No notion of a fitness.
• Based on the premise that
each individual is allowed in
the population for a finite
generation, after that, it is
kicked out of population no
matter how good its fitness is.
• In the following example, the
oldest members of the
population i.e. P4 and P7 are
kicked out of population and
ages of the rest of the
members are incremented by
one.
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 any of the selection
polices – tournament
selection, fitness
proportionate selection, etc.
• In the following example,
the children replace the
least fit individuals P1 and
P10 out of the population.
TERMINATION
CONDITION
• It determines when a GA run will end.
• It is observed initially, the GA progresses very fast with
better solutions coming in very few iterations, but this
tends to saturate in later stages where improvements
are very small.
• Some desired termination conditions:
• 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.
APPLICATION
AREAS
• Genetic Algorithms are primarily used in optimization
problems of various kinds, some of them are:
• Optimization – Most commonly used in optimization
problems wherein we have to maximize or minimize a given
objective function.
• Economics – GAs are also used to characterize various
economic models like Cobweb model, Game Theory
Equilibrium, Asset Pricing, etc.
• Neural Networks
• Image Processing
• Machine Learning
• DNA Analysis
Genetic Algorithms : A class of Evolutionary Algorithms

More Related Content

What's hot

Notes on attention mechanism
Notes on attention mechanismNotes on attention mechanism
Notes on attention mechanism
Khang Pham
 
Attention is All You Need (Transformer)
Attention is All You Need (Transformer)Attention is All You Need (Transformer)
Attention is All You Need (Transformer)
Jeong-Gwan Lee
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
DurgeshPratapSIngh8
 
Explicable Artifical Intelligence for Education (XAIED)
Explicable Artifical Intelligence for Education (XAIED)Explicable Artifical Intelligence for Education (XAIED)
Explicable Artifical Intelligence for Education (XAIED)
Robert Farrow
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
SEKHARREDDYAMBATI
 
Data Science - Part XIV - Genetic Algorithms
Data Science - Part XIV - Genetic AlgorithmsData Science - Part XIV - Genetic Algorithms
Data Science - Part XIV - Genetic Algorithms
Derek Kane
 
Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
Shruti Railkar
 
Hidden Markov Model
Hidden Markov Model Hidden Markov Model
Hidden Markov Model
Mahmoud El-tayeb
 
Ga ppt (1)
Ga ppt (1)Ga ppt (1)
Ga ppt (1)
RAHUL SOLANKI
 
Transformer Zoo
Transformer ZooTransformer Zoo
Transformer Zoo
Grigory Sapunov
 
Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
anas_elf
 
Attention Is All You Need
Attention Is All You NeedAttention Is All You Need
Attention Is All You Need
Illia Polosukhin
 
Lstm
LstmLstm
Introduction to Genetic algorithms
Introduction to Genetic algorithmsIntroduction to Genetic algorithms
Introduction to Genetic algorithms
Akhil Kaushik
 
Interpretable machine learning
Interpretable machine learningInterpretable machine learning
Interpretable machine learning
Sri Ambati
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
Fatemeh Karimi
 
Chaos Analysis
Chaos AnalysisChaos Analysis
Chaos Analysis
Divya Lekha
 
Thomas Wolf "Transfer learning in NLP"
Thomas Wolf "Transfer learning in NLP"Thomas Wolf "Transfer learning in NLP"
Thomas Wolf "Transfer learning in NLP"
Fwdays
 
Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
Alaa Khamis, PhD, SMIEEE
 
Bio Inspired Computing Final Version
Bio Inspired Computing Final VersionBio Inspired Computing Final Version
Bio Inspired Computing Final Version
Thomas Petry
 

What's hot (20)

Notes on attention mechanism
Notes on attention mechanismNotes on attention mechanism
Notes on attention mechanism
 
Attention is All You Need (Transformer)
Attention is All You Need (Transformer)Attention is All You Need (Transformer)
Attention is All You Need (Transformer)
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
 
Explicable Artifical Intelligence for Education (XAIED)
Explicable Artifical Intelligence for Education (XAIED)Explicable Artifical Intelligence for Education (XAIED)
Explicable Artifical Intelligence for Education (XAIED)
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
 
Data Science - Part XIV - Genetic Algorithms
Data Science - Part XIV - Genetic AlgorithmsData Science - Part XIV - Genetic Algorithms
Data Science - Part XIV - Genetic Algorithms
 
Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
 
Hidden Markov Model
Hidden Markov Model Hidden Markov Model
Hidden Markov Model
 
Ga ppt (1)
Ga ppt (1)Ga ppt (1)
Ga ppt (1)
 
Transformer Zoo
Transformer ZooTransformer Zoo
Transformer Zoo
 
Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
 
Attention Is All You Need
Attention Is All You NeedAttention Is All You Need
Attention Is All You Need
 
Lstm
LstmLstm
Lstm
 
Introduction to Genetic algorithms
Introduction to Genetic algorithmsIntroduction to Genetic algorithms
Introduction to Genetic algorithms
 
Interpretable machine learning
Interpretable machine learningInterpretable machine learning
Interpretable machine learning
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
 
Chaos Analysis
Chaos AnalysisChaos Analysis
Chaos Analysis
 
Thomas Wolf "Transfer learning in NLP"
Thomas Wolf "Transfer learning in NLP"Thomas Wolf "Transfer learning in NLP"
Thomas Wolf "Transfer learning in NLP"
 
Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
 
Bio Inspired Computing Final Version
Bio Inspired Computing Final VersionBio Inspired Computing Final Version
Bio Inspired Computing Final Version
 

Similar to Genetic Algorithms : A class of Evolutionary Algorithms

Introduction to genetic algorithms
Introduction to genetic algorithmsIntroduction to genetic algorithms
Introduction to genetic algorithms
shadanalam
 
0101.genetic algorithm
0101.genetic algorithm0101.genetic algorithm
0101.genetic algorithm
Ahmad Almubarrok
 
introduction of genetic algorithm
introduction of genetic algorithmintroduction of genetic algorithm
introduction of genetic algorithm
ritambharaaatre
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithms
Sadhana Singh
 
CSA 3702 machine learning module 4
CSA 3702 machine learning module 4CSA 3702 machine learning module 4
CSA 3702 machine learning module 4
Nandhini S
 
MACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHMMACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHM
Puneet Kulyana
 
Flowchart of ga
Flowchart of gaFlowchart of ga
Flowchart of ga
DEEPIKA T
 
Genetic algorithm raktim
Genetic algorithm raktimGenetic algorithm raktim
Genetic algorithm raktim
Raktim Halder
 
Genetic algorithm_raktim_IITKGP
Genetic algorithm_raktim_IITKGP Genetic algorithm_raktim_IITKGP
Genetic algorithm_raktim_IITKGP
Raktim Halder
 
CI_L02_Optimization_ag2_eng.pdf
CI_L02_Optimization_ag2_eng.pdfCI_L02_Optimization_ag2_eng.pdf
CI_L02_Optimization_ag2_eng.pdf
SantiagoGarridoBulln
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithms
RimpleDhamija
 
CI_L11_Optimization_ag2_eng.pptx
CI_L11_Optimization_ag2_eng.pptxCI_L11_Optimization_ag2_eng.pptx
CI_L11_Optimization_ag2_eng.pptx
SantiagoGarridoBulln
 
Genetic algorithms in Data Mining
Genetic algorithms in Data MiningGenetic algorithms in Data Mining
Genetic algorithms in Data Mining
Atul Khanna
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
SHIMI S L
 
Introduction to Genetic Algorithms 2014
Introduction to Genetic Algorithms 2014Introduction to Genetic Algorithms 2014
Introduction to Genetic Algorithms 2014
Aleksander Stensby
 
4.Genetic-Algorithms.ppt
4.Genetic-Algorithms.ppt4.Genetic-Algorithms.ppt
4.Genetic-Algorithms.ppt
RamjiChaurasiya
 
BGA.pptx
BGA.pptxBGA.pptx
Info to Genetic Algorithms - DC Ruby Users Group 11.10.2016
Info to Genetic Algorithms - DC Ruby Users Group 11.10.2016Info to Genetic Algorithms - DC Ruby Users Group 11.10.2016
Info to Genetic Algorithms - DC Ruby Users Group 11.10.2016
Geoff Harcourt
 
evolutionary algo's.ppt
evolutionary algo's.pptevolutionary algo's.ppt
evolutionary algo's.ppt
SherazAhmed103
 
Genetic Algorithms in Artificial Intelligence
Genetic Algorithms in Artificial IntelligenceGenetic Algorithms in Artificial Intelligence
Genetic Algorithms in Artificial Intelligence
ritwijkp2
 

Similar to Genetic Algorithms : A class of Evolutionary Algorithms (20)

Introduction to genetic algorithms
Introduction to genetic algorithmsIntroduction to genetic algorithms
Introduction to genetic algorithms
 
0101.genetic algorithm
0101.genetic algorithm0101.genetic algorithm
0101.genetic algorithm
 
introduction of genetic algorithm
introduction of genetic algorithmintroduction of genetic algorithm
introduction of genetic algorithm
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithms
 
CSA 3702 machine learning module 4
CSA 3702 machine learning module 4CSA 3702 machine learning module 4
CSA 3702 machine learning module 4
 
MACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHMMACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHM
 
Flowchart of ga
Flowchart of gaFlowchart of ga
Flowchart of ga
 
Genetic algorithm raktim
Genetic algorithm raktimGenetic algorithm raktim
Genetic algorithm raktim
 
Genetic algorithm_raktim_IITKGP
Genetic algorithm_raktim_IITKGP Genetic algorithm_raktim_IITKGP
Genetic algorithm_raktim_IITKGP
 
CI_L02_Optimization_ag2_eng.pdf
CI_L02_Optimization_ag2_eng.pdfCI_L02_Optimization_ag2_eng.pdf
CI_L02_Optimization_ag2_eng.pdf
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithms
 
CI_L11_Optimization_ag2_eng.pptx
CI_L11_Optimization_ag2_eng.pptxCI_L11_Optimization_ag2_eng.pptx
CI_L11_Optimization_ag2_eng.pptx
 
Genetic algorithms in Data Mining
Genetic algorithms in Data MiningGenetic algorithms in Data Mining
Genetic algorithms in Data Mining
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
 
Introduction to Genetic Algorithms 2014
Introduction to Genetic Algorithms 2014Introduction to Genetic Algorithms 2014
Introduction to Genetic Algorithms 2014
 
4.Genetic-Algorithms.ppt
4.Genetic-Algorithms.ppt4.Genetic-Algorithms.ppt
4.Genetic-Algorithms.ppt
 
BGA.pptx
BGA.pptxBGA.pptx
BGA.pptx
 
Info to Genetic Algorithms - DC Ruby Users Group 11.10.2016
Info to Genetic Algorithms - DC Ruby Users Group 11.10.2016Info to Genetic Algorithms - DC Ruby Users Group 11.10.2016
Info to Genetic Algorithms - DC Ruby Users Group 11.10.2016
 
evolutionary algo's.ppt
evolutionary algo's.pptevolutionary algo's.ppt
evolutionary algo's.ppt
 
Genetic Algorithms in Artificial Intelligence
Genetic Algorithms in Artificial IntelligenceGenetic Algorithms in Artificial Intelligence
Genetic Algorithms in Artificial Intelligence
 

Recently uploaded

National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 

Recently uploaded (20)

National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 

Genetic Algorithms : A class of Evolutionary Algorithms

  • 1. GENETIC ALGORITHMS ARTIFICIAL INTELLIGENCE SEMINAR, TEZPUR UNIVERSITY Kavya Barnadhya Hazarika, CSB15055
  • 2.
  • 4. • Biological Systems are the most highly optimized and adaptive systems known. • Evolution produces optimal, adaptive systems. (John Holland, pioneer of Genetic Algorithms, University of Michigan, 1975) • Idea is to develop computer algorithms that “Evolve” in ways that resemble natural selection which can solve complex problems. • Genetic Algorithms come in handy to solve NP-Hard problems where even the most powerful computing systems takes years to solve. • Inspired by natural evolution process. “Survival of the Fittest”.
  • 5. • Failure of Gradient Based Methods: Traditional calculus based methods work by starting at a random point and moving in the direction of gradient, till we reach the top of the hill. But, this method only works efficiently for “single- peaked functions”. In real world situations, we have complex problems, are made up of many peaks and many valleys, which causes such methods fail, as they suffer from an inherent tendency of getting stuck at the local optima.
  • 6. Classification of Different Search Techniques SearchOptimization Calculus Based Techniques Indirect Method Direct Method Guided Random Search Techniques Hill Climbing Simulated Annealing Evolutionary Algorithms Genetic Programming Genetic Algorithms Enumerative Techniques Uninformed Search Informed Search Ashwani Chandel, Manu Sood, “Searching and Optimization Techniques in Artificial Intelligence: A Comparative Study & Complexity Analysis”, 2014
  • 8. • Genetic Algorithms(GAs) are search based algorithms under the branch of computation “Evolutionary Computation”. • In GAs, we have a population of possible solutions to a the given problem. These solutions then undergo recombination and mutation, producing new children, and the process is repeated over various generations. • Each individual (or candidate solution) is assigned a fitness value (based on its objective function value) and the fitter individuals are given a higher chance to make and yield more “fitter” individuals. • The process continues “evolving” better individuals until we reach a stopping criterion.
  • 10. • In Local Beam Search, k randomly generated states are initiated and at each step, all the successors of all k states are generated. • But it suffers from a lack of diversity among the k states – they can quickly become concentrated in a small region of the state space, similar to hill climbing. • A variant called STOCHASTIC BEAM SEARCH, chooses k successors at random, with the probability of choosing a given successor being an increasing function of its value, instead of choosing the best k from the pool. • It bears some resemblance to the process of NATURAL SELECTION, whereby the “successors”(offspring) of a “state”(organism) populate the next generation according to its “value” (fitness).
  • 11. A GENETIC ALGORITM is a variant of STOCHASTC BEAM SEARCH in which successor states are generated by combining two parent states rather than by modifying a single state.
  • 13. • Population: Subset of all possible solutions to the given problem. • Chromosomes: A chromosome is one such solution to the given problem. • Gene: A gene is one element position of a chromosome. • Allele: It is the value a gene takes for a particular
  • 14. • Genotype: Population in computational space. • Phenotype: Population in real world. • Decoding/Encoding: Decoding is a process of transforming a solution from genotype to phenotype space, while encoding is a process of transforming from the phenotype to genotype space. • Fitness Function: Function which takes the solution as input and produces the suitability of the solution as the output. • Genetic Operators: These alter the genetic composition of the offspring. These include crossover, mutation, selection, etc.
  • 16. Loop Until Termination Criteria Reached Population Initialization Fitness Function Calculation Crossover Mutation Survivor Selection
  • 17. • Generalized Pseudo-Code for a Genetic Algorithm: GA() initialize population find fitness of population while(termination criteria is reached) do parent selection crossover with probability pc mutation with probability pm decode and fitness calculation survivor selection find best return best
  • 19. • One of the most important decisions to make while implementing a genetic algorithm is deciding the representation that we will use to represent our solutions. • Therefore, choosing a proper representation, having a proper definition of mappings between the phenotype and genotype spaces is essential. • Although representation is highly problem specific, some of the commonly used representations in genetic algorithms are: • Binary Representation • Real Valued Representation • Integer Representation
  • 20. BINARY REPRESENTATION • One of the most common and simplest used representation in GAs. Here, the genotype consists of bit strings. • Mostly used in problems where solution space consists of Boolean decision variables – YES/NO. For example, in a 0/1 Knapsack Problem. If there are n items, we can represent a solution by a binary string of n elements, where xth element tells whether the item x is picked(1) or not(0).
  • 21. REAL VALUED REPRESENTATION • For problems where we want to define the genes using continuous rather than discrete variables, the real valued representation is most natural. INTEGER REPRESENTATION • For discrete valued genes where the solution space might not necessarily be binary. For example, if we want to encode four directions – North, South, East, West, we can encode them as (0,1,2,3).
  • 23. • Population is a subset of solutions in the current generation (problem). It can be defined as a set of chromosomes. • Some desired criteria while initializing the population: • The DIVERSITY of the population should be maintained, otherwise it may lead to premature convergence. • The population size shouldn’t be kept very large as it can cause the algorithm to slow down, while a smaller population might not be enough for a good mating pool. • Population Initialization • Random Initialization – Populate the initial population with completely random solutions. • Heuristic Initialization – Populate the initial population using a known heuristic for the problem.
  • 24. • Some Observations: It has been observed that the entire population should not be initialized using a heuristic, as it can result in less diversity. It has been experimentally observed that the random solutions drive the population to optimality. • Population Models: There are two population models widely in use: • Steady State – In this GA, we generate one or two off-springs in each iteration and they replace one or two individuals from the population. 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 new one at the end of the iteration.
  • 26. • The fitness function simply defined is a function which takes a candidate solution to the problem as input and produces as output how “fit” the solution is respect to the problem in consideration. • Calculation of fitness value is done repeatedly in a GA and therefore it should be sufficiently fast. • It must quantitatively measure how fit a given solution is or how fit individuals can be produced from the given solution.
  • 27. • The following image shows the fitness calculation for a solution of the 0/1 Knapsack. It is a simple fitness function which just sums the profit values of the items being picked, scanning the elements from Left to Right till the Knapsack is full.
  • 29. • Parent Selection is the process of selecting parents which mate and recombine to create off-springs for the next generation. • It is very crucial to the convergence rate of the GA as good parents drive individuals to a better and fitter solutions. • However, an extremely fit solution can take over the entire population in a few generations, as this leads to solutions being close to one another in the solution space thereby leading to loss of diversity. • This taking up of entire population by one extremely fit solution is known as Premature Convergence.
  • 30. FITNESS PROPORTIONATE 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. • Such a selection strategy applies a selection pressure to the more fit individuals in the population, evolving better individuals over time. Works for positive values only. • Two implementations of fitness proportionate selection are: • Roulette Wheel Selection • Stochastic Universal Sampling
  • 31. ROULETTE WHEEL SELECTION • In a roulette wheel selection, the circular 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. • The region of the wheel which comes in front of the fixed point is chosen as the parent.
  • 32. ROULETTE WHEEL SELECTION • A fitter individual has a greater pie on the wheel and therefore a greater chance of landing in front of the fixed point. • Therefore, the probability of choosing an individual depends directly on its fitness.
  • 33. STOCHASTIC UNIVERSAL SAMPLING • Instead of having just one fixed point, we have multiple fixed points as shown in the following image. • Therefore, all parents are chosen in just one spin of the wheel. • Such a setup encourages the highly fit individuals to be chosen at least once.
  • 34. 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. • It can even work with negative fitness values.
  • 35. RANK SELECTION • Used mostly when the individuals in the population have close fitness values (this usually happens at the end of run). • This leads to each individuals having an almost equal share of the pie and thus having approximately the same probability of getting selected as parent.
  • 36. RANK SELECTION • In this we remove the concept of a fitness value while selecting a parent. • Selection of parents depends on the rank of each individual and not the fitness. • The high ranked individuals are preferred more than the lower ranked.
  • 38. • In this more than one parent is selected and one or more off-springs are produced using the genetic material of parents. It is usually applied in a GA with a high probability – pc. • Crossover Operators: These crossover operators are very generic and GA designer might choose to implement a problem – specific crossover operator as well. They are: • One Point Crossover • Multi Point Crossover • Uniform Crossover • Whole Arithmetic Recombination
  • 39. ONE POINT CROSSOVER A random crossover point is selected and tails of its two parents are swapped to get new off – springs.
  • 40. MULTI POINT CROSSOVER Alternating segment are swapped to get new off – springs.
  • 41. UNIFORM CROSSOVER No segments. We treat each gene separately.
  • 42. WHOLE ARITHMETIC RECOMBINATION Weighted average of two parents are taken by the following formulae: • Child1 = a.x + (1-a).y • Child2 = a.x + (1-a).y, where a is user defined, x(first parent), y(second parent) Here, a = 0.5, both children being identical.
  • 44. • Mutation may be defined as a small random tweak in the chromosome, to get a new solution. It is used to maintain and introduce diversity in the genetic population and is usually applied with a low probability – pm. • Mutation Operators: Some of the most commonly used general mutation operators are: • Bit Flip Mutation • Swap Mutation • Scramble Mutation • Inversion Mutation
  • 45. BIT FLIP MUTATION We select one or more random bits and flip them. Mainly used for binary encoded GAs.
  • 46. SWAP MUTATION We select two positions on the chromosome at random, and interchange the values. Commonly used in permutation based encodings.
  • 47. INVERSION MUTATION We select a subset of genes like in scramble mutation, but instead of shuffling the subset, we invert the entire string in the subset.
  • 49. • Survivor selection policy determines which individuals are to be kicked out and which are to be kept in the next generation. • Some GAs employ Elitism. It means the current fittest member of the population is always propagated to the next generation. • The easiest policy is to kick random members out of the population, but such an approach has convergence issues, therefore following strategies are widely used: • Age Based Selection • Fitness Based Selection
  • 50. AGE BASED SELECTION • No notion of a fitness. • Based on the premise that each individual is allowed in the population for a finite generation, after that, it is kicked out of population no matter how good its fitness is. • In the following example, the oldest members of the population i.e. P4 and P7 are kicked out of population and ages of the rest of the members are incremented by one.
  • 51. 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 any of the selection polices – tournament selection, fitness proportionate selection, etc. • In the following example, the children replace the least fit individuals P1 and P10 out of the population.
  • 53. • It determines when a GA run will end. • It is observed initially, the GA progresses very fast with better solutions coming in very few iterations, but this tends to saturate in later stages where improvements are very small. • Some desired termination conditions: • 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.
  • 55. • Genetic Algorithms are primarily used in optimization problems of various kinds, some of them are: • Optimization – Most commonly used in optimization problems wherein we have to maximize or minimize a given objective function. • Economics – GAs are also used to characterize various economic models like Cobweb model, Game Theory Equilibrium, Asset Pricing, etc. • Neural Networks • Image Processing • Machine Learning • DNA Analysis