Genetic Algorithms Seth Bacon 4/25/2005 Seth Bacon 1
What are Genetic Algorithms � Search algorithm based on selection and genetics � Manipulate a population of candidate solutions to find a good solution 4/25/2005 Seth Bacon 2
What are GAs used for � Approximate solutions for NP- Complete and NP-Hard problems � Artificial Intelligence � Business, engineering and science. 4/25/2005 Seth Bacon 3
The Population � Each member of the population is represented by a “chromosome” � Typically a binary string although they can be more complex � Each chromosome is generated at random (usually) � Each chromosome represents a solution (although not necessarily a good one) 4/25/2005 Seth Bacon 4
Steps of a GA � Generate Initial Population � Run Tournament � Fitness evaluation � Selection � Crossover � Mutation � Reach conclusion 4/25/2005 Seth Bacon 5
Generation of Initial Pop � Must supply a large enough population to create genetic diversity � The longer the chromosome the greater the population � The more “noise” (poor solutions not leading to the good solution) the greater the population “A correctly-sized population is the first step toward competent and efficient genetic algorithms.” – Cantú-Paz 4/25/2005 Seth Bacon 6
Fitness Evaluation � Ranks a chromosome based on it’s performance � Defined by the user � Unique to each problem 4/25/2005 Seth Bacon 7
Selection � Technique for selecting parents of the next generation � Based on rank from fitness � Different selection schemes � Selection of top x- chromosomes � Random selection of top x-chromosomes out of top y-chromosomes (y > x) � Etc. � Try to keep population diverse to protect from a premature poor solutions 4/25/2005 Seth Bacon 8
Crossover � Mating of two different chromosomes � Methods � Randomly chosen crossover point. Everything to the left of the point stays put. Everything to the right switches with the other chromosome. � n-point crossover � Completely random crossover (n = length of chromosome) � Used to “explore the solution space”. � Controlled randomness? 4/25/2005 Seth Bacon 9
Mutation � Randomly changes a value in the chromosome � Used to keep diversity up � However its probability should be kept low or else you are destroying too much information. 4/25/2005 Seth Bacon 10
Reaching a Conclusion � After x number of generations you stop and take out the most robust chromosome. � When improvement of the chromosomes per generation has reached a plateau � When the fittest chromosome has bred all the others out of the population. (Only happens w/o mutation) 4/25/2005 Seth Bacon 11
Parallel GAs � Single-population master-slave GAs � Multiple-population GAs � Fine-grained GAs � Hierarchical hybrid (Not discussed) 4/25/2005 Seth Bacon 12
Master-Slave GAs � Very similar to serial GAs � Slaves calculate the fitness T p = Time to compute a generation � T c = is the communication time between processors � P = the number of processors � T f = the time require for a fitness evaluation � n = size of the population � � T p = P T c + nT f / P 4/25/2005 Seth Bacon 13
Master-Slave GAs � P * = sqrt(nT f /T c ) 4/25/2005 Seth Bacon 14
Master Slave GAs 4/25/2005 Seth Bacon 15
Multiple-Population GAs � Distributed panmictic population � Panmictic - random mating within a breeding population � Only occasional breeding between processors � Each population converges on a solution � Increases diversity 4/25/2005 Seth Bacon 16
Fine Grained GAs � Each processor has its own subpopulation (preferably consisting of only one chromosome) � Fitness and mutation per processor � Selection and mating on a local neighborhood (which overlap) � Diffuses population across all subpopulation “…well suited for massively parallel SIMD computers, but it is also possible to implement them very efficiently on coarse-grain MIMD computers.” – Cantú-Paz 4/25/2005 Seth Bacon 17
Examples � http://cs.felk.cvut.cz/~xobitko/ga/ex ample_f.html � Highly recommend this site let’s you play with a lot of the concepts � http://cs.felk.cvut.cz/~xobitko/ga/pa rams.html 4/25/2005 Seth Bacon 18
Sources � Cantu-Paz, Erick. Efficient and Accurate Parallel Genetic Algorithms. Kluwer Academic Publishers 2000 � Antonette M. Logar, Edward M. Corwin, ans Thomas M. English. Implementation of Massively Parallel Genetic Algorithms On the MasPar MP-1. Department of Computer Science � http://cs.felk.cvut.cz/~xobitko/ga/ 4/25/2005 Seth Bacon 19
Recommend
More recommend