1 Lecture 8: Genetic Algorithms Contents : Miming nature The steps of the algorithm –Coosing parents –Reproduction –Mutation Deeper in GA –Stochastic Universal.

Slides:



Advertisements
Similar presentations
Local Search Algorithms
Advertisements

Genetic Algorithm.
Using Parallel Genetic Algorithm in a Predictive Job Scheduling
Student : Mateja Saković 3015/2011.  Genetic algorithms are based on evolution and natural selection  Evolution is any change across successive generations.
Genetic Algorithms Contents 1. Basic Concepts 2. Algorithm
Tuesday, May 14 Genetic Algorithms Handouts: Lecture Notes Question: when should there be an additional review session?
CPSC 322, Lecture 16Slide 1 Stochastic Local Search Variants Computer Science cpsc322, Lecture 16 (Textbook Chpt 4.8) February, 9, 2009.
1 IOE/MFG 543 Chapter 14: General purpose procedures for scheduling in practice Section 14.5: Local search – Genetic Algorithms.
COMP305. Part II. Genetic Algorithms. Genetic Algorithms.
Data Mining CS 341, Spring 2007 Genetic Algorithm.
A new crossover technique in Genetic Programming Janet Clegg Intelligent Systems Group Electronics Department.
Introduction to Genetic Algorithms Yonatan Shichel.
COMP305. Part II. Genetic Algorithms. Genetic Algorithms.
COMP305. Part II. Genetic Algorithms. Genetic Algorithms.
Intro to AI Genetic Algorithm Ruth Bergman Fall 2002.
Chapter 14 Genetic Algorithms.
Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions.
7/2/2015Intelligent Systems and Soft Computing1 Lecture 9 Evolutionary Computation: Genetic algorithms Introduction, or can evolution be intelligent? Introduction,
Intro to AI Genetic Algorithm Ruth Bergman Fall 2004.
Chapter 6: Transform and Conquer Genetic Algorithms The Design and Analysis of Algorithms.
Genetic Programming.
Genetic Algorithm.
Evolutionary Intelligence
© Negnevitsky, Pearson Education, CSC 4510 – Machine Learning Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University.
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
CS 484 – Artificial Intelligence1 Announcements Lab 3 due Tuesday, November 6 Homework 6 due Tuesday, November 6 Lab 4 due Thursday, November 8 Current.
Lecture 8: 24/5/1435 Genetic Algorithms Lecturer/ Kawther Abas 363CS – Artificial Intelligence.
Zorica Stanimirović Faculty of Mathematics, University of Belgrade
Boltzmann Machine (BM) (§6.4) Hopfield model + hidden nodes + simulated annealing BM Architecture –a set of visible nodes: nodes can be accessed from outside.
An Introduction to Genetic Algorithms Lecture 2 November, 2010 Ivan Garibay
1 Chapter 14 Genetic Algorithms. 2 Chapter 14 Contents (1) l Representation l The Algorithm l Fitness l Crossover l Mutation l Termination Criteria l.
GENETIC ALGORITHM A biologically inspired model of intelligence and the principles of biological evolution are applied to find solutions to difficult problems.
Derivative Free Optimization G.Anuradha. Contents Genetic Algorithm Simulated Annealing Random search method Downhill simplex method.
© Negnevitsky, Pearson Education, Lecture 9 Evolutionary Computation: Genetic algorithms Introduction, or can evolution be intelligent? Introduction,
2005MEE Software Engineering Lecture 11 – Optimisation Techniques.
 Negnevitsky, Pearson Education, Lecture 9 Evolutionary Computation: Genetic algorithms n Introduction, or can evolution be intelligent? n Simulation.
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 What is a GA Terms and definitions Basic algorithm.
ECE 103 Engineering Programming Chapter 52 Generic Algorithm Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE 103 material.
MAE 552 Heuristic Optimization Instructor: John Eddy Lecture #12 2/20/02 Evolutionary Algorithms.
EE749 I ntroduction to Artificial I ntelligence Genetic Algorithms The Simple GA.
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 MITM613 (Intelligent Systems).
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
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*
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.
Artificial Intelligence By Mr. Ejaz CIIT Sahiwal Evolutionary Computation.
1 Comparative Study of two Genetic Algorithms Based Task Allocation Models in Distributed Computing System Oğuzhan TAŞ 2005.
Genetic Algorithms. Solution Search in Problem Space.
Genetic Algorithms And other approaches for similar applications Optimization Techniques.
Genetic Algorithm. Outline Motivation Genetic algorithms An illustrative example Hypothesis space search.
 Presented By: Abdul Aziz Ghazi  Roll No:  Presented to: Sir Harris.
Introduction to Genetic Algorithms
Chapter 14 Genetic Algorithms.
Genetic Algorithms.
Genetic Algorithms.
An Evolutionary Approach
Artificial Intelligence (CS 370D)
Basics of Genetic Algorithms
Boltzmann Machine (BM) (§6.4)
Searching for solutions: Genetic Algorithms
Presentation transcript:

1 Lecture 8: Genetic Algorithms Contents : Miming nature The steps of the algorithm –Coosing parents –Reproduction –Mutation Deeper in GA –Stochastic Universal Selection –Elitarism –Steady State

2 Miming Nature Some considerations on evolution of organisms: The organisms that are ill-suited for an environment have little chances to reproduce (natural selection) Conversely, the best fitting have more chances to survive and reproduce Offspring are similar to their parents Random mutations occur and they can bring to better (or worse) fitting individuals “The Origin of the Species on the Basis of Natural Selection” C. Darwin (1859) An organism is fully represented by its DNA string, that is a string over a finite alphabet (4 symbols) Each element of this string is called gene As for Neural Networks, the idea is that what woks in nature should be good also for artificial systems “All above in the assumption you are not Jehovah’s witnesses”

3 Intro An individual (an organisms) is intended to be a possible solution for the problem you want to solve An individual is represented by a binary string. Such a string is intended to be the complete description of the individual A fitness function is a function that says how good is a solution, i.e. how well an individual fit the environment Example: Suppose you have to find a number between 0 and 255, which binary representation contains the same number of 1s and 0s. A individual is a string of 8 bits, ex: The fitness function is: note that the fitness function gets the minimum value (i.e. 0) when or and the maximum value (i.e. 8) when h == 126

4 Genetic Algorithm A genetic algorithm is a way to obtain an individual that maximizes the fitness function Scheme of the (canonical) algorithm Start with a population of N individuals 1.Apply the fitness function to all the individuals 2.Select the pairs of individuals for reproduction (repetition allowed). 3.Each pair generates two children (reproduction) 4.Apply a random mutation to the children. The children become the next generation 5.Apply steps 1,2,3 until some termination criteria applies In the following we explain the details of these steps using the previous example. Suppose to have the initial population:

5 Selection For each element, compute the its contribution to the global fitness as The choice of the pairs for reproduction consists of randomly choosing the individuals (with replacement) with distribution given by P (roulette-wheel selection ) How to do it? –Split the interval [0,1] in N parts of length –Generate a random value r in [0,1] and choose individual associated with the interval containing r

6 Crossover Suppose the chosen pairs are: and The parents are combined by means of the crossover operator. This operator apply to a pair and return two individual. It consists of the following steps: –Randomly choose a cross over point “c”, i.e. a number between 1 and n – return two children: one composed by the first c bits of the first parent and the last n-c bits of the second parent, the other composed by the first c bits of the second parent and the n-c bits of the first parents

7 Mutation After all the children have been created, some of theirs bits are changed (with a small, independent probability), so implementing a mutation on the individuals The following new generation is the result of the first loop In this simple case we have a solution for which the fitness function is at its maximum, but in general it is not so easy: when to stop evolution?

8 Stopping Criteria Convergence: –A population is said to converge when all the genes have converged, I.e. when the value of every bit is the same at least in the 95% of the individuals in the population Since convergence is not guaranteed, we must consider other stopping criteria: –Number of generations –Almost constant value of the best fitting individual –Almost constant value of the average fitness of the population

9 Deeper in GAs Have a deeper look to what we need to implement a GA and which are the degrees of freedom 1.Encoding: an individual (a solution) is encoded by a string of binary values that you have to provide. The encoding was the ‘identity function’ in the previous example. Suppose you have the following problem: Given a set of four numbers, find their position in an increasing ordered list. Ex: input = [ 41,11,23,25] solution = [3,0,1,2] 2.Fitness Function: can be useful to distinguish between Fitness Function and Evaluation Function (or Objective Function) –The evaluation function measures how a solution is good with respect to the parameters of the problem –The Fitness Function assigns the probability of being chosen for reproduction on the base of the results of the evaluation function

10 Applying Gas (cntd) Suppose to use the following evaluation function Where a wrong pair is a pair of values in the string such that What is the evaluation of the following individual? Not legal Solutions While to every solution corresponds a string, the converse is, in general, not true. In the example above, there should not be two identical pair of bits (same position given to two numbers) How to avoid it: –Strongly penalize the “illegal” individuals, so they have little chances to transmit they bad genes –Convert an illegal solution in a legal one, inverting the appropriate bits –Apply a crossover operator that does not produce illegal solution

11 Applying Gas (cntd) Selection: other techniques than roulette-wheel exist for selection Eg: Remainder Stochastic Sampling decompose the pie proportionally to the values After a spin of the pie, pick an individual for each pointer In this example we would select twice, and note: the pointers are equally spaced and their number is the size of the population

12 Applying GAs Creating the new population: Elitism: it consists in copying the best k individuals directly in the new population without combine them with any other, where k is some percentage of the population. The effect is to preserve the best solution found Steady State: –choose two individuals from the population with roulette–wheel strategy and perform crossover to obtain their two children –“kill” two “low fitting” individuals from the population and put the children instead –Note that the concept of generation is not involved in this case

13 Exercise Suppose you want to solve the problem of the eight queens by means of a genetic algorithm. You have 8 queens to use, therefore you cannot have solutions where less or more than 8 queens are used: such a solutions are illegal. 1.Give an encoding that cannot represent these illegal solutions 2.Suppose to have the following encoding: a solution is a string of 64 bits (a bit for each square) where 0 indicates an empty square and 1 indicates a queen in the square. Furthermore, suppose your starting population is made of only legal solutions. Define a crossover operator that produces only legal children 3.Can your operator be applied to any pair of legal solutions? 4.Is the algorithm guaranteed to produce always populations of legal solutions?