logistics
play

Logistics Assignments Crossover and Mutation Checkpoint 1 -- - PDF document

Logistics Assignments Crossover and Mutation Checkpoint 1 -- Problem Graded -- comments on mycourses Checkpoint 2 --Framework Mostly all graded -- comments on mycourses Checkpoint 3 -- Genotype / Phenotype Due last


  1. Logistics  Assignments Crossover and Mutation  Checkpoint 1 -- Problem  Graded -- comments on mycourses  Checkpoint 2 --Framework  Mostly all graded -- comments on mycourses  Checkpoint 3 -- Genotype / Phenotype  Due last Wednesday  Grading not started  Checkpoint 4 -- Selection / Fitness  Due October 19 (Friday) Final exam date Project Presentation 12 Projects  Final exam date has been announced:  Presentations:  Dates:   Week 10  Friday, November 16th Monday, November 5  Wednesday, November 7   2:45pm - 4:45pm 15 minutes / presentation   70-1445 Schedule now on Web  Please send me choice of time/day  Code, Report, and Grad Survey  However…  DUE FRIDAY, NOV 9th  Plan for this week Evolutionary Algorithms  Today:  An EA uses some mechanisms inspired by biological evolution: reproduction, mutation, recombination,  Crossover and Mutation natural selection and survival of the fittest.  Wednesday:  Candidate solutions to the optimization problem play the role of individuals in a population, and the cost  Guest Speaker: Peter Anderson function determines the environment within which  GAs and permutations. the solutions "live".  Evolution of the population then takes place after the repeated application of the above operators.  Questions before we start 1

  2. Evolutionary Computation process Evolutionary Algorithms  To use evolutionary algorithms your must: Initialize  Define your problem population  Define your genotype Select individuals for crossover (based on fitness function  Identify your phenotype Crossover  Define the genotype -> phenotype translation Mutation  Define crossover and mutation operators Insert new offspring  Define fitness into population  Determine selection criteria Are stopping criteria satisfied?  Set population parameters Finish Reproduction Fitness Generation k+1 Generation k fitness Individual Phenotype Genotype Reproduction output parameters problem Fitness Reproduction Exploration vs. Exploitation  Means by which new individuals are produced  Exploration  Crossover  random variation and selection to determine strategies that fit the environment  Combination of 2 parents  Best of both parents  diversity  Mutation  Mutation  modification of a single individual  Exploitation  Allows for random search through search space.  focused repetition of the fittest behavior in the stage of retention.  Genetic operators are applied on the  Selective pressure genotype.  Crossover 2

  3. Exploration vs Exploitation Crossover  Challenge is to maintain balance.  Combination of the best of both parents.  Too much exploration:  random search  Building blocks  Too much exploitation  Get stuck local optima Crossover on Strings / Arrays One-Point Crossover  Common mechanisms:  Crossover point on the parent string is selected.  One-Point Crossover  Two-Point Crossover  All data beyond that point is swapped between the two parents  Cut and Splice  Uniform and Half-Uniform Crossover  Arithmetic  Heuristic Two-Point Crossover Cut and Splice  Two points are selected on the parent  Like one-point crossover, except each strings. parent has a different cut point  Everything between the two points is  Can result in variable length children. swapped between the parents 3

  4. Arithmetic (Numerical arrays) Uniform Crossover and Half Uniform Crossover  uniform crossover scheme (UX)  linearly combines two parent chromosome vectors to produce two new offspring  individual genes are compared between according to the following equations: two parents.  The gene values are swapped with a fixed  Offspring1 = a * Parent1 + (1- a) * Parent2 probability, typically 0.5.  Offspring2 = (1 – a) * Parent1 + a * Parent2  half uniform crossover scheme (HUX)  exactly half of the nonmatching genes are  a = randomly determined constant. swapped. Heuristic (Numerical Arrays) GPs: Crossover and Mutation  uses the fitness values of the two parent crossover mutation chromosomes to determine the direction of the search. The offspring are created according to the following equations: Before crossover Before mutation After crossover After mutation  Offspring1 = BestParent + r * (BestParent – WorstParent)  Offspring2 = BestParent  Note that operation maintain valid  where r is a random number between 0 and individuals. 1. Mutation Standard Mutation  Random modification of a single  Bit String individual  Flip a bit  Explore new areas of search space  Array  Avoids getting stuck in local  Modify gene by random amount minima/maxima.  Trees  Replace branch with random subtree. 4

  5. Traveling Salesman Problem Bad genomes and reproduction  Dealing with bad genomes  Instance:  Total Rejection  N cities with distances between pairs of  Genetic Repair cities  fix in genetic mapping  Genetic operators  Said another way:  Fitness Penalties.  Complete graph with n vertices such that all edges are labeled with a cost value  Break  Example of a permutation problem Traveling Salesman Problem Traveling Salesman Problem  Output:  Solution:  Distance traveled to complete the tour.  Tour of the cities such that each city is visited once.  Said another way:  Complete treatment  A permutation of the cities.  From [Larranaga, et. al. 1999]  Ordered list of the cities  Recall:  Is this a large search space?  Phenotype == ordered tour of the cities  n cities = n! permutation TSP - Path Representation TSP - Path Representation  Tour is represented as an ordered list  Most intuitive and common genotype. (or array) of the cities.  But it has it’s problems:  Order in array == order of visitation.  If city i is the jth element of the array, city 3 2 4 1 7 5 8 6 3 2 4 1 7 5 8 6 i is the jth city to be visited.  Eg. 8 7 6 5 4 3 2 1 3 2 4 1 7 5 8 6 3 2 4 1 4 3 2 1 3 2 4 1 3 5 8 6 Tour: 3-2-4-1-7-5-8-6 Not valid tours!!! 5

  6. TSP - Path Representation TSP - Path Representation  GeneRepair [Mitchell, et.al.]  Genetic Mapping responsible for doing the repair on a “bad genome”  Keep a corrective template with a valid tour.  Identify duplicate cities  Most approaches that use the path  Use template to replace duplicate cities. representation use designer crossover/mutation operators  Assure valid offspring. Designer crossover operators Partially Mapped Crossover (PMX)  Portion of one parent is mapped to a portion  Designed for a particular application. of another parent  Problem domain constraints  Remaining info is exchanged  Phenotype constraints  How it works:  Still operates on genotype.  Choose two random cut points  Define mapping  Goal: Prevent bad genomes  Copy mapping section (between cut points) to offspring  Fill in remainder of offspring using mapping Partially Mapped Crossover (PMX) Partially Mapped Crossover (PMX) 1 2 3 4 5 6 7 8 4 2 3 1 6 8 7 5 3 7 5 1 6 8 2 4 3 7 8 4 5 6 2 1 parents offspring 6

  7. Cycle Crossover (CX) Cycle Crossover (CX)  Creates an offspring where every position is occupied by a corresponding element from one of the parents 1 2 3 4 5 6 7 8 1 2 6 4 7 5 3 8 2 4 6 8 7 5 3 1 parents offspring Cycle Crossover (CX) Order Crossover (OX)  Absolute position of (on average) half  Observes that order is important, not elements of both parents preserved. necessarily position.  How it works:  Better results for TSP than PMX.  Choose 2 cut points  Copy between cut points to offspring  Starting from 2nd cut point in one parent, fill missing cities in order they appear in other parent. Order Crossover (OX) Edge Recombination Crossover (ER)  Creates a path (offspring) that is similar to a set of existing paths (parents) by looking at the edges rather than the 1 2 3 4 5 6 7 8 4 5 6 8 7 1 2 3 vertices. 2 4 6 8 7 5 3 1 8 7 3 4 5 1 2 6 parents offspring 7

  8. Edge Recombination Crossover (ER) Edge Recombination Crossover (ER)  Algorithm  Edge Map  Let K be the empty list  For each node, gives list of other nodes to  Let N be the first node of a random parent. which it has an edge in either parent  While Length(K) < Length(Parent):  K := K + N (append N to K) CABDEF ABCEFD  Remove N from all neighbor lists A: B C D B: A C D  If N's neighbor list is non-empty then C: A B E F  let N* be the neighbor of N with the fewest neighbors D: A B E F in its list (or a random one, should there be multiple)  else let N* be a randomly chosen node that is not in K E: C D F  N := N* F: C D E Mutation Edge Recombination Crossover (ER) A: B C D  Similar problem for standard mutation B: A C D C: A B E F D: A B E F 3 2 4 1 7 5 8 6 E: C D F F: C D E 3 2 4 3 7 5 8 6 K = {} K = ABDF K = A K = ABDFC Not a valid tour K = ABDFCE K = AB K = ABD Displacement Mutation Exchange Mutation  Aka Cut Mutation  Randomly selects two cities and swaps  How it works:  Select a subtour at random 3 2 4 1 7 5 8 6  Insert it in a random place 3 2 4 1 7 5 8 6 3 2 7 1 4 5 8 6 3 7 5 2 4 1 8 6 8

Recommend


More recommend