A genetic algorithm approach to static job shop scheduling


Published on

  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

A genetic algorithm approach to static job shop scheduling

  1. 1. A GENETIC ALGORITHM APPROACH TO STATIC JOB SHOP SCHEDULING ABSTRACT Higher production rates may be achieved by the use of highly mechanized orcomputerized machinery which involves not only the higher production costs but also
  2. 2. higher maintenance. It’s a challenge for a production engineer to perform the sameactivity within the same possible time with much cheaper equipment. The brain stormingactivity of assigning the jobs to the machines so as to achieve his target all lies in hisability of scheduling the jobs. With the arrival of different kinds of jobs having differentjob sequences, it’s a tedious task to organize such lot. In this work an attempt has beenmade to apply the prevalent techniques of genetic algorithms to the static job shopscheduling.INTRODUCTION Scheduling, in the context of manufacturing is a process of assigning the start andcompletion times of operations on various jobs on various machines. A flow shop ischaracterized by, more or less, continuous and uninterrupted flow of jobs throughmultiple machines in series. In such a shop, the flow of work is unidirectional since alljobs follow the same technological routing through all the machines. But in the real timesituations the scenario is completely different. The jobs arriving could not only be ofdifferent sizes but also may have different job sequences. In such situations the prioritiesof assigning the jobs plays an important role. The jobs are allotted in a sense not onlytaking the dispatch time into consideration but also the optimum completion time. . Thejob shop scheduling problem is defined as follows Given ‘n’ jobs to be processed on ‘m’ machines in a different technological order,the processing time of job ‘ i ‘ on machine j being P ij (i = 1,2,3,………,n and j = 1,2,…..n), the optimal sequence which consumes the least possible time is to be selected. Thepresent paper aims at finding the optimal order (sequence) in which the ‘n’ jobs should beprocessed on each of the ‘m’ machines to minimize a well defined measure ofperformance. In this attempt Genetic algorithms are used as a tool for achieving thisoptimality.GENETIC ALGORITHMS – AN OPTIMIZING TOOL Genetic algorithms are inspired by Darwins theory of evolution. Solution to aproblem solved by genetic algorithms uses an evolutionary process (it is evolved).Algorithm begins with a set of solutions (represented by chromosomes) calledpopulation. Solutions from one population are taken and used to form a new population.
  3. 3. This is motivated by a hope, that the new population will be better than the old one.Solutions which are then selected to form new solutions (offspring) are selectedaccording to their fitness - the more suitable they are the more chances they have toreproduce.Chromosome All living organisms consist of cells. In each cell there is the same set ofchromosomes. Chromosomes are strings of DNA and serve as a model for the wholeorganism. A chromosome consists of genes, blocks of DNA. Each gene encodes aparticular protein. Basically, it can be said that each gene encodes a trait, for examplecolor of eyes. Possible settings for a trait (e.g. blue, brown) are called alleles. Each genehas its own position in the chromosome. This position is called locus. Complete set of genetic material (all chromosomes) is called genome. Particularset of genes in genome is called genotype. The genotype is with later development afterbirth base for the organisms phenotype, its physical and mental characteristics, such aseye color, intelligence etc.Encoding of a chromosome A chromosome should in some way contain information about solution that itrepresents. The most used way of encoding is a binary string. A chromosome then couldlook like this: Chromosome 1 1101100100110110 Chromosome 2 1101111000011110Each chromosome is represented by a binary string. Each bit in the string can representsome characteristics of the solution. Another possibility is that the whole string canrepresent a number.Of course, there are many other ways of encoding. The encoding depends mainly on thesolved problem. For example, one can encode directly integer or real numbers;sometimes it is useful to encode some permutations and so on.Mutation
  4. 4. After a crossover is performed, mutation takes place. Mutation is intended to preventfalling of all solutions in the population into a local optimum of the solved problem.Mutation operation randomly changes the offspring resulted from crossover. In case ofbinary encoding we can switch a few randomly chosen bits from 1 to 0 or from 0 to 1.Mutation can be then illustrated as follows: Original offspring 1 1101111000011110 Original offspring 2 1101100100110110 Mutated offspring 1 1100111000011110 Mutated offspring 2 1101101100110110The technique of mutation (as well as crossover) depends mainly on the encoding ofchromosomes. For example when we are encoding permutations, mutation could beperformed as an exchange of two genes.Crossover and mutation probabilityThere are two basic parameters of GA - crossover probability and mutation probability.Crossover probability: how often crossover will be performed. If there is no crossover,offspring are exact copies of parents. If there is crossover, offspring are made from partsof both parents chromosome. If crossover probability is 100%, then all offspring aremade by crossover. If it is 0%, whole new generation is made from exact copies ofchromosomes from old population (but this does not mean that the new generation is thesame!).Crossover is made in hope that new chromosomes will contain good parts of oldchromosomes and therefore the new chromosomes will be better. However, it is good toleave some part of old population survive to next generation.Mutation probability: how often parts of chromosome will be mutated. If there is nomutation, offspring are generated immediately after crossover (or directly copied)without any change. If mutation is performed, one or more parts of a chromosome are
  5. 5. changed. If mutation probability is 100%, whole chromosome is changed, if it is 0%,nothing is changed.Mutation generally prevents the GA from falling into local extremes. Mutation shouldnot occur very often, because then GA will in fact change to random search.Other parametersThere are also some other parameters of GA. One another particularly importantparameter is population size.Population size: how many chromosomes are in population (in one generation). If thereare too few chromosomes, GA has few possibilities to perform crossover and only asmall part of search space is explored. On the other hand, if there are too manychromosomes, GA slows down. Research shows that after some limit (which dependsmainly on encoding and the problem) it is not useful to use very large populationsbecause it does not solve the problem faster than moderate sized populations.Parameters of GA • Crossover rate Crossover rate should be high generally, about 80%-95%. (However some results show that for some problems crossover rate about 60% is the best.) • Mutation rate On the other side, mutation rate should be very low. Best rates seems to be about 0.5%-1%. • Population size It may be surprising, that very big population size usually does not improve performance of GA (in the sense of speed of finding solution). Good population size is about 20-30, however sometimes sizes 50-100 are reported as the best. Some research also shows, that the best population size depends on the size of
  6. 6. encoded string (chromosomes). It means that if you have chromosomes with 32 bits, the population should be higher than for chromosomes with 16 bits. • Selection Basic roulette wheel selection can be used, but sometimes rank selection can be better. There are also some more sophisticated methods that change parameters of selection during the run of GA. Basically, these behave similarly like simulated annealing. Elitism should be used for sure if you do not use other method for saving the best found solution. • Encoding Encoding depends on the problem and also on the size of instance of the problem.Search spaceIf we are solving a problem, we are usually looking for some solution which will be thebest among others. The space of all feasible solutions (the set of solutions among whichthe desired solution resides) is called search space (also state space). Each point in thesearch space represents one possible solution. Each possible solution can be "marked" byits value (or fitness) for the problem. With GA we look for the best solution amongamong a number of possible solutions - represented by one point in the search space.Looking for a solution is then equal to looking for some extreme value (minimum ormaximum) in the search space. At times the search space may be well defined, butusually we know only a few points in the search space. In the process of using GA, theprocess of finding solutions generates other points (possible solutions) as evolutionproceeds.
  7. 7. Example of a search spaceThe problem is that the search can be very complicated. One may not know where to lookfor a solution or where to start. There are many methods one can use for finding asuitable solution, but these methods do not necessarily provide the best solution. Someof these methods are hill climbing, tabu search, simulated annealing and the geneticalgorithm. The solutions found by these methods are often considered as good solutions,because it is not often possible to prove what the optimum is.A GA-BASED SCHEDULING SYSTEM --THE APPROACH FOR STATIC JSSPs The proposed approach to dynamic JSSPs is based on our original GA-basedscheduling system devised for static JSSPs. Here approach for static JSSPs is brieflyexplained. Each individual is a direct representation which encodes for each operation (inindex order) its starting time in a feasible schedule. The number of fields on thechromosome is the number of operations. Such a direct representation doesn’t suffer fromthe problem of false competition-- different representations of the same schedulecompeting against one another -- which is found in some indirect representation schemes.Another advantage in the direct representation is the ease of encoding the schedule intothe chromosome. In some indirect representations, such as prioritization of schedulingrules, it is difficult to encode the schedule back to the chromosome. This advantage ismore important in our approach because the genetic operators we designed work on theschedule level and the modified schedules need to be encoded back to the chromosomes.The genetic operators are inspired by the Giffler and Thompson (G&T) algorithm. TheG&T algorithm is a systematic approach to generate active schedules, in which nooperations can be completed earlier without delaying other operations.
  8. 8. The Giffler and Thompson AlgorithmStep 1:Let C contain the first schedulable operation of each job;Let rjm = 0, for all operations (j, m) in C.Step 2:Compute t(C) = min {rjm + pjm} ( j, m )∈ Cand let m* denote the machine on which the minimum is achieved.Step 3:Let G denote the conflict set of all operations (j, m*) on machine m* such that rjm* < t(C)Step 4:Randomly select one operation from G and schedule it.Step 5:Delete the operation from C; include its immediate successor in C, update rjm in C andreturn to step 2 until all operations are scheduled. Basically, the G&T algorithm is used as an interpreter to decode any offspringinto an active schedule. At each decision point in the G&T algorithm (step 4), theoperation with the earliest starting time reported in the parental schedule is chosen to bescheduled next. In contrast to previous approaches, which work on the chromosomelevel, the designed time horizon exchange (THX) crossover works on the schedule level.THX crossover randomly selects a crossover point just like a standard crossover, butinstead of using the crossover point to exchange two chromosomes, THX crossover usesthe crossover point as a scheduling decision point mark in the G&T algorithm toexchange information between two schedules. Before the decision point mark, thetemporal relations among operations are inherited from one parent. In the remainingportion, the temporal relations are inherited from the other parent to the extent possible(i.e., while maintaining a valid schedule). The mutation operator randomly selects twooperations in the block -- a sequence of successive operations on the critical path whichare on the same machine with at least two operations. These two operations are reversed.After the mutated child is generated, the G&T algorithm is applied to interpret the child.CONCLUSION • The experimental results show that significant improvement over priority rule approaches was achieved for both deterministic and stochastic JSSPs using a genetic algorithm approach.
  9. 9. • A consistent superiority shows the robustness of the GA to the objective functions. • The selection of a different and appropriate scheduling rule improves the system performance under different manufacturing environments.ACKNOWLEDGEMENTS We express our deep sense of gratitude to Dr.B.V.RAMANA MURTY professorand head of the Mechanical department of Raghu engineering college Visakhapatnam forhis inspiring and esteemed guidance and support for preparing this paperREFERENCES[1] Adams, J., Balas, E., and Zawack, D. “The Shifting Bottleneck Procedure in Job ShopScheduling,” Management Science, vol. 34, pp. 391-401, 1988.[2] Bierwirth, C., Kropfer, H., Mattfeld, D.C., and Rixen, I., “Genetic Algorithm basedScheduling in a Dynamic Manufacturing Environment,” IEEE Conf. on EvolutionaryComputation, Perth, IEEE Press, 1995.[3] Davis, L., “Job-shop Scheduling with Genetic Algorithms,” Proc. Int’l Conf. onGenetic Algorithms and their Applications, pp. 136-149, Lawrence Erlbaum, Hillsdale,NJ, 1985.[4] Dorndorf, U. and Pesch, E. “Evolution Based Learning in a Job Shop SchedulingEnvironment,” Computers Operations Research, vol. 22, pp. 25-40,1995.[5] Dorndorf, U. and Pesch, E. “Combining Genetic and Local Search for Solving the JobShop Scheduling Problem,” APMOD93 Proc. Preprints, pp. 142-149, Budapest,Hungary, 1993.[6] Fang, H., “Genetic Algorithms in Timetabling and Scheduling,” Ph.D. thesis,Department of Artificial Intelligence, University of Edinburgh, 1994.[7] Fang, H., Ross, P. and Corne, D., “A Promising Genetic Algorithm Approach to Job-Shop Scheduling, Rescheduling, and Open-Shop Scheduling Problems,” Proc. Fifth Int’lConf. on Genetic Algorithms, pp. 375-382, Morgan Kaufmann, San Mateo, CA, 1993.[8] Giffler, J. and Thompson, G.L., “Algorithms for Solving Production SchedulingProblems,” Operations Research, Vol. 8, pp. 487-503, 1960.[9] Goodman, E. D. An Introduction to GALOPPS, Technical Report GARAGe95-06-01,Genetic Algorithms Research and Applications Group, Michigan State University, 1995.[10] Kobayashi, S., Ono, I., and Yamamura, M. “An Efficient Genetic Algorithm for JobShop Scheduling Problems,” Proc. Sixth Int’l Conf. on Genetic Algorithms, pp. 506-511,MorganKaufmann, San Mateo, CA, 1995. APPENDIX The program that has been developed and used in the present workis given below#include<stdio.h>#include<conio.h>
  10. 10. void main(){int i,k,l,m,n,b,popsize,r,q,t,v[20][20],c[20][20],p[20][20],j[20][20],cmax[20];clrscr();printf("enter the no. of jobsn");scanf("%d",&n);printf("enter the no. of machinesn");scanf("%d",&m);for(i=1;i<=n;i++)for(k=1;k<=m;k++){printf("enter the processing time of job %d on machine %d ",i,k);scanf("%d",&p[i][k]);}printf("enter the population sizen");scanf("%d",&popsize);for(i=1;i<=popsize;i++){printf("enter the job sequence %d",i);for(k=1;k<=n;k++)scanf("%d",&j[i][k]);}for(t=0;t<30;t++){for(i=1;i<=popsize;i++)c[j[i][1]][1]=p[j[i][1]][1];for(i=2;i<=n;i++)c[j[l][i]][1]=c[j[l][i-1]][1]+p[j[l][i]][1];for(k=2;k<=m;k++)c[j[l][1]][k]=c[j[l][1]][k-1]+p[j[l][1]][k];for(i=2;i<=n;i++)for(k=2;k<=m;k++){if((c[j[l][i-1]][k])>(c[j[l][i]][k-1]))b=c[j[l][i-1]][k];elseb=c[j[l][i]][k-1];c[j[l][i]][k]=b+p[j[l][i]][k];}cmax[l]=c[j[l][n]][m];}for(l=1;l<=popsize;l++)printf("%3d",cmax[l]);for(l=1;l<popsize;l++){ for(q=l+1;q<=popsize;q++) { if(cmax[l]<cmax[q]) { r= cmax[q]; cmax[q]=cmax[l]; cmax[l]=r;
  11. 11. for(k=1;k<=n;k++) { v[q][k]=j[q][k]; } } }}printf("nthe arranged fx and array are:n");for(i=1;i<=popsize;i++)printf("%dn",cmax[i]);for(i=1;i<=popsize;i++){for(k=1;k<=n;k++)printf("%2d",j[i][k]);printf("n");}printf("nassigning strong string in place of weak stringnn");for(k=1;k<=n;k++)j[1][k]=j[popsize][k];printf("nprinting the mating poolnn");for(l=1;l<=popsize;l++){for(k=1;k<=n;k++)printf("%2d",j[l][k]);printf("n");}printf("nTHE PROCESS OF MUTATIONnn");for(l=1,q=1;l<popsize;l++,q++){ v[l][q]=j[l][q]; j[l][q]=j[l][q+1]; j[l][q+1]=v[l][q];}for(l=1;l<=popsize;l++){for(k=1;k<=n;k++)printf("%2d",j[l][k]);printf("n");}}getch();}