SlideShare a Scribd company logo
An overview of Genetic Algorithm
By David Beasley, David R. Bull and Ralph R. Martin

                    090070T – T.P.K. Dahanayakage
                    090150N – K.M.T.V. Ganegedara
Introduction


 Population Evolves
   Natural Selection
   Survival of the fittest


 Applications?
   Computer, Bridges, Garment, etc.
Analogy




 Think about successive generations
Analogy (ctd)




             Super-fit
 Evolve according to environment
Basic Concept


 Set of solutions for a problem
   Each solution – fitness score
 Reproduce a new set of solutions by
  “Cross-breeding”
   Most-fit: get selected
   Least-fit: not selected – die out
 Result?
   Offsprings with characteristics from most-
    fit
What just happened?


 Good characteristics of a generation
  was spread in a successive
  generation
 Most promising areas of solution
  space are searched
Algorithm

BEGIN
      Generate population
      Calculate fitness for each individual
      WHILE NOT CONVERGED DO
      BEGIN
            FOR population_size/2 DO
            BEGIN
                  Select 2 parents for mating
                  Combine and produce an offspring
                  Calculate the fitness for the new individual
                  Insert the offspring to the new generation
            END
      END
END
Lesson on Biology


 Chromosome
   Organized collection of coiled DNA

                      DNA
Fitness function


 Must represent the “fitness to the
  environment” or “ability” of a
  chromosome’s

 Issues of fitness range
   Premature convergence
   Slow finishing
Reproduction


 Selection of parents
   Random
   Favors the fittest


 Crossover
   Single point crossover
      Cut 2 chromosomes at a random point
      Swap over tails to create 2 new chromosomes
Reproduction (ctd)


 Crossover is not the only case!
   0.6 - 1.0 chance
   Otherwise replicate the parent


 Mutation
   Alter the genes of crossover-ed with a
    small probability
Example


 0101001100              1011001001




 0101001001               1011001100


   Before mutation: 0 1 0 1 0 0 1 0 0 1
   After mutation:    0101101001
Convergence


 Fitness of the BEST and AVERAGE
  moves to a global optimum

 Gene is said to have converged
   95% of the population has converged
 Population is said to have converged
   All the genes have converged
Other techniques
“Schemata” and “Scheme”


 Definition of Schema
    Pattern of gene
    String comprise {0,1,#}

 Ex: Chromosome 0110 contains following
  “Schemata”
    #110, #1#0, 01##, etc.

 A chromosome is said to contain a schema if
  it matches a particular schemata
 Order of schema – Number of non-#
  symbols
 Length of schema – Distance
  between outer most non-# symbols.

 Ex: #1#0
Schema Theorem


 Individuals in a population are given reproductive
  trials
 Number of trials α Fitness of an individual
 Higher fitness value -> Good schemata


 Good Schemata receives
  exponentially increasing number of
  trials in successive generations!
Building Block Hypothesis


 Definition
   Schemata short in length and tend to
    improve performance when incorporated
    to an individual

 Properties of a successful coding
  scheme
   Related genes close together
   Little interaction between genes
Exploration and Exploitation


 Exploration
    Exploring unknown areas
 Exploitation
    Utilizing already-learnt to find better solutions

 Tradeoff
    Ex: Random search and Hill climbing

 GA combines both in an optimal way!
Practical Aspects of GA
Parent selection


 Individuals are copied to a “mating
  pool”
   Highly fit – more copies
   Less fit – lesser copies

 How to determine number of copies?
   Explicit fitness remapping
   Implicit fitness remapping
Explicit fitness remapping


      Individual’s fitness
  Average fitness of population

 Issue: Number of copies should be an
  integer
 Solution:
   Fitness scaling
   Fitness windowing
Implicit fitness remapping


 Tournament selection
   2 random individuals
   Copy the one with higher fitness value
    to the mating pool
   Continue until the pool is full
Generation gaps and
steady-state replacement

 Generation gap
   Proportion of individuals in a population
    replaced in each generation

 Steady-state replacement
   Only few individuals are replaced in a
    generation
   Considerations:
      Parent selection – Random, Fitness
      Replacement – Random, Inverse fitness
Thank you


 Q & A Session

More Related Content

What's hot

Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithms
guest9938738
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithms
zamakhan
 
Genetic_Algorithm_AI(TU)
Genetic_Algorithm_AI(TU)Genetic_Algorithm_AI(TU)
Genetic_Algorithm_AI(TU)
Kapil Khatiwada
 

What's hot (20)

Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithms
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithms
 
MACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHMMACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHM
 
Introduction to Genetic algorithms
Introduction to Genetic algorithmsIntroduction to Genetic algorithms
Introduction to Genetic algorithms
 
Ga
GaGa
Ga
 
Introduction to Genetic Algorithms
Introduction to Genetic AlgorithmsIntroduction to Genetic Algorithms
Introduction to Genetic Algorithms
 
Genetic Algorithm by Example
Genetic Algorithm by ExampleGenetic Algorithm by Example
Genetic Algorithm by Example
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
 
RM 701 Genetic Algorithm and Fuzzy Logic lecture
RM 701 Genetic Algorithm and Fuzzy Logic lectureRM 701 Genetic Algorithm and Fuzzy Logic lecture
RM 701 Genetic Algorithm and Fuzzy Logic lecture
 
Genetic_Algorithm_AI(TU)
Genetic_Algorithm_AI(TU)Genetic_Algorithm_AI(TU)
Genetic_Algorithm_AI(TU)
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
 
Evolutionary Algorithms
Evolutionary AlgorithmsEvolutionary Algorithms
Evolutionary Algorithms
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
 
Introduction to Genetic Algorithms
Introduction to Genetic AlgorithmsIntroduction to Genetic Algorithms
Introduction to Genetic Algorithms
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
 
Genetic algorithms in Data Mining
Genetic algorithms in Data MiningGenetic algorithms in Data Mining
Genetic algorithms in Data Mining
 
Genetic Algorithms - Artificial Intelligence
Genetic Algorithms - Artificial IntelligenceGenetic Algorithms - Artificial Intelligence
Genetic Algorithms - Artificial Intelligence
 

Similar to Genetic Algorithm

Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
Ujjawal
 
Genetic-Algorithms.ppt
Genetic-Algorithms.pptGenetic-Algorithms.ppt
Genetic-Algorithms.ppt
Nipun85
 
Chapter09.ppt
Chapter09.pptChapter09.ppt
Chapter09.ppt
butest
 

Similar to Genetic Algorithm (20)

SoftComputing4
SoftComputing4SoftComputing4
SoftComputing4
 
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
 
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
 
Explanation and example of genetic algorithm
Explanation and example of genetic algorithmExplanation and example of genetic algorithm
Explanation and example of genetic algorithm
 
Demonstration1 G As
Demonstration1   G AsDemonstration1   G As
Demonstration1 G As
 
generic optimization techniques lecture slides
generic optimization techniques  lecture slidesgeneric optimization techniques  lecture slides
generic optimization techniques lecture slides
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
 
4.Genetic-Algorithms.ppt
4.Genetic-Algorithms.ppt4.Genetic-Algorithms.ppt
4.Genetic-Algorithms.ppt
 
0101.genetic algorithm
0101.genetic algorithm0101.genetic algorithm
0101.genetic algorithm
 
Genetic-Algorithms.ppt
Genetic-Algorithms.pptGenetic-Algorithms.ppt
Genetic-Algorithms.ppt
 
AI_PPT_Genetic-Algorithms.ppt
AI_PPT_Genetic-Algorithms.pptAI_PPT_Genetic-Algorithms.ppt
AI_PPT_Genetic-Algorithms.ppt
 
Genetic-Algorithms-computersciencepptnew.ppt
Genetic-Algorithms-computersciencepptnew.pptGenetic-Algorithms-computersciencepptnew.ppt
Genetic-Algorithms-computersciencepptnew.ppt
 
Genetic-Algorithms forv artificial .ppt
Genetic-Algorithms forv artificial  .pptGenetic-Algorithms forv artificial  .ppt
Genetic-Algorithms forv artificial .ppt
 
Genetic-Algorithms for machine learning and ai.ppt
Genetic-Algorithms for machine learning and ai.pptGenetic-Algorithms for machine learning and ai.ppt
Genetic-Algorithms for machine learning and ai.ppt
 
Genetic-Algorithms.ppt
Genetic-Algorithms.pptGenetic-Algorithms.ppt
Genetic-Algorithms.ppt
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithms
 
Flowchart of GA
Flowchart of GAFlowchart of GA
Flowchart of GA
 
Chapter09.ppt
Chapter09.pptChapter09.ppt
Chapter09.ppt
 
introduction of genetic algorithm
introduction of genetic algorithmintroduction of genetic algorithm
introduction of genetic algorithm
 

Recently uploaded

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 

Recently uploaded (20)

From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 

Genetic Algorithm

  • 1. An overview of Genetic Algorithm By David Beasley, David R. Bull and Ralph R. Martin 090070T – T.P.K. Dahanayakage 090150N – K.M.T.V. Ganegedara
  • 2. Introduction  Population Evolves  Natural Selection  Survival of the fittest  Applications?  Computer, Bridges, Garment, etc.
  • 3. Analogy  Think about successive generations
  • 4. Analogy (ctd) Super-fit  Evolve according to environment
  • 5. Basic Concept  Set of solutions for a problem  Each solution – fitness score  Reproduce a new set of solutions by “Cross-breeding”  Most-fit: get selected  Least-fit: not selected – die out  Result?  Offsprings with characteristics from most- fit
  • 6. What just happened?  Good characteristics of a generation was spread in a successive generation  Most promising areas of solution space are searched
  • 7. Algorithm BEGIN Generate population Calculate fitness for each individual WHILE NOT CONVERGED DO BEGIN FOR population_size/2 DO BEGIN Select 2 parents for mating Combine and produce an offspring Calculate the fitness for the new individual Insert the offspring to the new generation END END END
  • 8. Lesson on Biology  Chromosome  Organized collection of coiled DNA DNA
  • 9. Fitness function  Must represent the “fitness to the environment” or “ability” of a chromosome’s  Issues of fitness range  Premature convergence  Slow finishing
  • 10. Reproduction  Selection of parents  Random  Favors the fittest  Crossover  Single point crossover  Cut 2 chromosomes at a random point  Swap over tails to create 2 new chromosomes
  • 11. Reproduction (ctd)  Crossover is not the only case!  0.6 - 1.0 chance  Otherwise replicate the parent  Mutation  Alter the genes of crossover-ed with a small probability
  • 12. Example 0101001100 1011001001 0101001001 1011001100 Before mutation: 0 1 0 1 0 0 1 0 0 1 After mutation: 0101101001
  • 13. Convergence  Fitness of the BEST and AVERAGE moves to a global optimum  Gene is said to have converged  95% of the population has converged  Population is said to have converged  All the genes have converged
  • 15. “Schemata” and “Scheme”  Definition of Schema  Pattern of gene  String comprise {0,1,#}  Ex: Chromosome 0110 contains following “Schemata”  #110, #1#0, 01##, etc.  A chromosome is said to contain a schema if it matches a particular schemata
  • 16.  Order of schema – Number of non-# symbols  Length of schema – Distance between outer most non-# symbols.  Ex: #1#0
  • 17. Schema Theorem  Individuals in a population are given reproductive trials  Number of trials α Fitness of an individual  Higher fitness value -> Good schemata  Good Schemata receives exponentially increasing number of trials in successive generations!
  • 18. Building Block Hypothesis  Definition  Schemata short in length and tend to improve performance when incorporated to an individual  Properties of a successful coding scheme  Related genes close together  Little interaction between genes
  • 19. Exploration and Exploitation  Exploration  Exploring unknown areas  Exploitation  Utilizing already-learnt to find better solutions  Tradeoff  Ex: Random search and Hill climbing  GA combines both in an optimal way!
  • 21. Parent selection  Individuals are copied to a “mating pool”  Highly fit – more copies  Less fit – lesser copies  How to determine number of copies?  Explicit fitness remapping  Implicit fitness remapping
  • 22. Explicit fitness remapping Individual’s fitness Average fitness of population  Issue: Number of copies should be an integer  Solution:  Fitness scaling  Fitness windowing
  • 23. Implicit fitness remapping  Tournament selection  2 random individuals  Copy the one with higher fitness value to the mating pool  Continue until the pool is full
  • 24. Generation gaps and steady-state replacement  Generation gap  Proportion of individuals in a population replaced in each generation  Steady-state replacement  Only few individuals are replaced in a generation  Considerations:  Parent selection – Random, Fitness  Replacement – Random, Inverse fitness
  • 25. Thank you  Q & A Session

Editor's Notes

  1. Two parentsAttract matesOther hunting foodChild both characteristicsSuperfit
  2. There should not be too many local maximasThere shouldn’t be a single global maximumTherefore better chromosomes must be closely related.Problem: Preparing a time table.Invalid chromosomes must guide towards valid chromosomes, using fitness valueBetter to invest sub-goals rewarded going for the ultimate goalPremature convergence: Set of highly fit individuals come to dominate the population, making a local maxima. Which in turn make it difficult to converge to more effective solutionSlow finishing: Population might have converged, but might not have found a global maxima
  3. Passing the genes without disruption of crossoverProbability 0.001
  4. Better individuals -> more of their genes to next generationGood schemata - Likelihood of better solution increase
  5. Power of GA – Finding good building blocksInteraction – In a chromosome, contribution of a gene to the fitness value depends on values of other genesIssues: Might not allow closely related genes to be placed togetherInteraction between genes can become high (specially in multi-dimensional data)
  6. AssumptionsPopulation is infiniteFitness function accurately shows the effectiveness of a solutionGenes in a chromosome don’t interact significantlyGenetic drift, mutation rate