1 IOE/MFG 543 Chapter 14: General purpose procedures for scheduling in practice Section 14.5: Local search – Genetic Algorithms
2 Genetic Algorithms Keep a population (or a generation) of solutions Keep a population (or a generation) of solutions Selected members of the population survive and reproduce offspring Selected members of the population survive and reproduce offspring –The offspring inherit characteristics from both parents –A mutation can occur such that the offspring has a feature that neither parent has
3 Minimization of x 2 via a simple GA Gene representation of an individual Gene representation of an individual –Use binary encoding, e.g., I= = =551 –10 binary digits => I {0,1,…,1023} –Suppose we know x [-2,2] Let x=(I-512)/256 => x [-2,1.996] Fitness of an individual Fitness of an individual F(x)=1/(1+x 2 )
4 Simple GA (1) Initial population Use a population size of 10 Use a population size of 10 Randomly generate 10 individuals Randomly generate 10 individuals Bit IxF(x)
5 Simple GA (2) Choosing the parents F(x)P PP UPick
6 Simple GA (3) Crossover Parent Bits
7 Simple GA (4) Offspring
8 Simple GA (5) Mutation Change each bit with probability p m =0.05 Change each bit with probability p m =
9 Simple GA (6) Second generation IxF(x)
10 GA and scheduling Encoding of a sequence Encoding of a sequence –Easier to use job numbers than bits Mutation can be done by an interchange of two jobs Mutation can be done by an interchange of two jobs A crossover can lead to an infeasible sequence A crossover can lead to an infeasible sequence gives and –repair –random keys –other methods
11 Random keys (see Bean, 1994) Generate n U(0,1) random numbers for each parent Generate n U(0,1) random numbers for each parent Example Example –Generate.29,.96,.17,.84 and.49 –P 1 =(.29,.96,.17,.84,.49)=(4,1,5,2,3) –P 2 =(.73,.14,.43,.54,.38)=(5,1,3,2,4) (.29,.96,.17,.84,.49) gives(.29,.96,.17,.54,.38) (.73,.14,.43,.54,.38) (.73,.14,.43,.84,.49) –C 1 =(4,1,5,2,4) C 2 =(2,5,4,1,3)
12 GA example: 1|| w j T j Jobs1234 wjwj 4535 pjpj djdj Use random keys and population size 6 Use random keys and population size 6 Fitness = 1/w j T j Fitness = 1/w j T j
13 GA example Initial population Random keys Sequence wjTjwjTj FitnessPC USelect
14 GA example Crossover and mutation ParentsSwap atMutation
15 GA example Generation 2 Very little improvement and the population is converging!? Very little improvement and the population is converging!? Instead of mutation do immigration Instead of mutation do immigration –Replace an individual with a new randomly generated individual Random keys Sequence wjTjwjTj Fitness
16 GA algorithm 1. Generate an initial population 2. Evaluate the fitness and select individuals for reproduction Randomly, always keep the best few? Randomly, always keep the best few? 3. Generate new individuals Crossover, mutation, immigration Crossover, mutation, immigration 4. Stop of stopping criteria are satisfied. Otherwise go to 2
17 GA design criteria Schedule representation Schedule representation Population size Population size Fitness function Fitness function Selection procedure Selection procedure –Probability based on fitness or ranking –Tournament Crossover, mutation and immigration probability Crossover, mutation and immigration probability Stopping criteria Stopping criteria