How to Build an Evolutionary Algorithm

Slides:



Advertisements
Similar presentations
Population-based metaheuristics Nature-inspired Initialize a population A new population of solutions is generated Integrate the new population into the.
Advertisements

CS6800 Advanced Theory of Computation
Genetic Algorithms Contents 1. Basic Concepts 2. Algorithm
Genetic Algorithms Representation of Candidate Solutions GAs on primarily two types of representations: –Binary-Coded –Real-Coded Binary-Coded GAs must.
EvoNet Flying Circus Introduction to Evolutionary Computation Brought to you by (insert your name) The EvoNet Training Committee The EvoNet Flying Circus.
Evolutionary Computing A Practical Introduction Presented by Ben Paechter Napier University with thanks to the EvoNet Training Committee and its “Flying.
1 Lecture 8: Genetic Algorithms Contents : Miming nature The steps of the algorithm –Coosing parents –Reproduction –Mutation Deeper in GA –Stochastic Universal.
EvoNet Flying Circus Introduction to Evolutionary Computation Brought to you by (insert your name) The EvoNet Training Committee The EvoNet Flying Circus.
Evolutionary Computational Intelligence
Intro to AI Genetic Algorithm Ruth Bergman Fall 2002.
Evolutionary Computational Intelligence
Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions.
How to Build an Evolutionary Algorithm
Chapter 6: Transform and Conquer Genetic Algorithms The Design and Analysis of Algorithms.
Genetic Algorithms Overview Genetic Algorithms: a gentle introduction –What are GAs –How do they work/ Why? –Critical issues Use in Data Mining –GAs.
Prepared by Barış GÖKÇE 1.  Search Methods  Evolutionary Algorithms (EA)  Characteristics of EAs  Genetic Programming (GP)  Evolutionary Programming.
Evolutionary algorithms
Genetic Algorithm.
Genetic Algorithms and Ant Colony Optimisation
Computer Implementation of Genetic Algorithm
SOFT COMPUTING (Optimization Techniques using GA) Dr. N.Uma Maheswari Professor/CSE PSNA CET.
Intro. ANN & Fuzzy Systems Lecture 36 GENETIC ALGORITHM (1)
Genetic algorithms Prof Kang Li
Genetic Algorithms Michael J. Watts
What is Genetic Programming? Genetic programming is a model of programming which uses the ideas (and some of the terminology) of biological evolution to.
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
Genetic Algorithms Genetic algorithms imitate a natural optimization process: natural selection in evolution. Developed by John Holland at the University.
L ECTURE 3 Notes are modified from EvoNet Flying Circus slides. Found at: www2.cs.uh.edu/~ceick/ai/EC1.ppt.
Introduction to GAs: Genetic Algorithms How to apply GAs to SNA? Thank you for all pictures and information referred.
Introduction to Evolutionary Algorithms Session 4 Jim Smith University of the West of England, UK May/June 2012.
An Introduction to Genetic Algorithms Lecture 2 November, 2010 Ivan Garibay
GENETIC ALGORITHM A biologically inspired model of intelligence and the principles of biological evolution are applied to find solutions to difficult problems.
2005MEE Software Engineering Lecture 11 – Optimisation Techniques.
A New Evolutionary Approach for the Optimal Communication Spanning Tree Problem Sang-Moon Soak Speaker: 洪嘉涓、陳麗徽、李振宇、黃怡靜.
1 Genetic Algorithms and Ant Colony Optimisation.
Why do GAs work? Symbol alphabet : {0, 1, * } * is a wild card symbol that matches both 0 and 1 A schema is a string with fixed and variable symbols 01*1*
Edge Assembly Crossover
Genetic Algorithms Genetic algorithms provide an approach to learning that is based loosely on simulated evolution. Hypotheses are often described by bit.
Genetic Algorithms What is a GA Terms and definitions Basic algorithm.
Genetic Algorithms An Example Genetic Algorithm Procedure GA{ t = 0; Initialize P(t); Evaluate P(t); While (Not Done) { Parents(t) = Select_Parents(P(t));
Genetic Algorithms. 2 Overview Introduction To Genetic Algorithms (GAs) GA Operators and Parameters Genetic Algorithms To Solve The Traveling Salesman.
Chapter 12 FUSION OF FUZZY SYSTEM AND GENETIC ALGORITHMS Chi-Yuan Yeh.
Genetic Algorithms. The Basic Genetic Algorithm 1.[Start] Generate random population of n chromosomes (suitable solutions for the problem) 2.[Fitness]
Waqas Haider Bangyal 1. Evolutionary computing algorithms are very common and used by many researchers in their research to solve the optimization problems.
GENETIC ALGORITHM Basic Algorithm begin set time t = 0;
D Nagesh Kumar, IIScOptimization Methods: M8L5 1 Advanced Topics in Optimization Evolutionary Algorithms for Optimization and Search.
Genetic Algorithms Chapter Description of Presentations
1 Contents 1. Basic Concepts 2. Algorithm 3. Practical considerations Genetic Algorithm (GA)
An Introduction to Genetic Algorithms Lecture 2 November, 2010 Ivan Garibay
Genetic Algorithms. Underlying Concept  Charles Darwin outlined the principle of natural selection.  Natural Selection is the process by which evolution.
Genetic Algorithm Dr. Md. Al-amin Bhuiyan Professor, Dept. of CSE Jahangirnagar University.
Reusable Design of Evolutionary Algorithms. Parallel Cooperative Optimization Research Group Laboratoire d’Informatique Fondamentale de Lille.
Selection and Recombination Temi avanzati di Intelligenza Artificiale - Lecture 4 Prof. Vincenzo Cutello Department of Mathematics and Computer Science.
Artificial Intelligence By Mr. Ejaz CIIT Sahiwal Evolutionary Computation.
Overview Last two weeks we looked at evolutionary algorithms.
Genetic Algorithms. Solution Search in Problem Space.
Genetic Algorithms And other approaches for similar applications Optimization Techniques.
 Presented By: Abdul Aziz Ghazi  Roll No:  Presented to: Sir Harris.
1 Genetic Algorithms Contents 1. Basic Concepts 2. Algorithm 3. Practical considerations.
Chapter 14 Genetic Algorithms.
Genetic Algorithms Author: A.E. Eiben and J.E. Smith
Genetic Algorithms.
CSC 380: Design and Analysis of Algorithms
Artificial Intelligence (CS 370D)
Introduction to Operators
GENETIC ALGORITHMS & MACHINE LEARNING
Genetic Algorithms Chapter 3.
Genetic Algorithm Soft Computing: use of inexact t solution to compute hard task problems. Soft computing tolerant of imprecision, uncertainty, partial.
Population Based Metaheuristics
CSC 380: Design and Analysis of Algorithms
Presentation transcript:

How to Build an Evolutionary Algorithm EvoNet Flying Circus

The Steps In order to build an evolutionary algorithm there are a number of steps that we have to perform: Design a representation Decide how to initialize a population Design a way of mapping a genotype to a phenotype Design a way of evaluating an individual EvoNet Flying Circus

Further Steps Design suitable mutation operator(s) Design suitable recombination operator(s) Decide how to manage our population Decide how to select individuals to be parents Decide how to select individuals to be replaced Decide when to stop the algorithm EvoNet Flying Circus

Designing a Representation We have to come up with a method of representing an individual as a genotype. There are many ways to do this and the way we choose must be relevant to the problem that we are solving. When choosing a representation, we have to bear in mind how the genotypes will be evaluated and what the genetic operators might be. EvoNet Flying Circus

Example: Discrete Representation (Binary alphabet) Representation of an individual can be using discrete values (binary, integer, or any other system with a discrete set of values). Following is an example of binary representation. CHROMOSOME GENE EvoNet Flying Circus

Example: Discrete Representation (Binary alphabet) Phenotype: 8 bits Genotype Integer Real Number Schedule ... Anything? EvoNet Flying Circus

Example: Discrete Representation (Binary alphabet) Phenotype could be integer numbers Genotype: Phenotype: = 163 1*27 + 0*26 + 1*25 + 0*24 + 0*23 + 0*22 + 1*21 + 1*20 = 128 + 32 + 2 + 1 = 163 EvoNet Flying Circus

Example: Discrete Representation (Binary alphabet) Phenotype could be Real Numbers e.g. a number between 2.5 and 20.5 using 8 binary digits Genotype: Phenotype: = 13.9609 EvoNet Flying Circus

Example: Discrete Representation (Binary alphabet) Phenotype could be a Schedule e.g. 8 jobs, 2 time steps Time Step Job 1 2 3 4 5 6 7 8 2 1 Genotype: = Phenotype EvoNet Flying Circus

Example: Real-valued representation A very natural encoding if the solution we are looking for is a list of real-valued numbers, then encode it as a list of real-valued numbers! (i.e., not as a string of 1’s and 0’s) Lots of applications, e.g. parameter optimisation EvoNet Flying Circus

Example: Real valued representation, Representation of individuals Individuals are represented as a tuple of n real-valued numbers: The fitness function maps tuples of real numbers to a single real number: EvoNet Flying Circus

Example: Order based representation Individuals are represented as permutations Used for ordering/sequencing problems Famous example: Travelling Salesman Problem where every city gets a assigned a unique number from 1 to n. A solution could be (5, 4, 2, 1, 3). Needs special operators to make sure the individuals stay valid permutations. EvoNet Flying Circus

Example: Tree-based representation Individuals in the population are trees. Any S-expression can be drawn as a tree of functions and terminals. These functions and terminals can be anything: Functions: sine, cosine, add, sub, and, If-Then-Else, Turn... Terminals: X, Y, 0.456, true, false, p, Sensor0… Example: calculating the area of a circle: * p r EvoNet Flying Circus

Example: Tree-based representation, Closure & Sufficiency We need to specify a function set and a terminal set. It is very desirable that these sets both satisfy closure and sufficiency. By closure we mean that each of the functions in the function set is able to accept as its arguments any value and data-type that may possible be returned by some other function or terminal. By sufficient we mean that there should be a solution in the space of all possible programs constructed from the specified function and terminal sets. EvoNet Flying Circus

Initialization Uniformly on the search space … if possible Binary strings: 0 or 1 with probability 0.5 Real-valued representations: Uniformly on a given interval (OK for bounded values only) Seed the population with previous results or those from heuristics. With care: Possible loss of genetic diversity Possible unrecoverable bias Describe the EA that you used, highlighting novelty or application specific details. This should perhaps include a description of why the particular flavour of EA (ES,EP,GA,GP etc.) was chosen. How did the representation and algorithm chosen reflect the characteristics of the problem e.g. noisy, long time to evaluate solutions, time-varying fitness function etc. EvoNet Flying Circus 5

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 (e.g. robot experiment) You could use approximate fitness - but not for too long EvoNet Flying Circus

More on Evaluation Constraint handling - what if the phenotype breaks some constraint of the problem: penalize the fitness specific evolutionary methods Multi-objective evolutionary optimization gives a set of compromise solutions EvoNet Flying Circus

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 EvoNet Flying Circus

Example: Mutation for Discrete Representation 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 EvoNet Flying Circus

Example: Mutation for real valued representation Perturb values by adding some random noise Often, a Gaussian/normal distribution N(0,) is used, where 0 is the mean value  is the standard deviation and x’i = xi + N(0,i) for each parameter EvoNet Flying Circus

Example: Mutation for order based representation (Swap) Randomly select two different genes and swap them. 7 8 3 4 1 2 6 5 7 8 3 4 6 2 1 5 EvoNet Flying Circus

Example: Mutation for tree based representation Single point mutation selects one node and replaces it with a similar one. * * 2 p * * r r r r EvoNet Flying Circus

Recombination Operators We might have one or more recombination operators for our representation. Some important points are: The child should inherit something from each parent. If this is not the case then the operator is a copy operator. The recombination operator should be designed in conjunction with the representation so that recombination is not always catastrophic Recombination should produce valid chromosomes EvoNet Flying Circus

Example: Recombination for Discrete Representation . . . 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 EvoNet Flying Circus

Example: Recombination for real valued representation Discrete recombination (uniform crossover): given two parents one child is created as follows a d b f c e g h F D G E H C B A EvoNet Flying Circus

Example: Recombination for real valued representation Intermediate recombination (arithmetic crossover): given two parents one child is created as follows a d b f c e F D E C B A  (a+A)/2 (b+B)/2 (c+C)/2 (e+E)/2 (d+D)/2 (f+F)/2 EvoNet Flying Circus

Example: Recombination for order based representation (Order1) Choose an arbitrary part from the first parent and copy this to the first child Copy the remaining genes that are not in the copied part to the first child: starting right from the cut point of the copied part using the order of genes from the second parent wrapping around at the end of the chromosome Repeat this process with the parent roles reversed EvoNet Flying Circus

Example: Recombination for order based representation (Order1) Parent 1 Parent 2 7 8 3 4 1 2 6 5 7 8 1 6 5 2 3 4 7, 3, 4, 6, 5 order 8 1 2 4, 3, 6, 7, 5 Child 1 7 8 5 4 1 2 3 6 EvoNet Flying Circus

Example: Recombination for tree-based representation * 2 * (r * r ) 2 * r r * p + p * (r + (l / r)) r / Two sub-trees are selected for swapping. 1 r EvoNet Flying Circus

Example: Recombination for tree-based representation * * p + p * r / r r * 1 r 2 + * 2 * r / Resulting in 2 new expressions r r 1 r EvoNet Flying Circus

Selection Strategy We want to have some way to ensure that better individuals have a better chance of being parents than less good individuals. This will give us selection pressure which will drive the population forward. We have to be careful to give less good individuals at least some chance of being parents - they may include some useful genetic material. EvoNet Flying Circus

Example: Fitness proportionate selection Expected number of times fi is selected for mating is: Better (fitter) individuals have: more space more chances to be selected Best Worst EvoNet Flying Circus

Example: Fitness proportionate selection Disadvantages: Danger of premature convergence because outstanding individuals take over the entire population very quickly Low selection pressure when fitness values are near each other Behaves differently on transposed versions of the same function EvoNet Flying Circus

Example: Fitness proportionate selection Fitness scaling: A cure for FPS Start with the raw fitness function f. Standardise to ensure: Lower fitness is better fitness. Optimal fitness equals to 0. Adjust to ensure: Fitness ranges from 0 to 1. Normalise to ensure: The sum of the fitness values equals to 1. EvoNet Flying Circus

Example: Tournament selection Select k random individuals, without replacement Take the best k is called the size of the tournament EvoNet Flying Circus

Example: Ranked based selection Individuals are sorted on their fitness value from best to worse. The place in this sorted list is called rank. Instead of using the fitness value of an individual, the rank is used by a function to select individuals from this sorted list. The function is biased towards individuals with a high rank (= good fitness). EvoNet Flying Circus

Example: Ranked based selection Fitness: f(A) = 5, f(B) = 2, f(C) = 19 Rank: r(A) = 2, r(B) = 3, r(C) = 1 Function: h(A) = 3, h(B) = 5, h(C) = 1 Proportion on the roulette wheel: p(A) = 11.1%, p(B) = 33.3%, p(C) = 55.6% EvoNet Flying Circus

Replacement Strategy The selection pressure is also affected by the way in which we decide which members of the population to kill in order to make way for our new individuals. We can use the stochastic selection methods in reverse, or there are some deterministic replacement strategies. Alternatively, many approaches create the next generation from the scratch --- in this approach an individual dies unless it is copied into the new population. EvoNet Flying Circus

Elitism Should fitness constantly improve? Re-introduce in the population previous best-so-far (elitism) or Keep best-so-far in a safe place (preservation) If the work was done with a collaborating industrial partner, then mention them at this stage, and explain how the problem that was tackled fits into their business. Describe the general problem here. Was the aim to solve a new problem, or to attempt to find better solutions than could be found by other methods. Is this a simple optimisation problem or is it desirable to find multiple solutions and present alternatives to the user. EvoNet Flying Circus 2

Recombination vs Mutation modifications depend on the whole population decreasing effects with convergence exploitation operator Mutation mandatory to escape local optima strong causality principle exploration operator More detailed explanation of the actual problem tackled by the EA. Is the problem static or dynamic? Is the evaluation function subjective ? or noisy ? The more diagrams or pictures here the better - show how the EA search works within the context of the application area EvoNet Flying Circus 3

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. EvoNet Flying Circus 6

Algorithm performance Never draw any conclusion from a single run use statistical measures (averages, medians) from a sufficient number of independent runs From the application point of view design perspective: find a very good solution at least once production perspective: find a good solution at almost every run More detailed explanation of the actual problem tackled by the EA. Is the problem static or dynamic? Is the evaluation function subjective ? or noisy ? The more diagrams or pictures here the better - show how the EA search works within the context of the application area EvoNet Flying Circus 3

Algorithm Performance (2) Remember the WYTIWYG principal: “What you test is what you get” - don´t tune algorithm performance on toy data and expect it to work with real data. EvoNet Flying Circus

Key Issues Genetic diversity differences of genetic characteristics in the population loss of genetic diversity = all individuals in the population look alike snowball effect convergence to the nearest local optimum in practice, it is irreversible Elaborate on the potential benefits of using EA based approaches as opposed to other algorithms, especially as opposed to what was being used before. relate this to the characteristics noted above if possible EvoNet Flying Circus 4

Key Issues (2) Exploration vs Exploitation Exploration =sample unknown regions Too much exporation = random search, no convergence Exploitation = try to improve the best-so-far individuals Too much expoitation = local search only … convergence to a local optimum Elaborate on the potential benefits of using EA based approaches as opposed to other algorithms, especially as opposed to what was being used before. relate this to the characteristics noted above if possible EvoNet Flying Circus 4