SlideShare a Scribd company logo
Amity School of Engineering & Technology
Introduction of Genetic Algorithms
Ritambhara
M.Tech(CSE)
Amity School of Engineering & Technology
• A genetic algorithm (or GA) is a search technique
used in computing to find true or approximate
solutions to optimization and search problems.
• Genetic algorithms are categorized as global search
heuristics.
• Genetic algorithms are a particular class of
evolutionary algorithms that use techniques inspired
by evolutionary biology such as inheritance,
mutation, selection, and crossover (also called
recombination).
What is GA.
Amity School of Engineering & Technology
• Genetic algorithms are implemented as a computer simulation
in which a population of abstract representations (called
chromosomes or the genotype or the genome) of candidate
solutions (called individuals, creatures, or phenotypes) to an
optimization problem evolves toward better solutions.
• Traditionally, solutions are represented in binary as strings of
0s and 1s, but other encodings are also possible.
What is GA
What is GA (Cont..)
• The evolution usually starts from a population of randomly
generated individuals and happens in generations.
• In each generation, the fitness of every individual in the population
is evaluated, multiple individuals are selected from the current
population (based on their fitness), and modified (recombined and
possibly mutated) to form a new population.
• The new population is then used in the next iteration of
the algorithm.
• Commonly, the algorithm terminates when either a
maximum number of generations has been produced, or
a satisfactory fitness level has been reached for the
population.
• If the algorithm has terminated due to a maximum
number of generations, a satisfactory solution may or
may not have been reached.
What is GA (Cont..)
Key terms
• Individual - Any possible solution
• Population - Group of all individuals
• Search Space - All possible solutions to the problem
• Chromosome - Blueprint for an individual
• Trait - Possible aspect (features) of an individual
• Allele - Possible settings of trait (black, blond, etc.)
• Locus - The position of a gene on the chromosome
• Genome - Collection of all chromosomes for an
individual
GA Requirements
• A typical genetic algorithm requires two things to be defined:
• a genetic representation of the solution domain, and
• a fitness function to evaluate the solution domain.
• A standard representation of the solution is as an array of bits. Arrays of other types and
structures can be used in essentially the same way.
• The main property that makes these genetic representations convenient is that their parts are
easily aligned due to their fixed size, that facilitates simple crossover operation
.
• Variable length representations may also be used, but crossover implementation is more
complex in this case.
• Tree-like representations are explored in Genetic programming.
Basics of GA
• The most common type of genetic algorithm works like this:
• a population is created with a group of individuals created randomly.
• The individuals in the population are then evaluated.
• The evaluation function is provided by the programmer and gives the individuals a score
based on how well they perform at the given task.
• Two individuals are then selected based on their fitness, the higher the fitness, the
higher the chance of being selected.
• These individuals then "reproduce" to create one or more offspring, after which the
offspring are mutated randomly.
• This continues until a suitable solution has been found or a certain number of
generations have passed, depending on the needs of the programmer.
General Algorithm for GA
• Initialization
• Initially many individual solutions are randomly generated to
form an initial population. The population size depends on the
nature of the problem, but typically contains several hundreds
or thousands of possible solutions.
• Traditionally, the population is generated randomly, covering
the entire range of possible solutions (the search space).
• Occasionally, the solutions may be "seeded" in areas where
optimal solutions are likely to be found.
• Selection operator:
• Process of selecting two or more parents from the
Population for crossing.
• Purpose of selection is its emphasize filter individuals in
the population in hopes that their off strings have
higher fitness.
• Method: roulette wheel selection, boltzman selection,
tournament selection, rank selection.
Example
Maximize the function f(x)=x^2 with x is interval
[0,31] i.e., x= 0,1,………30,31
1) Generate initial population at random. They ate chromosomes or genotypes.
Eg- 0110 (13), 11000(24), 01000(8), 10011(19)
Calculate fitness
a) Decode into an integer (called phenotypes)
01101 13, 1100024, 010008, 1001119
b) Evaluate fitness, f(x)=x^2
13169, 24526, 864, 19361
2)
Crossover
• the most common type is single point crossover. In single point
crossover, you choose a locus at which you swap the remaining
alleles from on parent to the other. This is complex and is best
understood visually.
• As you can see, the children take one section of the chromosome
from each parent.
• The point at which the chromosome is broken depends on the
randomly selected crossover point.
• This particular method is called single point crossover because
only one crossover point exists. Sometimes only child 1 or child 2
is created, but oftentimes both offspring are created and put into
the new population.
• After selection and crossover, you now have a new population full of
individuals.
• Some are directly copied, and others are produced by crossover.
• In order to ensure that the individuals are not all exactly the same,
you allow for a small chance of mutation.
• You loop through all the alleles of all the individuals, and if that
allele is selected for mutation, you can either change it by a small
amount or replace it with a new value. The probability of mutation is
usually between 1 and 2 tenths of a percent.
• Mutation is fairly simple. You just change the selected alleles based
on what you feel is necessary and move on. Mutation is, however,
vital to ensuring genetic diversity within the population.
Mutation
introduction of genetic algorithm

More Related Content

PPT
Genetic algorithm
PPTX
Genetic Algorithm
PPTX
Genetic Algorithm
PPTX
Genetic algorithms
PDF
Genetic Algorithm
PPTX
Introduction to Genetic Algorithms
PPSX
Genetic_Algorithm_AI(TU)
PPTX
Genetic Algorithm
Genetic algorithm
Genetic Algorithm
Genetic Algorithm
Genetic algorithms
Genetic Algorithm
Introduction to Genetic Algorithms
Genetic_Algorithm_AI(TU)
Genetic Algorithm

What's hot (16)

PPT
Genetic Algorithms - Artificial Intelligence
PPTX
Genetic Algorithms
PDF
RM 701 Genetic Algorithm and Fuzzy Logic lecture
PDF
Genetic algorithm
PPTX
Fuzzy Genetic Algorithm
PPTX
Analysis of Parameter using Fuzzy Genetic Algorithm in E-learning System
PDF
Parallel evolutionary approach paper
PPTX
Genetic Algorithm
PPT
Class GA. Genetic Algorithm,Genetic Algorithm
PPT
Genetic algorithms
PPTX
Genetic Algorithm by Example
PDF
Genetic Algorithms
PPTX
genetic computing
PDF
F043046054
PPT
Chapter11ws sampling
PPTX
Sampling - Stratified vs Cluster
Genetic Algorithms - Artificial Intelligence
Genetic Algorithms
RM 701 Genetic Algorithm and Fuzzy Logic lecture
Genetic algorithm
Fuzzy Genetic Algorithm
Analysis of Parameter using Fuzzy Genetic Algorithm in E-learning System
Parallel evolutionary approach paper
Genetic Algorithm
Class GA. Genetic Algorithm,Genetic Algorithm
Genetic algorithms
Genetic Algorithm by Example
Genetic Algorithms
genetic computing
F043046054
Chapter11ws sampling
Sampling - Stratified vs Cluster
Ad

Similar to introduction of genetic algorithm (20)

PDF
CSA 3702 machine learning module 4
PPT
AI_PPT_Genetic-Algorithms.ppt
PPT
Genetic-Algorithms forv artificial .ppt
PPT
Genetic-Algorithms.ppt
PPT
Genetic-Algorithms.ppt
PPT
Genetic-Algorithms-computersciencepptnew.ppt
PPT
Genetic-Algorithms for machine learning and ai.ppt
PDF
CI_L02_Optimization_ag2_eng.pdf
PDF
Genetic Algorithms in Artificial Intelligence
PPTX
Genetic algorithm raktim
PPTX
Genetic algorithm_raktim_IITKGP
PPT
4.Genetic-Algorithms.ppt
PPTX
Introduction to genetic algorithms
PPTX
CI_L11_Optimization_ag2_eng.pptx
PPTX
MACHINE LEARNING - GENETIC ALGORITHM
PPTX
Genetic algorithms
PPT
0101.genetic algorithm
PPTX
Genetic Algorithms.pptx on dsa , algorithms , genetic algos
PPTX
Introduction to Genetic Algorithm
PPTX
Genetic Algorithm: A Crisp And Concise Introduction [Shakeeb A.]
CSA 3702 machine learning module 4
AI_PPT_Genetic-Algorithms.ppt
Genetic-Algorithms forv artificial .ppt
Genetic-Algorithms.ppt
Genetic-Algorithms.ppt
Genetic-Algorithms-computersciencepptnew.ppt
Genetic-Algorithms for machine learning and ai.ppt
CI_L02_Optimization_ag2_eng.pdf
Genetic Algorithms in Artificial Intelligence
Genetic algorithm raktim
Genetic algorithm_raktim_IITKGP
4.Genetic-Algorithms.ppt
Introduction to genetic algorithms
CI_L11_Optimization_ag2_eng.pptx
MACHINE LEARNING - GENETIC ALGORITHM
Genetic algorithms
0101.genetic algorithm
Genetic Algorithms.pptx on dsa , algorithms , genetic algos
Introduction to Genetic Algorithm
Genetic Algorithm: A Crisp And Concise Introduction [Shakeeb A.]
Ad

Recently uploaded (20)

PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
System and Network Administration Chapter 2
PDF
System and Network Administraation Chapter 3
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
top salesforce developer skills in 2025.pdf
PPTX
ai tools demonstartion for schools and inter college
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
medical staffing services at VALiNTRY
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Nekopoi APK 2025 free lastest update
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Design an Analysis of Algorithms I-SECS-1021-03
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
System and Network Administration Chapter 2
System and Network Administraation Chapter 3
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
top salesforce developer skills in 2025.pdf
ai tools demonstartion for schools and inter college
Odoo Companies in India – Driving Business Transformation.pdf
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
How to Migrate SBCGlobal Email to Yahoo Easily
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Odoo POS Development Services by CandidRoot Solutions
medical staffing services at VALiNTRY
VVF-Customer-Presentation2025-Ver1.9.pptx
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Navsoft: AI-Powered Business Solutions & Custom Software Development
Nekopoi APK 2025 free lastest update

introduction of genetic algorithm

  • 1. Amity School of Engineering & Technology Introduction of Genetic Algorithms Ritambhara M.Tech(CSE)
  • 2. Amity School of Engineering & Technology • A genetic algorithm (or GA) is a search technique used in computing to find true or approximate solutions to optimization and search problems. • Genetic algorithms are categorized as global search heuristics. • Genetic algorithms are a particular class of evolutionary algorithms that use techniques inspired by evolutionary biology such as inheritance, mutation, selection, and crossover (also called recombination). What is GA.
  • 3. Amity School of Engineering & Technology • Genetic algorithms are implemented as a computer simulation in which a population of abstract representations (called chromosomes or the genotype or the genome) of candidate solutions (called individuals, creatures, or phenotypes) to an optimization problem evolves toward better solutions. • Traditionally, solutions are represented in binary as strings of 0s and 1s, but other encodings are also possible. What is GA
  • 4. What is GA (Cont..) • The evolution usually starts from a population of randomly generated individuals and happens in generations. • In each generation, the fitness of every individual in the population is evaluated, multiple individuals are selected from the current population (based on their fitness), and modified (recombined and possibly mutated) to form a new population.
  • 5. • The new population is then used in the next iteration of the algorithm. • Commonly, the algorithm terminates when either a maximum number of generations has been produced, or a satisfactory fitness level has been reached for the population. • If the algorithm has terminated due to a maximum number of generations, a satisfactory solution may or may not have been reached. What is GA (Cont..)
  • 6. Key terms • Individual - Any possible solution • Population - Group of all individuals • Search Space - All possible solutions to the problem • Chromosome - Blueprint for an individual • Trait - Possible aspect (features) of an individual • Allele - Possible settings of trait (black, blond, etc.) • Locus - The position of a gene on the chromosome • Genome - Collection of all chromosomes for an individual
  • 7. GA Requirements • A typical genetic algorithm requires two things to be defined: • a genetic representation of the solution domain, and • a fitness function to evaluate the solution domain. • A standard representation of the solution is as an array of bits. Arrays of other types and structures can be used in essentially the same way. • The main property that makes these genetic representations convenient is that their parts are easily aligned due to their fixed size, that facilitates simple crossover operation . • Variable length representations may also be used, but crossover implementation is more complex in this case. • Tree-like representations are explored in Genetic programming.
  • 8. Basics of GA • The most common type of genetic algorithm works like this: • a population is created with a group of individuals created randomly. • The individuals in the population are then evaluated. • The evaluation function is provided by the programmer and gives the individuals a score based on how well they perform at the given task. • Two individuals are then selected based on their fitness, the higher the fitness, the higher the chance of being selected. • These individuals then "reproduce" to create one or more offspring, after which the offspring are mutated randomly. • This continues until a suitable solution has been found or a certain number of generations have passed, depending on the needs of the programmer.
  • 9. General Algorithm for GA • Initialization • Initially many individual solutions are randomly generated to form an initial population. The population size depends on the nature of the problem, but typically contains several hundreds or thousands of possible solutions. • Traditionally, the population is generated randomly, covering the entire range of possible solutions (the search space). • Occasionally, the solutions may be "seeded" in areas where optimal solutions are likely to be found.
  • 10. • Selection operator: • Process of selecting two or more parents from the Population for crossing. • Purpose of selection is its emphasize filter individuals in the population in hopes that their off strings have higher fitness. • Method: roulette wheel selection, boltzman selection, tournament selection, rank selection.
  • 11. Example Maximize the function f(x)=x^2 with x is interval [0,31] i.e., x= 0,1,………30,31 1) Generate initial population at random. They ate chromosomes or genotypes. Eg- 0110 (13), 11000(24), 01000(8), 10011(19) Calculate fitness a) Decode into an integer (called phenotypes) 01101 13, 1100024, 010008, 1001119 b) Evaluate fitness, f(x)=x^2 13169, 24526, 864, 19361 2)
  • 12. Crossover • the most common type is single point crossover. In single point crossover, you choose a locus at which you swap the remaining alleles from on parent to the other. This is complex and is best understood visually. • As you can see, the children take one section of the chromosome from each parent. • The point at which the chromosome is broken depends on the randomly selected crossover point. • This particular method is called single point crossover because only one crossover point exists. Sometimes only child 1 or child 2 is created, but oftentimes both offspring are created and put into the new population.
  • 13. • After selection and crossover, you now have a new population full of individuals. • Some are directly copied, and others are produced by crossover. • In order to ensure that the individuals are not all exactly the same, you allow for a small chance of mutation. • You loop through all the alleles of all the individuals, and if that allele is selected for mutation, you can either change it by a small amount or replace it with a new value. The probability of mutation is usually between 1 and 2 tenths of a percent. • Mutation is fairly simple. You just change the selected alleles based on what you feel is necessary and move on. Mutation is, however, vital to ensuring genetic diversity within the population. Mutation