Genetic Algorithms Permutation crossovers

Slides:



Advertisements
Similar presentations
Genetic Algorithms Chapter 3.
Advertisements

CS6800 Advanced Theory of Computation
1 Transportation problem The transportation problem seeks the determination of a minimum cost transportation plan for a single commodity from a number.
Genetic Algorithms Contents 1. Basic Concepts 2. Algorithm
1 APPENDIX A: TSP SOLVER USING GENETIC ALGORITHM.
1 Lecture 8: Genetic Algorithms Contents : Miming nature The steps of the algorithm –Coosing parents –Reproduction –Mutation Deeper in GA –Stochastic Universal.
Evolutionary Computational Intelligence
A Hybrid Heuristic for the Traveling Salesman Problem R. Baraglia, J. I. Hildalgo, R. Perego CMPSC 580, Spring 2006.
EAs for Combinatorial Optimization Problems BLG 602E.
Chapter 6: Transform and Conquer Genetic Algorithms The Design and Analysis of Algorithms.
Christoph F. Eick: Applying EC to TSP(n) Example: Applying EC to the TSP Problem  Given: n cities including the cost of getting from on city to the other.
Genetic Algorithm.
Genetic Operators for TSP Chapter 8 in Michalewicz and Fogel, How to Solve It: Modern Heuristics, Springer, 2000.
SOFT COMPUTING (Optimization Techniques using GA) Dr. N.Uma Maheswari Professor/CSE PSNA CET.
Ch.12 Machine Learning Genetic Algorithm Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2011.
Zorica Stanimirović Faculty of Mathematics, University of Belgrade
Genetic Algorithms A technique for those who do not know how to solve the problem!
More on Heuristics Genetic Algorithms (GA) Terminology Chromosome –candidate solution - {x 1, x 2,...., x n } Gene –variable - x j Allele –numerical.
Introduction to GAs: Genetic Algorithms How to apply GAs to SNA? Thank you for all pictures and information referred.
1 Combinatorial Problem. 2 Graph Partition Undirected graph G=(V,E) V=V1  V2, V1  V2=  minimize the number of edges connect V1 and V2.
Genetic Algorithms Chapter 3. A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing Genetic Algorithms GA Quick Overview Developed: USA in.
Crossovers and Mutation Richard P. Simpson. Genotype vs. Phenotype The genotype of a chromosome is just the basic data structure (it bits in a binary.
A New Evolutionary Approach for the Optimal Communication Spanning Tree Problem Sang-Moon Soak Speaker: 洪嘉涓、陳麗徽、李振宇、黃怡靜.
Genetic Algorithms Przemyslaw Pawluk CSE 6111 Advanced Algorithm Design and Analysis
Introduction to Genetic Algorithms. Genetic Algorithms We’ve covered enough material that we can write programs that use genetic algorithms! –More advanced.
Genetic Algorithms. 2 Overview Introduction To Genetic Algorithms (GAs) GA Operators and Parameters Genetic Algorithms To Solve The Traveling Salesman.
Evolutionary Computing Chapter 4. / 62 Chapter 4: Representation, Mutation, and Recombination Role of representation and variation operators Most common.
D Nagesh Kumar, IIScOptimization Methods: M8L5 1 Advanced Topics in Optimization Evolutionary Algorithms for Optimization and Search.
1 Contents 1. Basic Concepts 2. Algorithm 3. Practical considerations Genetic Algorithm (GA)
Genetic Algorithms. Underlying Concept  Charles Darwin outlined the principle of natural selection.  Natural Selection is the process by which evolution.
1 Combinatorial Problem. 2 Graph Partition Undirected graph G=(V,E) V=V1  V2, V1  V2=  minimize the number of edges connect V1 and V2.
Overview Last two weeks we looked at evolutionary algorithms.
Genetic Algorithms And other approaches for similar applications Optimization Techniques.
1 Genetic Algorithms Contents 1. Basic Concepts 2. Algorithm 3. Practical considerations.
Genetic Algorithms Chapter 3.
CSCE 210 Data Structures and Algorithms
Introduction to Genetic Algorithms
Using GA’s to Solve Problems
Genetic Algorithms.
Genetic Algorithm (GA)
Genetic Algorithms.
Artificial Intelligence Methods (AIM)
School of Computer Science & Engineering
Introduction to Genetic Algorithm (GA)
Ch. 8 File Structures Sequential files. Text files. Indexed files.
Example: Applying EC to the TSP Problem
Artificial Intelligence (CS 370D)
Genetic Algorithms Chapter 3.
Hash Table.
Case Study: Genetic Algorithms
Basics of Genetic Algorithms (MidTerm – only in RED material)
Example: Applying EC to the TSP Problem
Genetic Algorithms Chapter 3.
Introduction to Operators
Example: Applying EC to the TSP Problem
CH 9.2 : Hash Tables Acknowledgement: These slides are adapted from slides provided with Data Structures and Algorithms in C++, Goodrich, Tamassia and.
نعيمه خاكزاد سودابه سليماني خدايار خليلي استاد مربوطه: مهندس گرجي زاده
Sorting … and Insertion Sort.
Data Structures – Week #7
Genetic Algorithms Chapter 3.
Genetic Algorithms Chapter 3.
Genetic Algorithms Chapter 3.
Basics of Genetic Algorithms
EE368 Soft Computing Genetic Algorithms.
Searching for solutions: Genetic Algorithms
Genetic Algorithms Chapter 3.
Genetic Algorithms Chapter 3.
Biologically Inspired Computing: Operators for Evolutionary Algorithms
Steady state Selection
Population Based Metaheuristics
Presentation transcript:

Genetic Algorithms Permutation crossovers A technique for those who do not know how to solve the problem!

Permutation Crossovers Required for TSP, POOL BALL etc Required for Decoding messages etc Random crossover of two permutations seldom result in another permutation A permutation space is N! in size. SO!

Categories of Perm. Crossovers Disqualification Just kill the bad chromosomes. Why is this bad? Repairing Invalid chromosomes are fixed. Inventing Specialized Operators Crossovers generate only legal permutations Transformation Transform permutation space into a vector space and cross in vector space.

Permutation Operators Partially mapped crossover (PMX) Order crossover (X) Uniform order crossover Edge recombination There are many other that we will not discuss.

Partially Mapped Crossover (Goldbert & Lingle, 1985) Given two parents s and t, PMX randomly picks two crossover points. The child is constructed in the following way. Starting with a copy of s, the positions between the crossover points are, one by one, set to the values of t in these positions. This is performs by applying a swap to s. The swap is defined by the corresponding values in s and t within the selected region.

PMX example For the second offspring just swap the parents No change 6 2 3 4 1 7 5 6 2 3 1 4 7 5 6 2 4 1 3 7 5 6 5 2 2 4 3 4 1 1 3 7 7 7 7 5 6 6 5 2 2 3 4 4 1 1 3 7 7 7 7 6 5 5 6 2 2 4 3 1 4 3 1 7 7 7 7 6 5 First offspring 6 6 2 2 4 3 1 4 1 3 7 7 7 7 5 5 For the second offspring just swap the parents and apply the same operation

Order Crossover (Davis 1985) This crossover first determines to crossover points. It then copies the segment between them from one of the parents into the child. The remaining alleles are copied into the child (l to r) in the order that they occur in the other parents. Switching the roles of the parents will generate the other child.

Order Crossover Example 1 2 3 4 5 6 7 8 9 4 5 6 7 3 4 7 2 8 9 1 6 5 The remaining alleles are 1 2 3 8 9. Their order in the other parent is 3 2 8 9 1 3 4 7 2 8 9 1 6 5 3 2 8 4 5 6 7 9 1

Uniform Order Crossover (Davis 1991) Here a randomly-generated binary mask is used to define the elements to be taken from that parent. The only difference between this and order crossover is that these elements in order crossover are contiguous. 1 2 3 4 5 6 7 8 9 1 1 1 1 1 2 3 4 7 9 6 8 5 3 4 7 2 8 9 1 6 5 offspring

Edge Recombination (Whitley Starkweather Fuquay 1989 ) This operator was specially designed for the TSP problem. This scheme ensures that every edge (link) in the child was shared with one or other of its parents. This has been shown to be very effective in TSP applications. Constructs an edge map, which for each site lists the edges available to it from the two parents that involve that city. Mark edges that occur in both with a +.

Example Edge Table g d m h b j f i a k e c c e k a g b h i j f m d a: +k, g ,i g: a, b, c, d b: +h,g,i h: +b, i, m c: +3, d, g i: h, j, a, f d: +m, g, c j: +f, i, b e: +k, +c k: +e, +a f: +j, m, i m: +d, f, h

Edge Recombination Algorithm Pick a city at random Set current_city to this city. Remove reference to current_city form table. Examine list for current_city: If there is a common entry(+) pick that Else pick entry which has the shortest list Split ties randomly If stuck (list is empty), start from other end, or else pick a new city at random.

Example Continued Randomly pick a, delete all a’s from table [a] Select k (common neighbor) [ak] Select e (only item in k’s list) [ake] Select c (only item in e’s list) [akec] d or g: pick d at random [akecd] Select m (common edge with d) [akecdm] f or h: pick h at random [akecdmh] Select b ( common edge) [akecdmhb] Select g (shortest list -0) [akecdmhbg] g has empty list so reverse direction [gbhmdcdka] Select i (only item in a’s list) [gbhmdcdkai] Select f at random, then j [gbhmdcekaifj]

Inversion Transformations This scheme will allow normal crossover and mutation to operate as usual. In order to accomplish this we map the permutation space to a set of contiguous vectors . Given a permutation of the set {1,2,3,…,N} let aj denote the number of integers in the permutation which precede j but are greater than j. The sequence a1,a2,a3,…,an is called the inversion sequence of the permutation. The inversion sequence of 6 2 3 4 1 7 6 is 4 1 1 1 2 0 0 There are 4 integers greater than 1

Inversion of Permutations The inversion sequence of a permutation is unique! Hence there is a 1-1 correspondence between permutations and their inversion sequence. Also the right most inv number is 0 so dropped. y 1 1 2 2 1 1 1 2 3 1 3 2 3 1 2 3 2 1 2 3 1 2 1 3 x 0 1 2 (0 0) (0 1) (1 1) (2 1) (2 0) (1 0)

Inversions Continued What does a 4 digit permutation map to? 1234 -> (0 0 0) 2134 -> (1 0 0) 4321 -> (3 2 1) 2413 -> (2 0 1) 1423 -> (0 1 1) etc Maps to a partial 3D lattice structure

Converting Perm to Inv Input perm: array of permutation Output: inv: array holding inv sequence For (i=1;i<=N;i++){ inv[i]=0; m=1; while(perm[m]<>i){ if (perm[m]>i )then inv[i]++; m++; }

Convert inv to Perm Input: inv[] Output: perm[] For(i=1;i<=N;i++){ for(m=i+1;m<=N;m++) if (pos[m]>=inv[i]+1)pos[m]++; pos[i]=omv[i]+1; } For(i=1;i<=N;i++) perm[i]=i;

So what do we do? Our population is of course a set of permutations. These permutations are each mapped to their inv to create a population of inv’s say We do normal crossovers in this mapped population as well as normal mutations. In order to determine fitness we of course must apply Fitness(Inverse(inv)) Is this all worth doing?

Mutations of Permutations Swap Mutation Scramble Mutation 2-Swap Insert These will maintain legal permutations

Swap Mutation Select two positions at random and swap the allele values at those positions. Sometimes called the “order-based” mutation. ABCDEFGJ => AECDBFGJ

Scramble Mutation Pick a subset of positions at random and reorder their contents randomly Some research has shown swap is best and others have shown scramble is best in certain apps. Who knows? ABCDEFGH => AHFDECGB

Other Permutation Mutations 2-Swap (nice for TSP) Pick two point and invert subtour AB.CDEF.GH => AB.FEDC.GH Insert Mutation Pick a value at random (say E), insert into another (rand chosen position, say B) and shift the rest over ABCDEFG => AEBCDFG

How about code breaking Assume that we have the 26 letters of the alphabet permutated. This permutation is used to encode a normal message. How do we decode this using a GA? Is this even a good idea? What is the fitness function?