1 / 15

Genetic Algorithms: Evolving Solutions to Problems

Genetic Algorithms: Evolving Solutions to Problems. What is a Genetic Algorithm?. Pool of possible solutions Randomly creates initial algorithms Relies on “survival of fittest” Uses mutation and crossover Follows a cycle of generations. What can GAs be used for?.

tamatha
Download Presentation

Genetic Algorithms: Evolving Solutions to Problems

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. Genetic Algorithms: Evolving Solutions to Problems

  2. What is a Genetic Algorithm? • Pool of possible solutions • Randomly creates initial algorithms • Relies on “survival of fittest” • Uses mutation and crossover • Follows a cycle of generations

  3. What can GAs be used for? • Any problem that solutions can be rated for levels of success • Difficult optimization problems including NP-hard and NP-complete • Problems with “building blocks” • Problems with functions that are undefined or don’t exist

  4. What are its accomplishments? • Recreating technology like A-D converter, antennas • Traveling Salesman Problem • Knapsack Problem • Outperforms hill-climbing and simulated-annealing

  5. Hill-Climbing -Kangaroo hops to top of nearest mountain. Simulated-Annealing -Drunken kangaroo hops around randomly, sobers up, and hops uphill. How is it different from other optimization algorithms? Genetic Algorithm -Kangaroos are released and allowed to roam. Flood drowns kangaroos on low hills, survivors multiply.

  6. What process does it follow?

  7. How is a GA set up? • Data for the problem is encoded in each member • Method determined for making initial population • Fitness function is determined • Method of selection is chosen • Genetic operators are chosen • Population size, mutation probability

  8. Million Monkeys Example 1 million monkeys try to write the word: “shakespeare” Data Encoding: string 11 characters long, character set 26 characters(a-z) Create Initial population: 20 random strings of the 26 allowed characters Fitness Function: Difference of each letter from correct letter Genetic Operators: Single Crossover, Mutation Selection: Top 50%

  9. 1st generation xgagqlqohxn 62 uwifceuigqb 65 ghhmvntcqqf 67 tpcahvntllp 72 mulhbkubxrf 76 fihsoghlfoh 77 qdnbnvedhov 79 nmnxovhkaqv 81 tanjxinrcqu 85 ltlboligpsm 89 rtufqrkeuoq 91 rntdphpnxsk 94 mfsqxcuucoj 98 huvbcvwpmpr 104 kcigyfpaxrx 104 vgnqijaqxpw 106 nyljlfhbyxr 108 oxqblcqgylq 113 oavxnemsvha 120 gnqwkqusshy 121 2nd generation ghhmceuigqb 56* nkifceuigqb 58* tpcahvnrcqu 61* wgagqlqohxn 61 uwifceuigqb 65 ghhmvntcqqf 67 tpcahvntllp 72 uwifcehlfoh 72* tanjxincqqf 73* fihsogtcqqf 75* mulhbkubxrf 76 qdnbnvedxrf 76* fihsoghlfoh 77 qdnbnvedhov 79 nmnxovhkaqv 81 xgnjxinrcqu 83* tanjxinrcqu 85 ltlboligpsm 89 mulbnvedhov 90* ltnxovhkaqv 90* Crossover ghhmvntcggf and uwifceuiggb = ghhmceuiggb Mutation xgagglgohxn wgagglgohxn

  10. Fitness • Should reflect potential • May need to provide constraints • Penalties- Subtract from fitness • Repairs- Repairs code outside const. • Decoder- Change way of making algorithm, any individual is valid • May need to be scaled

  11. Selection • Roulette- random by fitness, many spins • Stochastic Universal Sampling- many pointers, One spin • Ranking- proportional by fitness • Tournament- random algorithms compete • Aging- given time to live, no selection • Crowding- new algorithms replace similar old • Multiple copies of same algorithm • Elitism- Best algorithms in next gen.

  12. Crossover and Mutation • Crossover can kill ideal solutions (1*****10) • Single crossover is the worst • Multi-point crossover • Uniform crossover • Genetic Diversity vs. Selective Pressure • Incest Prevention/ Speciation • Mutation better for diversity • May not allow “supers” to breed

  13. Messy Genetic Algorithms • Provide data in an unorganized fashion (position, value) ((5,0) (9,1) (4,1) (2,0)) • Crossover less damaging • More genetic diversity • Over-specification: May give too many values ((3,1) (4, 0) (3,0) (2,1) (1,1)) • Under-specification: May not give enough values ((4,0) (2,1))

  14. Plants and Eaters Example • 16 possible states • Able to “See” square directly in front of it • 4 possible actions( turn left, turn right, move forward, move backward) • Acts on current state and what it can “See” • When it takes an action it sets a new state http://math.hws.edu/xJava/GA/

  15. Questions?

More Related