Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Demonstration1 G As

1,617 views

Published on

Introduction to Genetic Algorithms

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Demonstration1 G As

  1. 1. A Demonstration By: SAFI UR REHMAN PhD Scholar at Department of Mining Engineering GENETIC ALGORITHMS - A GENTLE INTRODUCTION
  2. 2. <ul><li>Definition of Genetic Algorithms </li></ul><ul><li>Basic Idea </li></ul><ul><ul><li>Algorithms </li></ul></ul><ul><ul><li>Optimization </li></ul></ul><ul><li>Background of Genetic Algorithms (GAs) </li></ul><ul><ul><li>Natural world </li></ul></ul><ul><ul><li>Theory of Natural Selection </li></ul></ul><ul><li>Introduction to GAs </li></ul><ul><ul><li>Steps / Flowchart of GAs </li></ul></ul><ul><li>Examples </li></ul><ul><li>Applications of GAs </li></ul>02/05/10 14:07 Genetic Algorithms – A gentle Introduction Overview
  3. 3. <ul><li>“ Genetic algorithms are stochastic search and optimization algorithms based on the mechanics of natural selection and natural genetics subject to survival of the fittest. The algorithm iteratively transforms a set (population) of mathematical objects (string structures), each with an associated fitness value, into a new population of offspring objects using crossover and mutation ” </li></ul><ul><ul><ul><li>Stochastic Search Algorithm </li></ul></ul></ul><ul><ul><ul><li>Natural Selection and Genetics Operators </li></ul></ul></ul><ul><ul><ul><li>Darwin’s Theory (Survival of the Fittest) </li></ul></ul></ul><ul><ul><ul><li>Evolutionary process </li></ul></ul></ul><ul><ul><ul><ul><ul><li>Population </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Crossover </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Mutation </li></ul></ul></ul></ul></ul>02/05/10 14:07 Genetic Algorithms – A gentle Introduction Definition of Genetic Algorithms
  4. 4. <ul><li>Suppose you have a problem </li></ul><ul><li>You don’t know how to solve it </li></ul><ul><li>What can you do? </li></ul><ul><li>Can you use a computer to somehow find a solution for you? </li></ul><ul><li>This would be nice! Can it be done? </li></ul><ul><li>A “BLIND GENERATE AND TEST” Algorithm: </li></ul><ul><li>Repeat </li></ul><ul><ul><li>Generate a random possible solution. </li></ul></ul><ul><ul><li>Test the solution </li></ul></ul><ul><ul><li>and see how good it is </li></ul></ul><ul><li>Until </li></ul><ul><li>solution is good enough </li></ul>02/05/10 14:07 Genetic Algorithms – A gentle Introduction x and y range from 1 – 10 Basic Idea
  5. 5. <ul><li>Can we used this dumb idea? </li></ul><ul><li>Sometimes - yes: </li></ul><ul><ul><li>if there are only a few possible solutions </li></ul></ul><ul><ul><li>and you have enough time </li></ul></ul><ul><ul><li>then such a method could be used </li></ul></ul><ul><li>For most problems - no: </li></ul><ul><ul><li>many possible solutions </li></ul></ul><ul><ul><li>with no time to try them all </li></ul></ul><ul><ul><li>so this method can not be used </li></ul></ul>02/05/10 14:07 Genetic Algorithms – A gentle Introduction if x and y range from 1 – 1000 Basic Idea
  6. 6. <ul><li>A “less-dumb” idea (GA) </li></ul><ul><li>Generate </li></ul><ul><li> a set of random solutions </li></ul><ul><li>Repeat </li></ul><ul><ul><li>Test each solution in the set (rank them) Remove some bad solutions from set Duplicate some good solutions make small changes to some of them </li></ul></ul><ul><li>Until </li></ul><ul><li>best solution is good enough </li></ul>02/05/10 14:07 Genetic Algorithms – A gentle Introduction Basic Idea
  7. 7. local global I am not at the top. My high is better! I am at the top My Height is .. I will continue 02/05/10 14:07 Genetic Algorithms – A gentle Introduction Search for Optimization
  8. 8. 02/05/10 14:07 Genetic Algorithms – A gentle Introduction Optimization
  9. 9. <ul><li>“ Genetic algorithms are stochastic search and optimization algorithms based on the mechanics of natural selection and natural genetics subject to survival of the fittest. The algorithm iteratively transforms a set (population) of mathematical objects (string structures), each with an associated fitness value, into a new population of offspring objects using crossover and mutation ” </li></ul>02/05/10 14:07 Genetic Algorithms – A gentle Introduction Definition of Genetic Algorithms
  10. 10. <ul><li>Genetic Algorithms </li></ul><ul><ul><li>Developed by John Holland in 1975 </li></ul></ul><ul><ul><li>Developed the theoretical basis of GAs through </li></ul></ul><ul><ul><li>Schema theorem </li></ul></ul><ul><ul><li>John Koza, David Goldberg, De Jong </li></ul></ul><ul><li>Natural World Vs Function Optimization </li></ul><ul><ul><li>Natural World </li></ul></ul><ul><ul><li>Diversity Complexity Useful features </li></ul></ul><ul><ul><ul><li>Why it is so ? </li></ul></ul></ul><ul><ul><ul><li>How they come into being? </li></ul></ul></ul><ul><ul><li>Can we imagine natural world as a result of many iterations in a grand optimization algorithm ? </li></ul></ul>02/05/10 14:07 Genetic Algorithms – A gentle Introduction Background of GAs
  11. 11. 02/05/10 14:07 Genetic Algorithms – A gentle Introduction <ul><li>Genes are the basic “instructions” for building an organism </li></ul><ul><li>A chromosome is a sequence of genes </li></ul><ul><li>Biologists distinguish between an organism’s </li></ul><ul><li> genotype (the genes and chromosomes) and its </li></ul><ul><li> phenotype (what the organism actually is like) </li></ul><ul><li>Similarly, “genes” may describe a possible solution to a problem, without actually being the solution </li></ul>Natural World
  12. 12. 02/05/10 14:07 Genetic Algorithms – A gentle Introduction <ul><li>Human body is made up of trillions of cells. Each cell has a core structure (nucleus) that contains chromosomes. </li></ul><ul><li>Each chromosome is made up of tightly coiled strands of deoxyribonucleic acid (DNA). Genes are segments of DNA that determine specific traits, such as eye or hair color. A human have more than 20,000 genes. </li></ul>Natural World
  13. 13. <ul><li>In his book The Origin of Species Charles Darwin outlined the principle of natural selection. </li></ul><ul><li>IF there are organisms that reproduce, and </li></ul><ul><li>IF off springs inherit traits from their progenitors, and </li></ul><ul><li>IF there is variability of traits, and </li></ul><ul><li>IF the environment cannot support all members of a growing population, </li></ul><ul><li>THEN those members of the population with less-adaptive traits (determined by the environment) will die out, and </li></ul><ul><li>THEN those members with more-adaptive traits (determined by the environment) will thrive </li></ul><ul><li>The result is the evolution of species . </li></ul>02/05/10 14:07 Genetic Algorithms – A gentle Introduction “ Select The Best, Discard The Rest” - Survival of the Fittest Theory of Natural Selection
  14. 14. 02/05/10 14:07 Genetic Algorithms – A gentle Introduction <ul><li>Inspired by natural evolution </li></ul><ul><li>Population of individuals </li></ul><ul><ul><li>Individual is feasible solution to problem </li></ul></ul><ul><li>Each individual is characterized by a Fitness function </li></ul><ul><ul><li>Higher fitness is better solution </li></ul></ul><ul><li>Based on their fitness, parents are selected to reproduce offspring for a new generation </li></ul><ul><ul><li>Fitter individuals have more chance to reproduce </li></ul></ul><ul><ul><li>New generation has same size as old generation; old generation dies </li></ul></ul><ul><li>Offspring has combination of properties of two parents </li></ul><ul><li>If well designed, population will converge to optimal solution </li></ul>Introduction to Genetic Algorithms
  15. 15. <ul><li>“ Genetic algorithms are stochastic search and optimization algorithms based on the mechanics of natural selection and natural genetics subject to survival of the fittest. The algorithm iteratively transforms a set (population) of mathematical objects (string structures), each with an associated fitness value, into a new population of offspring objects using crossover and mutation ” </li></ul>02/05/10 14:07 Genetic Algorithms – A gentle Introduction Definition of Genetic Algorithms
  16. 16. Randomly generate a population of potential solutions Evaluate fitness of population members Select two parents from population based on fitness Produce two children Evaluate children Crossover and mutation Is solution &quot;Good“? Output best solution found Multiple Repeats in one iteration No Yes Genetic Algorithms Flowchart
  17. 17. 02/05/10 14:07 Genetic Algorithms – A gentle Introduction Phenotype x Genotype g Gen. Phen. Mapping Population Objective Function f i Population Pop Cross over Mutation Genotype g Initial Population Create an initial population of random individuals
  18. 18. 02/05/10 14:07 Genetic Algorithms – A gentle Introduction <ul><li>Simple problem: max x 2 over {0,1,…,31} </li></ul><ul><li>GA approach: </li></ul><ul><ul><li>Representation: binary code, e.g. 01101  13 </li></ul></ul><ul><ul><li>Population size: 4 </li></ul></ul><ul><ul><li>1-point Crossover, bitwise mutation </li></ul></ul><ul><ul><li>Roulette wheel selection </li></ul></ul><ul><ul><li>Random initialization </li></ul></ul><ul><li>One generational cycle will be shown </li></ul>A Simple Example of Genetic Algorithms 16 8 4 2 1 13 0 1 1 0 1 24 1 1 0 0 0 8 0 1 0 0 0
  19. 19. 02/05/10 14:07 Genetic Algorithms – A gentle Introduction A Simple Example of Genetic Algorithms
  20. 20. 02/05/10 14:07 Genetic Algorithms – A gentle Introduction 2 1 n 3 Area is Proportional to fitness value 4 Roulette Wheel Selection Individual i will have a probability to be chosen
  21. 21. 02/05/10 14:07 Genetic Algorithms – A gentle Introduction 10011 101 11101 000 10011 000 Parent A Child of A and B Parent B Crossover Operator A Simple Example of Genetic Algorithms
  22. 22. 02/05/10 14:07 Genetic Algorithms – A gentle Introduction A Simple Example of Genetic Algorithms
  23. 23. <ul><li>“ Genetic algorithms are stochastic search and optimization algorithms based on the mechanics of natural selection and natural genetics subject to survival of the fittest. The algorithm iteratively transforms a set (population) of mathematical objects (string structures), each with an associated fitness value, into a new population of offspring objects using crossover and mutation ” </li></ul>02/05/10 14:07 Genetic Algorithms – A gentle Introduction Definition of Genetic Algorithms
  24. 24. <ul><li>Function Optimization </li></ul><ul><li>Multi-Objective Optimization </li></ul><ul><li>Combinatorial Optimization </li></ul><ul><li>Economics and Finance </li></ul><ul><li>Resource Minimization </li></ul><ul><li>Scheduling </li></ul><ul><li>Robotics </li></ul><ul><li>Image Processing </li></ul><ul><li>Chemistry, Chemical Engineering </li></ul><ul><li>Networking and Communication </li></ul><ul><li>Constraint Satisfaction Problems (CSP) </li></ul><ul><li>Electrical Engineering and Circuit Design </li></ul><ul><li>Engineering, Structural Optimization, and Design </li></ul>02/05/10 14:07 Genetic Algorithms – A gentle Introduction Applications of Genetic Algorithms
  25. 25. T H A N K S

×