Download presentation
Presentation is loading. Please wait.
1
1 IOE/MFG 543 Chapter 14: General purpose procedures for scheduling in practice Section 14.5: Local search – Genetic Algorithms
2
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
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=1000100111=2 9 +2 5 +2 2 +2 1 +2 0 =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
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 10987654321IxF(x) 10010100110166-1.350.35 20001110111119-1.540.30 30011101001233-1.090.46 410010111116070.370.88 510110000117070.760.63 611011110008881.470.32 710100000106420.510.79 80100000110262-0.980.51 90100101010298-0.840.59 1011101011119431.680.26 5.09
5
5 Simple GA (2) Choosing the parents F(x)P PP UPick 10.350.070.0690.1923 20.300.060.1280.6547 30.460.090.2180.2644 40.880.170.3900.3844 50.630.120.5140.8539 60.320.060.5770.95710 70.790.160.7330.8869 80.510.100.8330.5406 90.590.120.9490.0431 00.260.051.0000.0922 5.09
6
6 Simple GA (3) Crossover Parent Bits 300111010011 71010000010 410010111112 41001011111 901001010102 101110101111 901001010106 61101111000 100101001105 20001110111
7
7 Simple GA (4) Offspring 11011101001 20010000010 31001011111 41001011111 51100101010 60110101111 71101111010 80100101000 90001100110 100010110111
8
8 Simple GA (5) Mutation Change each bit with probability p m =0.05 Change each bit with probability p m =0.05 11011101001 20010000010 31001011111 41000011111 51100101010 60110101111 71101011110 80100101000 90001100111 100010110111
9
9 Simple GA (6) Second generation IxF(x) 110111010017450.910.55 20010000010130-1.490.31 310010111116070.370.88 410000111115430.120.99 511001010108101.160.42 60110101111431-0.320.91 711010111108621.370.35 80100101000296-0.840.58 90001100111103-1.600.28 100010110111183-1.290.38 5.69
10
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 1-2-3-4-5 gives1-2-3-2-1 and 5-4-3-2-1 5-4-3-4-5 –repair –random keys –other methods
11
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
12 GA example: 1|| w j T j Jobs1234 wjwj 4535 pjpj 128159 djdj 16262527 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
13 GA example Initial population Random keys Sequence wjTjwjTj 10.2060.7810.320.8644231133 20.6460.9010.2180.7493142179 30.6820.6880.0890.8933241137 40.260.2580.2790.8353421142 50.6530.8280.2810.242134131 60.6610.5280.750.3112314161 FitnessPC USelect 10.0080.182 0.1952 20.0060.1350.3170.3503 30.0070.1770.4940.7195 40.0070.1710.6650.3092 50.0080.1850.8500.8085 60.0060.1501.0000.3603 0.041
14
14 GA example Crossover and mutation ParentsSwap atMutation 20.6460.9010.2180.74930000 30.6820.6880.0890.8930011 50.6530.8280.2810.2440000 20.6460.9010.2180.7490000 50.6530.8280.2810.2440000 30.6820.6880.0890.8930000
15
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 10.6460.9010.2180.89331421790.006 20.6820.6880.4390.31721341310.008 30.6530.8280.2810.2421341310.008 40.6460.9010.2180.74931421790.006 50.6530.8280.2810.2421341310.008 60.6820.6880.0890.89332411370.007 0.041
16
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
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.