190 likes | 292 Views
Genetic Algorithm (GA). Contents 1. Basic Concepts 2. Algorithm 3. Practical considerations. Literature. 1. Modern Heuristic Techniques for Combinatorial Problems , (Ed) C.Reeves 1995, McGraw-Hill. Chapter 3. 2. Scheduling, Theory, Algorithms, and Systems , Second Addition,
E N D
Genetic Algorithm (GA) Contents 1. Basic Concepts 2. Algorithm 3. Practical considerations
Literature 1. Modern Heuristic Techniques for Combinatorial Problems, (Ed) C.Reeves 1995, McGraw-Hill. Chapter 3. 2. Scheduling, Theory, Algorithms, and Systems, Second Addition, Michael Pinedo, Prentice Hall, 2002, Chapter 14.4 3. Genetic Algorithms in Search, Optimization & Machine Learning, David E. Goldberg, Addison Wesley, 1989.
Basic Concepts TS, SA versus GA a single solution is carried population based method over from one iteration to the next • Individuals (or members of population or chromosomes) individuals surviving from the previous generation Generation + children (offspring)
Fitnessof an individual (a schedule) is measured by the value of the associated objective function Representation Example. the order of jobs to be processed can be represented as a permutation: [1, 2, ... ,n] Initialization How to choose initial individuals? • High-quality solutions obtained from another heuristic technique can help a genetic algorithm to find better solutions more quickly than it can from a random start.
Reproduction • Crossover: combine the sequence of operations in one parent schedule with a sequence of operations in another parent. Example 1. Ordinary crossover operator is not useful! Cut Point ↓ P1 = [2 1 3 | 4 5 6 7] O1 = [2 1 3 2 5 7 6] (infeasible) P2 = [4 3 1 | 2 5 7 6] O2 = [4 3 1 4 5 6 7] (infeasible)
Example 2. Partially Mapped Crossover (PMX) Cut Point 1 Cut Point 2 ↘ ↙ P1 = [2 1 | 3 4 5 | 6 7] O1 = [4 3 1 2 5 6 7] P2 = [4 3 | 1 2 5 | 7 6] O2 = [2 1 3 4 5 7 6] 3 1 4 2 5 5
Example 3. Preserves the absolute positions of the jobs taken from P1 and the relative positions of those from P2 Cut Point same seq. as P2 ↓ ↓ P1 = [2 1 | 3 4 5 6 7] O1 = [2 1 4 3 5 7 6] P2 = [4 3 | 1 2 5 7 6] O2 = [4 3 2 1 5 6 7] same seq. as P1 Note: absolute or relative positions ?
Example 4. Similar to Example 3 but with 2 crossover points. Cut Point 1 Cut Point 2 ↘ ↙ P1 = [2 1 | 3 4 5 | 6 7] O1 = [3 4 5 1 2 7 6] P2 = [4 3 | 1 2 5 | 7 6] O2 = [1 2 5 3 4 6 7]
Mutation enables genetic algorithm to explore the search space not reachable by the crossover operator. Adjacent pairwise interchange in the sequence [1,2, ... ,n] [2,1, ... ,n] Exchange mutation: the interchange of two randomly chosen elements of the permutation Shift mutation: the movement of a randomly chosen element a random number of places to the left or right Scramble sublist mutation: choose two points on the string in random and randomly permuting the elements between these two positions.
Selection: Roulette wheel: the size of each slice corresponds to the fitness of the appropriate individual. Steps for the roulette wheel: 1. Sum the fitnesses of all the population members, TF 2. Generate a random number m, between 0 and TF 3. Return the first population member whose fitness added to the preceding population members is greater than or equal to m (Note: max. or min.)
Tournament selection: 1. Randomly choose a group of T individuals from the population. 2. Select the best one. How to guarantee that the best member of a population will survive? Elitist model: the best member of the current population is set to be a member of the next.
Algorithm Step 1.k=1 Select N initial schedules S1,1 ,... ,S1,Nusing some heuristic. Evaluate each individual of the population. Step 2. Create new individuals by mating individuals in the current population using crossover and mutation. Delete members of the existing population to make place for the new members. Evaluate the new members and insert them into the population Sk+1,1 ,... , Sk+1,N.
Step 3. k = k+1. If stopping condition = true then return the best individual as the solution and STOP else go to Step 2.
Example: 1 || ΣTj j 1 2 3 4 5 pj4 3 7 2 2 dj5 6 8 8 17 Population size: 3 Selection: in each generation the single most fit individual reproduces using adjacent pairwise interchange chosen at random; there are 4 possible children, each is chosen with probability 1/4 Duplication of children is permitted. Children can duplicate other members of the population.
Initial population: random permutation sequences. Generation 1 Individual: 25314 14352 12345 Cost: 25 17 16 Selected individual: 12345 with offspring 13245, cost 20 Generation 2 Individual: 13245 14352 12345 Cost: 20 17 16 Average fitness is improved, diversity is preserved Selected individual: 12345 with offspring 12354, cost 17
Generation 3 Individual: 12354 14352 12345 Cost: 17 17 16 Selected individual: 12345 with offspring 12435, cost 11 Generation 4 Individual: 14352 12345 12435 Cost: 17 16 11 Selected individual: 12435 This is an optimal solution.
Disadvantages of this algorithm: Since only the most fit member is allowed to reproduce (or be mutated) the same member will continue to reproduce unless replaced by a superior child.
Practical considerations: 1. Population size: small population run the risk of seriously under-covering the solution space, while large populations will require computational resources. Empirical results suggest that population sizes around 30 are adequate in many cases, but 50-100 are more common. 2. Mutation is usually employed with a very low probability.
Summary: 1. Meta-heuristic methods are designed to escape local optima. 2. They work on complete solutions. However, they introduce parameters (such as tabu-list size, temperature, rate of reduction of the temperature, population size, ...) How to choose the parameters? (design of experiment)