180 likes | 193 Vues
Genetic Algorithms. Siddhartha K. Shakya School of Computing. The Robert Gordon University Aberdeen, UK ss@comp.rgu.ac.uk. What are GAs?. Class of Evolutionary algorithm Based on Darwinian Evolution First proposed by John Holland 1960s. 1970s
E N D
Genetic Algorithms Siddhartha K. Shakya School of Computing. The Robert Gordon University Aberdeen, UK ss@comp.rgu.ac.uk
What are GAs? • Class of Evolutionary algorithm • Based on Darwinian Evolution • First proposed by John Holland 1960s. 1970s • Used to solve wide verity of Optimization problems occurring in engineering Science and Business.
What is an Optimization Problem? • Is to find optimum or near optimum solution from the possible set of candidate solution • Search through big solution space to find best solution • There is some scoring criteria for evaluating goodness of solution also called fitness of solution
a d b e c f Example: Graph colouring problem (GCP) Given a set of colours, GCP is to try and assign Colour to each nodes in such the way that neighbouring nodes will not have same colour
What is a solution and a fitness? • Solution is a set of colours assigned to the nodes of graph. • Fitness is the number of correctly coloured nodes.
a 1 1 1 1 d b e 0 0 0 0 1 0 0 1 1 1 1 1 c 0 0 1 0 0 1 0 0 a f d b e a d c a b e d a f b e c d b e c f c f f What is a solution and a fitness? Given 2 colour Black = 0 White = 1 Fitness = 0 Fitness = 1 Fitness = 6 Fitness = 2
Graph Colouring Problem (GCP) • Looks very simple • But as the size of the graph grows, it becomes increasingly difficult. • Lots of different problems can be see as a GCP • One of the approach to solve GCP is GA
1 1 0 0 1 0 1 1 0 1 0 1 fitness 1 a a a b c d e f d d b b e e 1 0 0 1 1 1 c c f f 1 0 1 0 1 0 6 Representation of Problem in GA • Solution is usually represented as a bit string called chromosome
Work flow of GA • Initialization of parent population • Evaluation • Selection • Crossover/recombination • Mutation • Evaluate child and Go to step 3 until termination criteria satisfies
1 0 1 0 0 1 0 0 1 0 1 1 1 0 1 0 1 1 0 1 0 0 1 1 Initialization of parent population • Generate the M number of solution string known as parent population • Mostly random
a d b e c Parent population fitness f 1 0 1 1 0 1 2 0 0 1 0 1 1 2 1 0 1 0 1 1 4 0 1 0 0 1 1 3 Evaluation • Give fitness to each of the solution
Parent population fitness 1 0 1 1 0 1 2 selection fitness 0 0 1 0 1 1 2 1 0 1 0 1 1 4 1 0 1 0 1 1 4 0 1 0 0 1 1 3 0 1 0 0 1 1 3 0 1 0 0 1 1 3 1 0 1 1 0 1 4 Selection • Fit solution are likely to survive and bad solution are likely to die off • Select some of the best fit chromosomes from parent population according some selection criteria (eg. Roulette wheel selection)
Selected Solution 1 0 1 0 1 1 0 1 0 0 1 1 0 1 0 0 1 1 0 1 1 0 1 0 0 1 0 1 1 1 0 1 0 1 1 0 0 0 1 1 0 0 1 1 1 1 1 1 Crossover/Recombination • Exchange partial solution between pair of selected solution with some probability value eg 70% Child Population After Crossover
Child Population After Crossover 1 0 0 0 1 0 1 1 0 0 0 1 0 0 0 0 1 1 1 1 0 1 1 1 0 0 1 0 1 1 0 0 0 0 0 1 1 1 1 1 0 1 1 1 1 1 1 1 Mutation • Change the value of an allele of solution with some small probability value eg 1% • Motivation is to explore new point in the solution space Child Population After mutation
a d b e c f Replaced Parent Population 1 0 0 0 1 0 0 1 0 1 1 0 0 1 1 0 0 1 1 1 0 1 1 1 Replace with parent population and repeat process • Evaluate child population and replace parent population • Go to selection step and repeat the process until termination criteria satisfies • Eg. Exit after given number of iteration finishes fitness 1 2 4 6
Selected Solution Parent population fitness Crossover Selection 1 0 1 1 0 1 2 0 0 1 0 1 1 2 Repeat iteration 1 0 1 0 1 1 4 After mutation 1 0 fitness 0 0 1 0 1 0 1 0 1 1 a 0 1 0 0 1 1 3 0 1 0 0 1 1 1 b d Mutation e 0 1 0 0 1 2 1 c 0 0 1 1 0 1 1 0 0 1 0 0 1 0 1 1 0 1 1 1 1 0 1 0 0 0 1 1 0 1 0 0 1 1 1 0 0 0 1 1 6 1 1 1 1 1 1 1 1 Given 2 colours (0,1) f 4 Putting Everything together Initialization Evaluation After Crossover
Conclusion • Different selection, crossover and mutation operators exists. • Different GAs designed for different problems • Hybridise GA with other search algorithms • Probabilistic Model Building Genetic Algorithms (PMBGAs)
Links • Introductory tutorial on GA By D.E Goldberg http://online.engr.uiuc.edu/shortcourses/innovation/index.html • GA Archive http://www.aic.nrl.navy.mil/galist/ Introductory Books • David E. Goldberg. 1989. Genetic Algorithms in search, optimization and machine learning. Addison-Wesley.0-201-15767-5 • Mitchell, M. (1998). An Introduction to genetic Algorithm. MIT Press. 0-262-113316-4(HB)