![Page 1: Genetic Algorithms By: Anna Scheuler and Aaron Smittle](https://reader030.vdocument.in/reader030/viewer/2022032517/56649ca35503460f94962904/html5/thumbnails/1.jpg)
Genetic Algorithms
By: Anna Scheuler and Aaron Smittle
![Page 2: Genetic Algorithms By: Anna Scheuler and Aaron Smittle](https://reader030.vdocument.in/reader030/viewer/2022032517/56649ca35503460f94962904/html5/thumbnails/2.jpg)
● appeared in the 1950s and 1960s● used to find approximations in search
problems● use principles of natural selection to find
an optimized solution● part of evolutionary algorithms
What is it?
![Page 3: Genetic Algorithms By: Anna Scheuler and Aaron Smittle](https://reader030.vdocument.in/reader030/viewer/2022032517/56649ca35503460f94962904/html5/thumbnails/3.jpg)
• subset of evolutionary computation
• generic, population based optimization algorithms
• uses aspects of biology
Evolutionary Algorithms
![Page 4: Genetic Algorithms By: Anna Scheuler and Aaron Smittle](https://reader030.vdocument.in/reader030/viewer/2022032517/56649ca35503460f94962904/html5/thumbnails/4.jpg)
• Gene = smallest unit of datao represented in binary
• Genome = string of genes
• Genome pool = set of genomeso represents the population
• Mutation
• Crossover
• Inheritance
Biology → Genetic Algorithms
![Page 5: Genetic Algorithms By: Anna Scheuler and Aaron Smittle](https://reader030.vdocument.in/reader030/viewer/2022032517/56649ca35503460f94962904/html5/thumbnails/5.jpg)
• Loops through every gene of every member
• Two main classes:o no changeo mutable
The Fitness Function
![Page 6: Genetic Algorithms By: Anna Scheuler and Aaron Smittle](https://reader030.vdocument.in/reader030/viewer/2022032517/56649ca35503460f94962904/html5/thumbnails/6.jpg)
1. Randomly generate an initial population
2. Run fitness function
3. Define parameters for “strong” members
4. Create new generation
5. Introduce mutation
6. Repeat
A simple algorithm runs in O(g*n*m)
The Algorithm
![Page 7: Genetic Algorithms By: Anna Scheuler and Aaron Smittle](https://reader030.vdocument.in/reader030/viewer/2022032517/56649ca35503460f94962904/html5/thumbnails/7.jpg)
• Opponent adaptation
• Towers of Reus
GAs and Gaming
![Page 8: Genetic Algorithms By: Anna Scheuler and Aaron Smittle](https://reader030.vdocument.in/reader030/viewer/2022032517/56649ca35503460f94962904/html5/thumbnails/8.jpg)
• Created in 2010 for Zerg
• user inputs goal and the app generates the build order
Star Craft’s Evolution Chamber
![Page 9: Genetic Algorithms By: Anna Scheuler and Aaron Smittle](https://reader030.vdocument.in/reader030/viewer/2022032517/56649ca35503460f94962904/html5/thumbnails/9.jpg)
● There are 10 cards numbered 1-10.● There must be two piles
○ The sum of the first pile must be as close as possible to 36
○ The product of the second pile must be as close as possible to 360
Card Problem Example
![Page 10: Genetic Algorithms By: Anna Scheuler and Aaron Smittle](https://reader030.vdocument.in/reader030/viewer/2022032517/56649ca35503460f94962904/html5/thumbnails/10.jpg)
● Genome is the way the cards are divided● Algorithm begins by picking two genomes
at random● They are compared with Fitness test● Copy winner into loser and mutate with
random probability at each gene
Card Problem cont.
![Page 11: Genetic Algorithms By: Anna Scheuler and Aaron Smittle](https://reader030.vdocument.in/reader030/viewer/2022032517/56649ca35503460f94962904/html5/thumbnails/11.jpg)
Card Problem Fitness Function
![Page 12: Genetic Algorithms By: Anna Scheuler and Aaron Smittle](https://reader030.vdocument.in/reader030/viewer/2022032517/56649ca35503460f94962904/html5/thumbnails/12.jpg)
● This problem used a Microbial GA○ This type of genetic algorithm features ‘free’
elitism○ Relatively simple core code
Card Problem
![Page 13: Genetic Algorithms By: Anna Scheuler and Aaron Smittle](https://reader030.vdocument.in/reader030/viewer/2022032517/56649ca35503460f94962904/html5/thumbnails/13.jpg)
http://rednuht.org/genetic_cars_2/
An example
![Page 14: Genetic Algorithms By: Anna Scheuler and Aaron Smittle](https://reader030.vdocument.in/reader030/viewer/2022032517/56649ca35503460f94962904/html5/thumbnails/14.jpg)
• The fitness function must be carefully written
• Members can get lost
• Population can converge with similar traits
Issues
![Page 15: Genetic Algorithms By: Anna Scheuler and Aaron Smittle](https://reader030.vdocument.in/reader030/viewer/2022032517/56649ca35503460f94962904/html5/thumbnails/15.jpg)
Questions?