Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSC 380: Design and Analysis of Algorithms

Similar presentations


Presentation on theme: "CSC 380: Design and Analysis of Algorithms"— Presentation transcript:

1 CSC 380: Design and Analysis of Algorithms
Dr. Curry Guinn

2 Quick Info Dr. Curry Guinn CIS 2015 guinnc@uncw.edu
Office Hours: MWF: 10:00am-11:00m and by appointment

3 Outline of today Genetic Algorithms

4 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) Genetic Programming: An Introduction Bart Wyns

5 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 Genetic Programming: An Introduction Bart Wyns

6 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 Genetic Programming: An Introduction Bart Wyns

7 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 Genetic Programming: An Introduction Bart Wyns

8 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 Genetic Programming: An Introduction Bart Wyns

9 The Evolutionary Cycle
Parents Selection Genetic operators Population Example: Mutation Replacement Offspring Genetic Programming: An Introduction Bart Wyns

10 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 Genetic Programming: An Introduction Bart Wyns

11 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 Genetic Programming: An Introduction Bart Wyns

12 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 Genetic Programming: An Introduction Bart Wyns

13 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. Genetic Programming: An Introduction Bart Wyns

14 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 Genetic Programming: An Introduction Bart Wyns

15 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 Genetic Programming: An Introduction Bart Wyns

16 Example of Mutation mutated gene
before after mutated gene Mutation usually happens with probability pm for each gene Genetic Programming: An Introduction Bart Wyns

17 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 Genetic Programming: An Introduction Bart Wyns

18 One-point crossover . . . Whole Population:
Each chromosome is cut into n pieces which are recombined. (Example for n=1) cut cut parents offspring Genetic Programming: An Introduction Bart Wyns

19 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 = and P2 = and the crossover points are between the 2nd and 3rd bits and between the 6th and 7th bits, then the offspring would be O1 = and O2 = Genetic Programming: An Introduction Bart Wyns

20 Uniform crossover Each gene of the offspring is selected randomly from the corresponding genes of the parents. For example, if P1 = and P2 = then the offspring could be O = N.B. One-point and two-point crossover produce two offspring, whilst uniform crossover produces only one Genetic Programming: An Introduction Bart Wyns

21 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. Genetic Programming: An Introduction Bart Wyns 6

22 Membrane Computing

23 For Next Class, Monday Homework


Download ppt "CSC 380: Design and Analysis of Algorithms"

Similar presentations


Ads by Google