1 / 35

introduction to Genetic Algorithms Yonatan Shichel

introduction to Genetic Algorithms Yonatan Shichel. Genetic Algorithms. What are Genetic Algorithms?. Bio-Inspired artificial intelligence class of probabilistic optimization algorithms Well-suited for nonlinear/hard problems with a large search space Developed by John Holland

aluter
Download Presentation

introduction to Genetic Algorithms Yonatan Shichel

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. introduction toGenetic AlgorithmsYonatan Shichel

  2. Genetic Algorithms What are Genetic Algorithms? • Bio-Inspired artificial intelligence class of probabilistic optimization algorithms • Well-suited for nonlinear/hard problems with a large search space • Developed by John Holland • Influenced by Darwin’s Origin of species

  3. Evolution Darwin’s principles • Variety of species individuals within the population • Competition for limited resources • Overproduction of offspring generation • Survival of the fittest Origin of Species, 1859

  4. Evolution How does it work? • Initial population • Variety of shapes, colors, behaviors • Each individual fits differently to the environment

  5. Evolution How does it work? • Initial population • Reproduction • Offspring combines both parents properties • Siblings may differ in properties • Mutations may occur

  6. Evolution How does it work? • Initial population • Reproduction • Limited environmental resources • Only a portion of the individuals survive • Survival chances –according to fitnessmeasure... • ... usually.

  7. Evolution Observations • Changes in the population content • “good” properties are kept, “bad” are distinct • evolutionary pressure

  8. Genetic Algorithms The computational model produce an initial population of individuals while (termination condition not met) do evaluate the fitness of all individuals select fitter individuals for reproduction recombine between individuals mutate individuals

  9. Genetic Algorithms The computational model produce an initial population of individuals while (termination condition not met) do evaluate the fitness of all individuals select fitter individuals for reproduction recombine between individuals mutate individuals

  10. Genetic Algorithms The computational model Gn Gn+1 fitness crossover 55 + 44 = 12 31 95 32 87 12 0 65 mutation 53 2 91 73

  11. GA in action The Knapsack problem (NP) • There are N items: • Each item i has a weight wi • Each item i has a value vi • The knapsack has a limited capacity of W units. • The problem description: • Maximize • While

  12. GA in action The Knapsack problem (NP) • For example: • Knapsack capacity = 100

  13. GA in action Before we begin… • Define the genome encoding • Define the fitness function

  14. GA in action Genome Encoding Bit array: 0 = don’t take the item 1 = take the item (items taken: A, B, E)

  15. GA in action Genome Encoding Bit array: 0 = don’t take the item 1 = take the item (items taken: A, B, C, D, E, F, G, I)

  16. GA in action Fitness Function

  17. GA in action Fitness Function

  18. Genetic Algorithms Fitness Evaluation produce an initial population of individuals while (termination condition not met) do evaluate the fitness of all individuals select fitter individuals for reproduction recombine between individuals mutate individuals

  19. Genetic Algorithms Fitness Evaluation For each individual, calculate the fitness value:

  20. Genetic Algorithms Selection produce an initial population of individuals while (termination condition not met) do evaluate the fitness of all individuals select fitter individuals for reproduction recombine between individuals mutate individuals

  21. Genetic Algorithms Selection • Fitness-proportionate (roulette wheel) • Rank Selection (scaling) • Tournament Selection • …

  22. Genetic Algorithms Crossover produce an initial population of individuals while (termination condition not met) do evaluate the fitness of all individuals select fitter individuals for reproduction recombine between individuals mutate individuals

  23. Genetic Algorithms Crossover Using a crossover probability PC per individual: • Single point crossover • Two/multi points crossover • Uniform / weighted crossover • …

  24. Genetic Algorithms Mutation produce an initial population of individuals while (termination condition not met) do evaluate the fitness of all individuals select fitter individuals for reproduction recombine between individuals mutate individuals

  25. Genetic Algorithms Mutation Using a crossover probability PM per bit: • Bit flip mutation • Bit switch mutation • …

  26. Genetic Algorithms Crossover & Mutation examples

  27. Genetic Algorithms Initial Population produce an initial population of individuals while (termination condition not met) do evaluate the fitness of all individuals select fitter individuals for reproduction recombine between individuals mutate individuals

  28. Genetic Algorithms Initial Population Create a fixed size population using: • Random generated individuals • Individuals resulted from previous evolutionary runs

  29. GA in action Initial Population Example of random population:

  30. Genetic Algorithms Termination Condition produce an initial population of individuals while (termination condition not met) do evaluate the fitness of all individuals select fitter individuals for reproduction recombine between individuals mutate individuals

  31. Genetic Algorithms Termination Condition • When an optimal solution is found • When the results converge to constant value • After a predetermined number of generations

  32. Genetic Algorithms Sample Evolutionary Run • Population size: 100 individuals • Crossover: Single pt., PC=0.9 • Mutation: Bit flip, PM=0.01 • Selection: tournament, groups of 2 • Termination condition: after 100 generations

  33. Genetic Algorithms Sample Evolutionary Run

  34. Genetic Algorithms Conclusions • GA is nondeterministic – two runs may end with different results • There’s no indication whether best individual is optimal • Fitness tends to converge during time

  35. Genetic Algorithms GA variations • Coevolution • Cooperative • Competitive • Parallel GA • Hybrid GA

More Related