CSC 380: Design and Analysis of Algorithms Dr. Curry Guinn
Quick Info Dr. Curry Guinn CIS 2015 guinnc@uncw.edu www.uncw.edu/people/guinnc 962-7937 Office Hours: MWF: 10:00am-11:00m and by appointment
Outline of today Genetic Algorithms
Genetic Algorithms (GA) A class of probabilistic optimization algorithms Inspired by the biological evolution process Uses concepts of “Natural Selection” and “Genetic Inheritance” (Darwin 1859) Originally developed by John Holland (1975) 18-8-2019 Genetic Programming: An Introduction Bart Wyns
A genetic algorithm maintains a population of candidate solutions for the problem at hand, and makes it evolve by iteratively applying a set of stochastic operators 18-8-2019 Genetic Programming: An Introduction Bart Wyns
Stochastic operators Selection replicates the most successful solutions found in a population at a rate proportional to their relative quality Recombination decomposes two distinct solutions and then randomly mixes their parts to form novel solutions Mutation randomly perturbs a candidate solution 18-8-2019 Genetic Programming: An Introduction Bart Wyns
The Metaphor Nature Genetic Algorithm Individual’s degree of adaptation to its surrounding environment Solutions quality (fitness function) Individuals living in that environment Feasible solutions Environment Optimization problem 18-8-2019 Genetic Programming: An Introduction Bart Wyns
Genetic Programming: An Introduction The Metaphor (cont) Evolution of populations to suit their environment Iteratively applying a set of stochastic operators on a set of feasible solutions A population of organisms (species) A set of feasible solutions Selection, recombination and mutation in nature’s evolutionary process Stochastic operators Nature Genetic Algorithm 18-8-2019 Genetic Programming: An Introduction Bart Wyns
The Evolutionary Cycle Parents Selection Genetic operators Population Example: Mutation Replacement Offspring 18-8-2019 Genetic Programming: An Introduction Bart Wyns
2. Simple Genetic Algorithm produce an initial population of individuals evaluate the fitness of all individuals while termination condition not met do select fitter individuals for reproduction recombine between individuals mutate individuals evaluate the fitness of the modified individuals generate a new population End while 18-8-2019 Genetic Programming: An Introduction Bart Wyns
Evaluating an Individual This is by far the most costly step for real applications => do not re-evaluate unmodified individuals It might be a subroutine, a black-box simulator, or any external process 18-8-2019 Genetic Programming: An Introduction Bart Wyns
Selection Purpose: to focus the search in promising regions of the space Inspiration: Darwin’s “survival of the fittest” Trade-off between exploration and exploitation of the search space 18-8-2019 Genetic Programming: An Introduction Bart Wyns
Problems with FPS Premature convergence Stagnation Assume an individual X with f_i >> f^ but f_i << max is produced in an early generation. As N_i >> 1, the genes of X quickly spread all over the population. At that point, crossover cannot generate any new solutions (only mutation can) and f^ << f_max forever. Stagnation Assume that at the end of a run (i.e. in one of the consecutive generations), all individuals have a relatively high and similar fitness, i.e. f_i is almost f_max for all i Then, N_i is almost 1 for all i and there is virtually no selective pressure. 18-8-2019 Genetic Programming: An Introduction Bart Wyns
Local Tournament Selection Extracts k individuals from the population with uniform probability (without re-insertion) and makes them play a “tournament”, where the probability for an individual to win is generally proportional to its fitness Selection pressure is directly proportional to the number k of participants 18-8-2019 Genetic Programming: An Introduction Bart Wyns
Mutation Operators We might have one or more mutation operators for our representation. Some important points are: At least one mutation operator should allow every part of the search space to be reached The size of mutation is important and should be controllable. Mutation should produce valid chromosomes 18-8-2019 Genetic Programming: An Introduction Bart Wyns
Example of Mutation mutated gene 1 1 1 1 1 1 1 before 1 1 1 0 1 1 1 after mutated gene Mutation usually happens with probability pm for each gene 18-8-2019 Genetic Programming: An Introduction Bart Wyns
Crossover Operators There are three basic types of crossover: One-point crossover Two-point crossover Uniform crossover Some important points are: The child should inherit something from each parent. If this is not the case then the operator is a mutation operator. The recombination operator should be designed in conjunction with the representation so that recombination is not always catastrophic Recombination should produce valid chromosomes 18-8-2019 Genetic Programming: An Introduction Bart Wyns
One-point crossover . . . Whole Population: Each chromosome is cut into n pieces which are recombined. (Example for n=1) cut cut 1 1 1 1 1 1 1 0 0 0 0 0 0 0 parents 1 1 1 0 0 0 0 0 0 0 1 1 1 1 offspring 18-8-2019 Genetic Programming: An Introduction Bart Wyns
Two-point crossover The chromosomes are thought of as rings with the first and last gene connected (i.e., wrap-around structure). The rings are cut in two sites and the resulting sub-rings are swapped. For example, if P1 = 1010101010 and P2 = 1110001110 and the crossover points are between the 2nd and 3rd bits and between the 6th and 7th bits, then the offspring would be O1 = 1110101110 and O2 = 1010001010 18-8-2019 Genetic Programming: An Introduction Bart Wyns
Uniform crossover Each gene of the offspring is selected randomly from the corresponding genes of the parents. For example, if P1 = 1010101010 and P2 = 1110001110 then the offspring could be O = 1110101110 N.B. One-point and two-point crossover produce two offspring, whilst uniform crossover produces only one 18-8-2019 Genetic Programming: An Introduction Bart Wyns
Stopping criterion The optimum is reached! Limit on CPU resources: maximum number of fitness evaluations Limit on the user’s patience: after some generations without improvement Describe how you chose to represent the problem to your algorithm How was the particular representation chosen e.g.. ordering of bits, gray coding, etc. etc. chosen, and what alternatives were evaluated. What were the expected benefits of the proposed scheme? e.g.. smaller search space infeasible solutions avoided etc.., etc.. The introductory slides show very basic forms of 1 point crossover and point mutation, so it may be necessary to have a slide for each of the operators you used, showing how they work. 18-8-2019 Genetic Programming: An Introduction Bart Wyns 6
Membrane Computing
For Next Class, Monday Homework