EUROPEAN JOURNAL OF OPERATIONAL RESEARCH
ELSEVIER
European Journal of Operational Research 80 (1995) 389-396
Theory and Methodology
An application of genetic algorithms for flow shop problems Chuen-Lung Chen *, Venkateswara S. Vempati, Nasser Aljaber Department of Industrial Engineering, Mississippi State University, Mississippi State, MS 39762, USA
Received January 1993
Abstract
This research studies an application of genetic algorithms for flow shop problems with makespan as the criterion. We generate a genetic Algorithm (GA) based heuristic for these problems, and compare the computational results of the heuristic with the results of some existing heuristics. The conclusions show that the GA based heuristic can always give the best results in a short time on a SUN workstation. Keywords: Flow shop problem; Genetic algorithms
1. Introduction
The flow shop problem is a scheduling problem which considers m different machines and n jobs; each of the jobs consists of m operations; and each of the operations requires a different machine; and all the jobs are processed in the same processing order. In this research, we study the flow shop problem considering the following assumptions: all the jobs are available at time zero, setup times for the operations are sequence-independent and are included in processing times, job descriptors are known in advance, m different machines are continuously available, and individual operations are not preemptable [1].
* Corresponding author.
Johnson (1954) is a pioneer in the research of flow shop problems. He proposed an 'easy' algorithm to the two machine flow shop problem with makespan as the criterion. Since then, several researchers have focused on solving m-machine (m > 2) flow shop problems with the same criterion. As these fall in the class of NP hard [6], complete enumeration techniques must be used to solve these problems. As the problem size increases, this approach is not computationally practical. For this reason, researchers have constantly focused on developing heuristics for the hard problems. Heuristics by Palmer (1965), Campbell, Dudek and Smith (1970), Gupta (1971), Dannenbring (1977), Nawaz, Enscore and Ham (1983, [12]), Hundal and Rajgopal (1988, [10]), Widmer and Hertz (1989, [15]), Taillard (1990, [13]), and Ho and Chang (1991, [9]) are existing heuristics for the m-machine n-job flow shop problem with makespan as the criterion. Palmer's heuristic first calculates a slope order for each job, then se-
0377-2217/95/$09.50 © 1995 Elsevier Science B.V. All rights reserved SSDI 0377-2217(93)E0228-P
390
C.-L. Chen et al. / European Journal of Operational Research 80 (1995) 389-396
quences the jobs according to the slope orders. This is based on the idea of giving priority to jobs having the strongest tendency to progress from short times to long times in the sequence of operations [1]. Gupta presented a similar slope order index sequencing method, except that he computes the slope in a different way. Campbell, Dudek and Smith (CDS) presented a heuristic which is an extension to Johnson's rule. Their method splits the original m-machine problem into a set of rn-1 two-machine problems and solves each of these by Johnson's rule. The best of these schedules is the solution to the original problem. Dannenbring's heuristic attempts to combine the advantages of the heuristics presented by Palmer and CDS. His method is called the rapid access procedure (RA) and its purpose is to provide a quick and good solution. His method constructs an artificial two-machine problem in which the processing times are determined from a weighting scheme. The problem is solved by using Johnson's rule. Hundal and Rajgopal [10] attempted to improve Palmer's heuristic by a simple extension procedure in which they have included the idea of the CDS method. In calculating the slope index using Palmer's heuristic for all the jobs, machine number ½(m + 1) is ignored and this may affect the quality of the schedule when 'n' (number of jobs) is large. So the simple extension proposed by Rajgopal and Hundal is an attempt to provide a weightage to the ½(m + 1) machine also. In their approach two other slope indices are developed to obtain two more schedules other than the schedule from Palmer's heuristic. The best schedule from the three schedules is selected. Nawaz, Enscore and Ham [12] proposed a heuristic called NEH, in which the initial schedule is produced by arranging the jobs in decreasing order of their sum of processing times on the machines. Then the first two jobs are selected and are scheduled in order to minimize the makespan of the partial schedule. Then the third job is inserted in the partial sequence in such a way that the insertion minimizes the makespan of the partial schedule. This process is repeated until all the jobs are scheduled. Taillard [13]
applied tabu search to the flow shop problem. In his approach he used an improved NEH algorithm (by reducing its complexity from O(nam) to O(n2m)) to obtain a schedule which is used as the initial solution for the tabu search. He also thoroughly analyzed the parameters considered in the application of tabu search to the flow shop problem, and provided two methods for the parallelization of tabu search. Widmer and Hertz [15] presented a heuristic called SPIRIT which is composed of two phases: the first phase determines an initial solution using the analogy with the travelling salesman problem and the second phase tries to improve this solution using the tabu search technique. In their paper, they also compared their results with all the previous heuristics, and showed that their heuristic always generated better solutions. Ho and Chang [9] discussed a new heuristic that minimizes the gap between successive operations in solutions generated by other heuristics. In this research, we develop a genetic algorithm based heuristic for the flow shop problems. Genetic algorithms, developed by John Holland in the 1970's, are search algorithms that are based on the idea of genetic evolution. The algorithms have been proven to be efficient for many computationally complex problems. Several researchers also presented encouraging results by applying genetic algorithms to scheduling problems. Grefenstette et al. [8], Goldberg [7], and Whitley et al. [14] presented the applications of genetic algorithms to the travelling salesman problem. Cleveland and Smith [4] discussed the use of genetic algorithms as a means of scheduling the release of jobs into a manufacturing facility. Davis [5] and Biegal and Davern [2] presented applications of genetic algorithms to job shop problems. The following section introduces genetic algorithms and discusses the generation of the parameters for a genetic algorithm based heuristic for the flow shop problems. Section 3 generates 200 problems for 20 different combinations of job size and number of machines, and compares the efficiency among the genetic algorithm based heuristic, Widmer and Hertz's heuristic (SPIRIT), and Ho and Chang's heuristic. The conclusions will be discussed in Section 4.
C.-L. Chen et al. / European Journal of Operational Research 80 (1995) 389-396
2. Genetic algorithms based heuristic Genetics is a biological term. Biologically, genes of a good parent produce better offsprings. The same concept underlies the development of Genetic Algorithms (GA). Genetic algorithms search a problem space with a population of structures and select structures for continued search based on their performance. Each structure decodes to form a point in the problem space in the context of optimization problems. Genetic operators are applied to high performance structures (parents) in order to generate potentially fit new structures (offspring). Therefore, good performers propagate through the population from one generation to the next [3]. According to previous ideas, a genetic algorithm contains the following major ingredients: representation of a structure, initial population and population size, fitness of the members in a population, selection of parents, genetic operators, and a termination criterion. We now start to discuss these ingredients for a genetic algorithm based heuristic for the flow shop problem.
2.1. Representation of a structure For a scheduling problem, a structure can be easily described as a sequence of the jobs in the problem. This is also true for the flow shop problems. 2.2. Generation of initial population and population size The efficiency of genetic algorithms can be largely increased by selecting a good initial population and reasonable population size. This heuristic uses the m-1 schedules produced by the CDS method, along with the schedule generated by using Dannenbring's method to generate an initial population. The first of the rn schedules is selected and two positions of this schedule are swapped to generate another member of the initial population. This member is appended to the existing members. Now the second member of the existing population is selected and the same process is repeated to produce another offspring.
391
This member is then appended to the existing population. The aforementioned process is repeated until the size of the initial population equals the desired size. For instance, if we consider a 15-job, 10-machine problem, then the first 9 schedules in the initial population are generated by using the CDS method and the 10th schedule is generated by Danninbring's method. So now we have 10 schedules in the initial population. The l l t h schedule is generated by picking the 1st schedule and mutating it. Let us suppose the first schedule is 367214581210119131415. Then the mutation operation is performed by randomly selecting two locations in the schedule and swapping the jobs in them. Let us suppose the randomly selected locations are 5 and 9. Then the jobs in positions 5 and 9, which are job 1 and job 12, are swapped to generate a new schedule: 367212458110119131415. This schedule is then appended to the initial population as the l l t h schedule and then the 2nd schedule in the initial population is picked and mutated to generate a new schedule which becomes the 12th member of the population. This process is repeated until the required number (60) of schedules are formed in the initial population. In our experiments, we generated some trial examples and ran our heuristic with different population sizes for each example. We found that the population with size more than sixty cannot guarantee better results than the population with size equal to sixty. Therefore, we decided to let the population size in our heuristic be sixty.
2.3. Fitness function and the selection of parents For a maximization problem, the measure of performance generally constitutes the fitness function. However, the objective of scheduling problems is usually to minimize a certain measure of performance. For minimization problems, the method to determine the fitness function differs slightly from the maximization problems. We now discuss the method for determining the fitness function for the flow shop problems. We first calculate the makespan for all the
392
C.-L. Chen et al. /European Journal of Operational Research 80 (I 995) 389-396
members in a population using the Gantt chart. From this the largest makespan is determined and is denoted as CMAX. The deviation of makespan of each member in the population from the CMAX is the fitness value of that particular member. This is done to ensure that the probability of selection for a schedule with lower makespan is high. This is also the criterion used for the selection of parents for the reproduction of children.
2.4. Genetic operators T h e r e are two common genetic operators in genetic algorithms: crossover and mutation. A crossover operator involves combining the elements from two parent structures into one or more child structures. Mutation typically works with a single structure leaving the parent intact with the population. Goldberg's partially mapped crossover (PMX) operator, edge recombination operator, subtour-swap operator, subtour-chunk operator, subtour-replace operator, and weighted chunking operator are some of the popular crossover operators for scheduling problems [4]. This heuristic uses the Goldberg's PMX operator for the purpose of crossover. The procedure of Goldberg's PMX operator is as follows [4]:
Step 1. Choose an interval, which is always described as a set of consecutive positions in a structure, from each of the two parent structures. Step 2. Determine mappings of the elements in the two selected interval. Step 3. Swap the selected intervals in the two parent structures. Step 4. Exchange the mapping elements which are determined in Step 2 and do not locate in the selected intervals in the parent structures. The following example is developed to illustrate the procedure. Let structures A and B be the parent structures chosen for crossover. The elements in the structures are jobs. A =28456713, B=87132465. In applying the PMX to structures A and B,
we first choose an interval to be swapped. In this example, we randomly choose the positions from three to five. Then we determine the mappings between the selected intervals in A and B. In this example, the mappings between the selected intervals in A and B is 4 to 1, 5 to 3, and 6 to 2. Next, we swap the two intervals in A and B. The following structures show the temporary results after the exchange. Obviously, both of them are not feasible. A =28132713, B = 87456465. Therefore, in the final step, we exchange the mapping elements which are determined in the second step and do not locate in the selected intervals in A and B, so the new structures (children) can be feasible. In this example, the 1, 2, and 3 in structure A is replaced by 4, 6, and 5, respectively. And the 4, 5, and 6 in structure B is replaced by 1, 3, and 2, respectively. The feasible results (children structures) are shown below: A'--- 6 8 1 3 2 7 4 5 , B'--- 8 7 4 5 6 1 2 3 . As shown in the above example, the swapping operation of the PMX operator may not always produce a feasible structure. So when infeasible solutions are obtained, conflicts in both the structures are resolved by forward mapping or backward mapping. Using the trial examples that we generated, we apply the G A based heuristic with different combinations of crossover rate and mutation rate, where crossover rate and mutation rate are the probability that the crossover operator and mutation operator are applied to the chosen parents, respectively. The crossover rates considered are 1, 0.95, and 0.90, and the mutation rates considered are 0.01, 0.005, and 0. We found that crossover rate equals to 1.0 and mutation rate equals to 0 performed very well on all the trial examples. Therefore, we only use the crossover operator in our heuristic, and the crossover rate is set to 1.
2.5. Termination criterion We use the number of generations as the termination criterion in our heuristic. Again, ac-
C.-L. Chen et al. / European Journal of Operational Research 80 (1995) 389-396
cording to our trial examples, we found that the solutions become stable after twenty generations. Therefore, we use twenty as the termination criterion in our heuristic.
2.6. The genetic algorithm based heuristic We are now at the position to present the genetic algorithm based heuristic for the flow shop problem. The following notation will be used in describing the heuristic: S(t): The population in the t-th generation. si(t): The i-th member in S(t). C(si(t)): The makespan of si(t). CMAX(t): max{C(si(t))} , for all si(t) ~ S(t). f(si(t)): The fitness of Si(t) , which is equal to C M A X ( t ) - C ( s i ( t )). TOTFIT(t): The sum of f(si(t)), for all si(t)
Table 2 Relative performance of G A
393
(CGA/CHC)
n
rn 4
5
8
10
15
7 10 15 25
96.07 98.04 98.33 98.73
95.09 93.93 96.73 97.45
96.37 97.06 95.87 96.45
97.50 97.43 96.84 97.05
97.42 97.28 97.83 97.75
generation t + 1. If the size of the tion is equal to the POPSIZE, then else go to Step 4. Step 6. If current generation, t + GENER, then stop, else go to Step
new populago to Step 6, 1, is equal to 2.
3. Computational results
S(t). Step 1. Determine the initial population, S(t), where t = 0, as described in Section 2.1. The size of the population, POPSIZ, is sixty and the number of generations considered, GENER, is twenty. Step 2. Calculate the fitness value of each member, f(si(t)), for population, S(t). Step 3. Calculate the selection probability for each si(t), where the selection probability is defined as
f(si(t)) P(si(t))
TOTF I T "
Step 4. Select a pair of members (parents) that will be used for reproduction via the selection probability. Step 5. Apply the PMX operator to the parents. Replace the parents with the resulting offsprings to form a new population, S(t + 1), for Table 1 Relative performance of G A n
7 10 15 25
(CGA/CsPiR)
m 4
5
8
10
15
99,25 98,73 99,51 99.69
96.94 96.93 98.04 98.80
98.28 98.44 98.39 98.58
98.60 98.81 98.80 98.62
98.72 98.96 99.71 99.22
The effectiveness of the GA based heuristic was tested by comparing the makespan produced by this heuristic with the makespan produced by both the SPIRIT and Ho and Chang's heuristic where the former is the best existing heuristic and the latter is the latest known heuristic to solve the problem under consideration. In order to make comparisons, 200 problems were generated for 20 different combinations of job size and number of machines. The processing times of the jobs on all machines are uniformly distributed from 1 to 30. For each combination, the relative performance of the GA based heuristic to the SPIRIT and Ho and Chang's heuristic was computed by CGA/CsPIR and CGA/CHc where C refers to the average makespan of the problems in the combination. The results are shown in Table 1 and Table 2, respectively. Following the analysis methods of Widmer and Hertz [15], more detailed comparisons between the GA based heuristic and the two heuristics are presented in Tables 3 and 4. In these two tables, the first column is a couple of the number of jobs, n, and the number of machines, m. The second column is the number of generated problems for the couple. The third column and fifth column illustrate the number of times the best solution was obtained by the heuristic used, respectively. The fourth column shows the number of times that
C-L. Chen et al. / European Journal of Operational Research 80 (1995) 389-396
394 Table 3 Comparison G A - S P I R I T n x m
Generated problems
Advantage GA
Even
Advantage SPIRIT
% GA
% SPIRIT
7× 4 7x 5 7× 8 7 × 10 7 x 15 10 x 4 10 x 5 10 x 8 10 x 10 10 × 15 15 x 4 15 x 5 15 × 8 15 x 10 15 x 15 25 x 4 25 x 5 25 x 8 25 x 10 25 × 15 Total
10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 200
5 7 7 6 6 5 8 7 6 7 5 7 8 9 8 6 5 9 9 8 138
5 3 3 4 4 5 2 1 3 3 4 3 1 0 2 3 5 1 0 22 54
0 0 0 0 0 0 0 2 1 0 1 0 1 1 0 1 0 0 1 0 8
100 100 100 100 100 100 100 8 90 100 90 100 90 90 100 90 100 100 90 100 96
50 30 30 40 40 50 20 30 40 30 50 30 20 10 20 40 50 10 10 20 31
Table 4 Comparison G A - H C n × m
Generated problems
Advantage GA
Even
Advantage HC
% GA
% HC
7× 4 7x 5 7× 8 7 × 10 7 × 15 10 x 4 10 x 5 10 x 8 10 x 10 10 x 15 15 x 4 15 x 5 15 x 8 15 x 10 15 x 15 25 x 4 25 x 5 25 x 8 25 × 10 25 x 15 Total
10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 200
8 9 9 6 8 6 10 9 9 10 8 9 10 10 10 7 9 10 10 10 177
2 1 1 4 2 4 0 1 1 0 2 1 0 0 0 3 1 0 0 0 23
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100
20 10 10 40 20 40 0 10 10 0 20 10 0 0 0 30 10 0 0 0 11.5
C-L. Chen et al. / European Journal of Operational Research 80 (1995) 389-396
two heuristics in a comparison give the same makespan. The last two columns show the percentage of success of each heuristic, the total number of times that the heuristic gives the best solution (number of advantage + number of even) divided by the number of generated problems [151. According to the results in Table 1 and Table 2, the GA based heuristic obviously yields better average makespan than the SPIRIT and Ho and Chang's heuristic. Table 3 shows that in the 200 generated examples, the SPIRIT gets better results than the GA based heuristic only 8 times out of 200, while the GA based heuristic is better 138 times out of 200. Table 4 shows similar results; Ho and Chang's heuristic can not give any better results than the GA based heuristic, while the GA based heuristic is better 177 times out of the 200 examples. The percentage of success in Table 3, the GA based heuristic 96% and the SPIRIT 31%, and in Table 4, the GA based heuristic 100% and Ho and Chang's heuristic only 11.5%, is another significant indicator to show that the GA based heuristic consistently gives better results than the SPIRIT and Ho and Chang's heuristic. In addition to being superior to any other existing heuristic in minimizing the makespan, the CPU time required to solve a flow shop problem using this heuristic is short enough to make it applicable to solve real world problems. The GA based heuristic is programmed using Fortran 77, and was run on a SUN4/490 machine. Table 5 exhibits the average CPU time required to solve the 200 generated flow shop problems.
Table 5 Average CPU time in seconds Job 7
10 15 25
Machine 4
5
8
10
15
0.8 1.2 1.9 5.4
0.8 1.2 2.2 5.4
1.1 1.6 2.6 6.4
1.1 1.7 2.8 7.2
1.6 2.3 3.5 7.9
395
4. Conclusion
In this paper, we develop an application of a genetic algorithm based heuristic to flow shop problems with makespan as the criterion. According to the computational results, the genetic algorithm based heuristic has been proven to be an effective heuristic for flow shop problems. Specifically, the heuristic is very efficient; the required CPU time on a SUN4/419 machine is short. This means the heuristic can be easily applied to real world problems. Also, the GA based heuristic can be easily extended to solve flow shop problems with other criteria, such as total flow time, maximum tardiness, total tardiness, etc., which have also been proven to be hard [11]. Further research is to develop a systematic approach for determining the approaches or values of the major ingredients of genetic algorithms for scheduling problems. In this research, we use the results of the application of the GA based heuristic to several trial examples to determine the approach for generating an initial population, the population size, the selection probability, the genetic operators, the rates of genetic operators, and the termination criterion. Even though the results in this research are promising, we believe that the results can be improved through systematically analyzing the effects of these major ingredients to the performance of the GA based heuristic.
References [1] Baker, K.R., Introduction to Sequencing and Scheduling, Wiley, New York, 1974. [2] Biegal, J.E., and Davern, J.J., "Genetic algorithms and job shop scheduling", Computers and Industrial Engineering 19 (1990). [3] Bowden, Jr., R.O., "Genetic algorithm based machine learning applied to the dynamic routing of discrete parts", Dissertation, Department of Industrial Engineering, Mississippi State University, 1992. [4] Cleveland, G.A., and Smith, S.F., "Using genetic algorithms to schedule flow shop releases", in: J.D. Schaffer (ed.), Proceedings of the Third International Conference on Genetic Algorithms Applications, Morgan Kaufmann, San Mateo, CA, 1989, 160-169. [5] Davis, L., "Job shop scheduling with genetic algorithms", in: J.J. Grefenstette (ed.), Proceedings of an International
396
C.-L. Chen et al. / European Journal of Operational Research 80 (1995) 389-396
Conference on Genetic Algorithms and Their Applications, Carnegie-Mellon University, Pittsburgh, PA, 1985, 136140. [6] Garey, M.R., Johnson, D.S., and Sethi, R., "The complexity of flowshop and job-shop scheduling", Mathematics of Operations Research, 1 (1976) 117-129. [7] Goidberg, D.E., and Lingle, Jr., R., "Alleles, loci and the Travelling Salesman Problem", in: J.J. Grefenstette (ed.), Proceedings of an International Conference on Genetic Algorithms and Their Applications, Carnegie-Mellon University, Pittsburgh, PA, 1985, 154-159. [8] Grefenstette, J., Gopal, R., Rosmaita, B., and Van Gucht, D., "Genetic Algorithm for the Travelling Salesman Problem", in: J.J. Grefenstette (ed.), Proceedings of an International Conference on Genetic Algorithms and Their Applications, Carnegie-Mellon University, Pittsburgh, PA, 1985, 160-168. [9] Ho, J.C., and Chang, Y.L., "A new heuristic for the n-job, m-machine flow-shop problem", European Journal of Operational Research 52 (1991) 194-202. [10] Hundal, T.S., and Rajgopal, J., "An extension of Palmer's heuristic for the flow-shop scheduling problem", Interna-
[11]
[12]
[13]
[14]
[15]
tional Journal of Production Research 26 (1988) 11191124. Lageweg, B.J., Lawler, E.L., Lenstra, J.K., and Rinnooy Kan, A.H.G., "Computer aided complexity classification of deterministic scheduling problems", Stichting Mathematisch Centrum, Amsterdam, Netherlands, 1981. Nawaz, M., Enscore, Jr., E.E., and Ham, I., "A heuristic algorithm for the m-machine, n-job flow shop sequencing problem", OMEGA, International Journal of Management Science 11 (1983). Taillard, E., "Some efficient heuristic methods for the flow shop sequencing problem", European Journal of Operational Research 47 (1990) 65-74. Whitley, D., Starkwether, T., and Shaner, D., "The Travelling Salesman and Sequence Scheduling Problems: Quality solutions using genetic edge recombination", in: L. Davis (ed.), Handbook of Genetic Algorithms, van Nostrand Reinhold, New York, 1991, 350-372. Widmer, M., and Hertz, A., "A new heuristic for the Flow shop Sequencing Problem", European Journal of Operational Research 41 (1989) 186-193.