Chapter 14 Genetic Algorithms.

Slides:



Advertisements
Similar presentations
Genetic Algorithms Chapter 3. A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing Genetic Algorithms GA Quick Overview Developed: USA in.
Advertisements

Linkage Learning in Evolutionary Algorithms. Recombination Missouri University of Science and Technology Recombination explores the search space Classic.
Genetic Algorithms Representation of Candidate Solutions GAs on primarily two types of representations: –Binary-Coded –Real-Coded Binary-Coded GAs must.
1 Lecture 8: Genetic Algorithms Contents : Miming nature The steps of the algorithm –Coosing parents –Reproduction –Mutation Deeper in GA –Stochastic Universal.
COMP305. Part II. Genetic Algorithms. Genetic Algorithms.
Evolutionary Computational Intelligence
COMP305. Part II. Genetic Algorithms. Genetic Algorithms.
COMP305. Part II. Genetic Algorithms. Genetic Algorithms.
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,
Chapter 6: Transform and Conquer Genetic Algorithms The Design and Analysis of Algorithms.
Genetic Programming.
Slides are based on Negnevitsky, Pearson Education, Lecture 10 Evolutionary Computation: Evolution strategies and genetic programming n Evolution.
Genetic Algorithm.
Evolutionary Intelligence
© Negnevitsky, Pearson Education, CSC 4510 – Machine Learning Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University.
© Negnevitsky, Pearson Education, Lecture 11 Evolutionary Computation: Genetic algorithms Why genetic algorithm work? Why genetic algorithm work?
SOFT COMPUTING (Optimization Techniques using GA) Dr. N.Uma Maheswari Professor/CSE PSNA CET.
Schemata Theory Chapter 11. A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing Theory Why Bother with Theory? Might provide performance.
CS 484 – Artificial Intelligence1 Announcements Lab 3 due Tuesday, November 6 Homework 6 due Tuesday, November 6 Lab 4 due Thursday, November 8 Current.
By Prafulla S. Kota Raghavan Vangipuram
Zorica Stanimirović Faculty of Mathematics, University of Belgrade
Genetic Algorithms Michael J. Watts
Genetic algorithms Charles Darwin "A man who dares to waste an hour of life has not discovered the value of life"
Computational Complexity Jang, HaYoung BioIntelligence Lab.
Genetic Algorithms Introduction Advanced. Simple Genetic Algorithms: Introduction What is it? In a Nutshell References The Pseudo Code Illustrations Applications.
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 ALGORITHMS.  Genetic algorithms are a form of local search that use methods based on evolution to make small changes to a popula- tion of chromosomes.
© Negnevitsky, Pearson Education, Lecture 9 Evolutionary Computation: Genetic algorithms Introduction, or can evolution be intelligent? Introduction,
2005MEE Software Engineering Lecture 11 – Optimisation Techniques.
Learning by Simulating Evolution Artificial Intelligence CSMC February 21, 2002.
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*
1 Genetic Algorithms K.Ganesh Introduction GAs and Simulated Annealing The Biology of Genetics The Logic of Genetic Programmes Demo Summary.
Edge Assembly Crossover
Genetic Algorithms What is a GA Terms and definitions Basic algorithm.
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]
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 5: Power of Heuristic; non- conventional search.
D Nagesh Kumar, IIScOptimization Methods: M8L5 1 Advanced Topics in Optimization Evolutionary Algorithms for Optimization and Search.
1 Chapter 3 GAs: Why Do They Work?. 2 Schema Theorem SGA’s features: binary encoding proportional selection one-point crossover strong mutation Schema.
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.
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.
Advanced AI – Session 7 Genetic Algorithm By: H.Nematzadeh.
 Presented By: Abdul Aziz Ghazi  Roll No:  Presented to: Sir Harris.
1 Genetic Algorithms Contents 1. Basic Concepts 2. Algorithm 3. Practical considerations.
Introduction to Genetic Algorithms
Using GA’s to Solve Problems
Chapter 14. Genetic Algorithms
Genetic Algorithms.
Selected Topics in CI I Genetic Programming Dr. Widodo Budiharto 2014.
Genetic Algorithms.
Evolution strategies and genetic programming
Intelligent Systems and Soft Computing
An evolutionary approach to solving complex problems
Genetic Algorithms, Search Algorithms
CS621: Artificial Intelligence
Introduction to Operators
Genetic Algorithms CSCI-2300 Introduction to Algorithms
Genetic Algorithms Chapter 3.
EE368 Soft Computing Genetic Algorithms.
Searching for solutions: Genetic Algorithms
Chapter 14. Genetic Algorithms
Artificial Intelligence CIS 342
Population Based Metaheuristics
Presentation transcript:

Chapter 14 Genetic Algorithms

http://www.generativeart.com/2000/MATTLEWIS.HTM http://www.evolutionzone.com/hardwork/old_form/java/horn.html http://www.arch.usyd.edu.au/~rob/ http://www.ornl.gov/sci/techresources/Human_Genome/posters/chromosome/chooser.shtml http://www.ncbi.nlm.nih.gov/SCIENCE96/

Chapter 14 Contents (1) Representation The Algorithm Fitness Crossover Mutation Termination Criteria Optimizing a mathematical function

Chapter 14 Contents (2) Schemata The Effect of Reproduction on Schemata The Effect of Crossover and Mutation The Schema Theorem The Building Block Hypothesis Deception Messy Genetic Algorithms Evolving Pictures Co-Evolution

Representation Genetic techniques can be applied with a range of representations. Usually, we have a population of chromosomes (individuals). Each chromosome consists of a number of genes. Other representations are equally valid.

The Algorithm The algorithm used is as follows: Generate a random population of chromosomes (the first generation). If termination criteria are satisfied, stop. Otherwise, continue with step 3. Determine the fitness of each chromosome. Apply crossover and mutation to selected chromosomes from the current generation to generate a new population of chromosomes (the next generation). Return to step 2.

Fitness Fitness is an important concept in genetic algorithms. The fitness of a chromosome determines how likely it is that it will reproduce. Fitness is usually measured in terms of how well the chromosome solves some goal problem. E.g., if the genetic algorithm is to be used to sort numbers, then the fitness of a chromosome will be determined by how close to a correct sorting it produces. Fitness can also be subjective (aesthetic)

Crossover (1) Crossover is applied as follows: 1. Select a random crossover point. 2. Break each chromosome into two parts, splitting at the crossover point. 3. Recombine the broken chromosomes by combining the front of one with the back of the other, and vice versa, to produce two new chromosomes.

Crossover (2) Usually, crossover is applied with one crossover point, but can be applied with more, such as in the following case which has two crossover points: Uniform crossover involves using a probability to select which genes to use from chromosome 1, and which from chromosome 2.

Mutation A unary operator – applies to one chromosome. Randomly selects some bits (genes) to be “flipped” 1 => 0 and 0 =>1 Mutation is usually applied with a low probability, such as 1 in 1000.

Termination Criteria A genetic algorithm is run over a number of generations until the termination criteria are reached. Typical termination criteria are: Stop after a fixed number of generations. Stop when a chromosome reaches a specified fitness level. Stop when a chromosome succeeds in solving the problem, within a specified tolerance. Human judgement can also be used in some more subjective cases.

Optimizing a mathematical function A genetic algorithm can be used to find the highest value for f(x) = sin (x). Each chromosome consists of 4 bits, to represent the values of x from 0 to 15. Fitness ranges from 0 (f(x) = -1) to 100 (f(x) = 1). By applying the genetic algorithm it takes just a few generations to find that the value x =8 gives the optimal solution for f(x).

Example We introduce the size of four chromosomes. c1 = 1001 c2 = 0011 This is random picked population and it is also the first generation.

Example To calculate the fitness of a chromosome, we need to convert it to a integer and calculate f(x) for this integer. 0 – 100 range is assigned as the fitness range for this problem. With 0 – the least fit, and 100 – the most fit. Hence: 100  f(x) = 1, 0  f(x) = -1, and 50  f(x) = 0.

Fitness function f’(x) = 50 (f(x) + 1) = 50 (sin(x) + 1)

Generation 1 Chromosome Gene Integer Value f(x) f’(x) Fitness Ratio

Next Step Generate four random numbers to find the four parents that will produce the next generation. For example: The first two numbers are 56.7 and 38.2, which in corresponding to C2 and c1. Therefore we pick c2 and c1 as the parent: 10 01 00 11  c5 = 1011 c6 = 0001 Similarly, c1 and c3 are chosen to produce offspring c7 and c8. c7 = 1000 and c8 = 1011 Now, c5, c6, c7, and c8 will replace c1 – c4 to get the second generation. C4 did not have a chance to reproduce, so its gene is lost.

Next Generation Chromosome Gene Integer Value f(x) f’(x) Fitness Ratio

Use GA to Solve Combinatorial Problems In many cases, GA algorithm quickly produce optimal or near-optimal solutions to combinatorial problems that would otherwise be impractical to solve. However, this example only serve as a very simple example. In many practical problems, the population size would be much larger (100 - ?)

Example http://www.estec.esa.nl/outreach/gatutor/problem.htm

Schemata (1) As with the rules used in classifier systems, a schema is a string consisting of 1’s, 0’s and *’s. E.g.: 1011*001*0 Matches the following four strings: 1011000100 1011000110 1011100100 1011100110 a schema with n *’s will match a total of 2n chromosomes. Each chromosome of r bits will match 2r different schemata.

Schemata (2) The defining length dL(S) of a schema, S, is the distance between the first and last defined bits. For example, the defining length of each of the following schemata is 4: **10111* 1*0*1** The order O(S) is number of defined bits in S. The following schemata both have order 4: **10*11* 1*0*1**1 A schema with a high order is more specific than one with a lower order.

Schemata (3) The fitness of a schema is defined as the average fitness of the chromosomes that match the schema. The fitness of a schema, S, in generation i is written as follows: f(S, i) The number of occurrences of S in the population at time i is : m(S, i)

The Effect of Reproduction on Schemata The probability that a chromosome c will reproduce is proportional to its fitness, so the expected number of offspring of c is: a(i) is the average fitness of the chromosomes in the population at time i If c matches schema S, we can rewrite as: c1 to cn are the chromosomes in the population at time i which match the schema S.

The Effect of Reproduction on Schemata Since: We can now write: This tells us that a schema that is fit will have more chance of appearing in a subsequent generation than less fit chromosomes.

The Effect of Crossover For a schema S to survive crossover, the crossover point must be outside the defining length of S. Hence, the probability that S will survive crossover is: This tells us that a short schema is more likely to survive crossover than a longer schema. In fact, crossover is not always applied, so the probability that crossover will be applied should also be taken into account.

The Effect of Mutation The probability that mutation will be applied to a bit in a chromosome is pm Hence, the probability that a schema S will survive mutation is: We can combine this with the effects of crossover and reproduction to give:

The Schema Theorem Holland’s Schema Theorem, represented by the above formula, can be written as: Short, low order schemata which are fitter than the average fitness of the population will appear with exponentially increasing regularity in subsequent generations. This helps to explain why genetic algorithms work. It does not provide a complete answer.

The Building Block Hypothesis Genetic algorithms manipulate short, low-order, high fitness schemata in order to find optimal solutions to problems.” These short, low-order, high fitness schemata are known as building blocks. Hence genetic algorithms work well when small groups of genes represent useful features in the chromosomes. This tells us that it is important to choose a correct representation.

Deception Genetic algorithms can be deceived by fit building blocks that happen not to combine to give the optimal solutions. Deception can be avoided by inversion: this involves reversing the order of a randomly selected group of bits within a chromosome.

Example S1 = 1 1 * * * * * * f(S1) = 50 With S1 and S2 combine together will lead to S3 which has a fitness 5. S3 is much less fit than either S1 or S2. To avoid this, one can introduce inversion, or ...

Messy Genetic Algorithms (1) An alternative to standard genetic algorithms that avoid deception. Each bit in the chromosome is represented as a (position, value) pair. For example: ((1,0), (2,1), (4,0)) In this case, the third bit is undefined, which is allowed with MGAs. A bit can also overspecified: ((1,0), (2,1), (3,1), (3,0), (4,0))

Messy Genetic Algorithms (2) Underspecified bits are filled with bits taken from a template chromosome. The template chromosome is usually the best performing chromosome from the previous generation. Overspecified bits are usually dealt with by working from left to right and using the first value specified for each bit.

Messy Genetic Algorithms (3) MGAs use splice and cut instead of crossover. Splicing involves simply joining two chromosomes together: ((1,0), (3,0), (4,1), (6,1)) ((2,1), (3,1), (5,0), (7,0), (8,0)) ((1,0), (3,0), (4,1), (6,1), (2,1), (3,1), (5,0), (7,0), (8,0)) Cutting involves splitting a chromosome into two: ((1,0), (3,0), (4,1)) ((6,1), (2,1), (3,1), (5,0), (7,0), (8,0))

Evolving Pictures Dawkins used genetic algorithms with subjectives metrics for fitness to evolve pictures of insects, trees and other “creatures”. The human selection of fitness can be used to produce amazing pictures that a person would otherwise not be able to produce.

Co-Evolution In the real world, the presence of predators is responsible for many evolutionary developments. Similarly, in many artificial life systems, introducing “predators” produces better results. This process is known as co-evolution. For example, Ramps, which were evolved to sort numbers: “parasites” were introduced which produced sets of numbers that were harder to sort, and the ramps produced better results.

Summary The Canonical GA (pseudo code): choose initial population evaluate each individual's fitness determine population's average fitness repeat select best-ranking individuals to reproduce mate pairs at random apply crossover operator apply mutation operator until terminating condition (e.g. until at least one individual has the desired fitness or enough generations have passed)