170 likes | 272 Views
IOE/MFG 543. Chapter 14: General purpose procedures for scheduling in practice Section 14.5: Local search – Genetic Algorithms. Genetic Algorithms. Keep a population (or a generation) of solutions Selected members of the population survive and reproduce offspring
E N D
IOE/MFG 543 Chapter 14: General purpose procedures for scheduling in practice Section 14.5: Local search – Genetic Algorithms
Genetic Algorithms • Keep a population (or a generation) of solutions • 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
Minimization of x2 via a simple GA • Gene representation of an individual • Use binary encoding, e.g., I=1000100111=29+25+22+21+20=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 F(x)=1/(1+x2)
Simple GA (1)Initial population • Use a population size of 10 • Randomly generate 10 individuals
Simple GA (5)Mutation • Change each bit with probability pm=0.05
GA and scheduling • Encoding of a sequence • Easier to use job numbers than bits • Mutation can be done by an interchange of two jobs • A crossover can lead to an infeasible sequence 1-2-3-4-5 gives 1-2-3-2-1 and 5-4-3-2-1 5-4-3-4-5 • repair • random keys • other methods
Random keys (see Bean, 1994) • Generate n U(0,1) random numbers for each parent • Example • Generate .29, .96, .17, .84 and .49 • P1=(.29,.96,.17,.84,.49)=(4,1,5,2,3) • P2=(.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) • C1=(4,1,5,2,4) C2=(2,5,4,1,3)
GA example:1||SwjTj • Use random keys and population size 6 • Fitness = 1/wjTj
GA exampleGeneration 2 • Very little improvement and the population is converging!? • Instead of mutation do immigration • Replace an individual with a new randomly generated individual
GA algorithm • Generate an initial population • Evaluate the fitness and select individuals for reproduction • Randomly, always keep the best few? • Generate new individuals • Crossover, mutation, immigration • Stop of stopping criteria are satisfied. Otherwise go to 2
GA design criteria • Schedule representation • Population size • Fitness function • Selection procedure • Probability based on fitness or ranking • Tournament • Crossover, mutation and immigration probability • Stopping criteria