A GENETIC LOCAL SEARCH ALGORITHM FOR MINIMIZING THE TOTAL WEIGHTED TARDINESS IN A JOB-SHOP Imen Essafi1 ∗ Yazid Mati2 ∗∗
∗∗
∗ Ecole des Mines de Nantes, France Al-Qassim University, College of Business & Economics Kingdom of Saudi Arabia
Abstract: We consider a job-shop scheduling problem with release dates and due dates, with the objective of minimizing the total weighted tardiness. A genetic algorithm is combined with an iterated local search that uses a neighborhood based on a disjunctive graph model. In this paper, we show that the efficiency of genetic algorithms does no longer depend on the schedule builder when an iterated local search is used. Computational experiments carried out on instances of the literature show the efficiency of the proposed algorithm over the existing methods. c Copyright 2006 IFAC
Keywords: Job-shop scheduling, Total weighted tardiness, Hybrid genetic algorithm.
1. INTRODUCTION In this paper, the minimization of the total weighted tardiness in a job-shop environment is considered. The problem can be described as follows: a set of n jobs is to be processed on a set of m machines that are continuously available from time zero onwards. Each machine can perform at most one job at a time. A job Ji consists of an ordered sequence of m operations each of them is processed without preemption on a given machine. An operation j of job Ji , noted oi,j , requires a processing time of pi,j > 0 time units on a machine. Moreover, a job Ji is characterized by a release date ri , a weight wi giving its importance, and a due date di before which it should be completed. The total weighted tardiness Pn is defined as i=1 wi max{0, Ci − di } where Ci is the completion time of job Ji . Using the three field notation of (Graham et al., 1979), the Pproblem under study can be denoted by J | ri | wi Ti . 1 Corresponding author:
[email protected] 2 Part of this research was conducted when the author was at the Ecole des Mines St-Etienne, Gardanne-France
Even though a huge number of exact and approximate methods have been developed for the jobshop problem (Jain and Meeran, 1999), the majority of them are designed for the makespan. Most successful approaches are local search heuristics such as taboo search (Nowicki and Smutnicki, 1996) and iterated local search (Lourenco, 1995). Genetic algorithms have also been applied successfully to the job-shop problem (Volta et al., 1995). Current trends are to combine genetic algorithms with other local search heuristics (Goncalves et al., 2005). Despite the increasing importance of customer service in terms of meeting due dates, works dealing with the minimization of due date related objectives in job-shops are very scarce. Some dispatching rules are developed in (Vepsalainen and Morton, 1985) and a shifting bottleneck procedure is proposed in (Pinedo and Singer, 1999). The large step random walk heuristic proposed in (Kreipl, 2000) isP up to now the best approach for solving J | ri | wi Ti problem. Recently, a genetic algorithm that considers various tardi-
ness criteria is proposed in (Mattfeld and Bierwirth, 2004). Large-size problems are investigated in (Singer, 2001) where a time window decomposition method is proposed. The only existing exact method is the branch and bound proposed in (Singer and Pinedo, 1998). In this paper, we provide a new genetic local search algorithm for this problem. We first describe the algorithm proposed, then parameter tuning and computational experiments are performed, finally we conclude with some suggestions and refinements.
2. A GENETIC LOCAL SEARCH ALGORITHM Genetic algorithms are general search techniques based on the mechanism of natural selection and genetics. A genetic algorithm starts with a set of feasible solutions (population) and iteratively replaces the current population by a new population. It requires a suitable encoding for the problem and a fitness function that represents a measure of the quality of each encoded solution (chromosome or individual). The reproduction mechanism selects the parents and recombines them using the crossover operator to generate offsprings that are submitted to a mutation operator in order to alter them locally. The process is repeated until a prespecified stopping criterion is met. In order to improve the quality of the solutions, a local search operator is applied to every individual after the mutation phase.
2.1 Chromosome encoding and decoding There are different chromosome representations of a solution proposed in the literature (Cheng et al., 1996). In order to exploit the standard crossover operators and to keep the feasibility of the solutions in the reproduction process, a preference list based coding is used. A chromosome is an m × n matrix where a row i corresponds to machine Mi and contains an n-string representing a priority rule between operations performed on Mi . The priority rule is used whenever some operations compete for the same machine. Given an m × n matrix representing the priority rules, a decoding procedure, also called schedule builder, is employed to deduce a feasible schedule. The schedule builder proposed by (Storer et al., 1992) using a parameter δ ∈ [0, 1] to control the algorithm of (Giffler and Thompson, 1960) is employed. This procedure is successfully used in the GA developed by (Mattfeld and Bierwirth, 2004). A detailed description of the tunable schedule builder is given in Algorithm 1.
Algorithm 1. Tunable schedule builder 1. Let k=1 and P Sk an empty partial schedule and let A be the set of all schedulable operations 2. Determine the operation o∗ in A with the earliest possible completion time c∗ 3. Determine the machine m∗ of o∗ and build the set B from all operations in A that are processed on m∗ 4. Determine the operation in B with the earliest possible starting time s0 5. Delete all operations oi,j in B such that si,j < s0 + δ(c∗ − s0 ) 6. Select an operation o0 from B which occurs leftmost in the preference list and schedule it on P Sk as early as possible to create P Sk+1 7. Delete o0 from A and add its routing successor, increment k by one 8. Return to Step 2 until a complete schedule is generated
At each stage, the procedure selects an operation to be scheduled. Schedulable operations are operations not yet scheduled that have immediately scheduled predecessors. An operation oi,j is eliminated in step 5 if its earliest possible starting time si,j does not comply with the maximum time the machine m∗ is allowed to remain idle. Conflicts among the remaining operations are solved by the priority dispatching rule specified by the chromosome. Note that if the value of δ is set to 0 (resp. 1) the schedule builder generates non-delay (resp. active) schedules.
2.2 Recombination operators The crossover operator consists of exchanging the information of two parents of the existing population to produce two new chromosomes (offsprings). The roulette wheel is used to select two parents from the current population to be crossed. The partially mapped crossover (PMX ) is employed. This crossover consists of randomly selecting two cut positions, mapping the portion of one parent located between these positions onto the other parent, and then exchanging the remaining information. The crossover is applied with a probability pc = 1.0. The offspring with the best fitness is injected into the new population. After the generation of P off-springs, the new population becomes the current one. The individuals are then mutated according to a probability pm = 0.1. The mutation operator employed consists in choosing randomly two jobs in the sequence of a machine and exchanging their positions (i.e. only the priorities are exchanged). Note that the mutation is performed on each machine.
2.3 The local search procedure The solutions created by genetic operators are subject to a local search which tries to improve their fitness. In this paper, we investigate the effect of using an iterated local search on the quality
of solutions. For the sake of readability of this section, we start by presenting the disjunctive graph for the representation of feasible solutions of the job-shop problem with total weighted tardiness as the objective function. 2.3.1. The disjunctive graph representation The job-shop problem with the total weighted tardiness criterion can be represented as a disjunctive graph G = (V, C, D), which is a slight modification of the original disjunctive graph of (Roy and Sussmann, 1969). The set of nodes V is associated with operations of jobs to which we add a dummy source node O and n dummy sink nodes ϕi (i = 1, . . . , n). The source node O corresponds to the beginning of the schedule while the n sink nodes denote the completion of jobs. The set of conjunctive arcs C, which connect successive operations of the same job, represents the precedence constraints. The set of disjunctive arcs D, which link pairs of operations that have to be processed on the same machine, indicates that a machine cannot process more than one operation at a time. A feasible schedule can be obtained by replacing each disjunctive arc by a conjunctive arc, such as the resulting graph is circuit-free. The completion time of a job Ji , which is equal to the starting time of node ϕi , is given by the length of a longest path from O to ϕi . Thus, the total weighted tardiness of a feasible schedule results from the computation of the length of the longest paths (critical paths) L(O, ϕi ) from the origin node O to each sink node ϕi (i = 1, . . . , n). 2.3.2. Neighborhood structure Several neighborhood structures have been proposed in the various local search approaches developed for the job-shop problem with the makespan as the objective function. Most of those neighborhoods are based on the disjunctive graph model and consist of moves involving operations on the critical paths. The most commonly used neighborhood, which allows reaching an optimal solution from any initial solution, consists of interchanging adjacent operations on critical paths (i.e. critical arcs) (Laarhoven et al., 1992). The neighborhood chosen in our application consists in selecting one critical path for each job and interchanging every arc belonging to these paths. This neighborhood may be very large even for small-size problems. A possible way to reduce it is to consider only the late jobs since swapping an arc on the critical path of an early job cannot improve the criterion unless it belongs to a critical path of another late job. 2.3.3. Move evaluation strategy The move evaluation function that guides the selection of a neighbor solution is crucial for the success of local
search heuristics. A simple strategy for evaluating the quality of a move consists of recalculating the objective function each time an arc is interchanged, as done in (Kreipl, 2000). Despite the fact that this evaluation is exact, it is too time consuming to evaluate the neighborhood in this way. Estimation functions that give lower bounds on the objective function are frequently employed as they allow fast evaluation of the neighborhood without performing moves. For the job-shop problem, the lower bound proposed by (Taillard, 1994) for evaluating the quality of swap moves proved to work very efficiently with the makespan as the objective function. In a recent paper, Mati et al.(Mati et al., 2005) show that this lower bound is inaccurate for non-max criteria in particular for the total weighted tardiness. Since the length of n longest paths need to be estimated (i.e. one for each job), a bad evaluation of the completion times of few jobs may bring the search into unpromising regions. In this paper, we use the new estimation function proposed by (Mati et al., 2005) for evaluating the swap of a critical arc x → y. The new completion time of a job Ji is obtained by computing the length of paths that pass through the operations x and y (as in (Taillard, 1994)) but also through operations z with l(z) = l(x) where l(.) denotes the topological order of nodes of G. The motivation of considering operations z with l(z) = l(x) is that the length of a longest path L(O, ϕi ) that goes through an operation z but not through y remains unchanged after swapping the arc x → y. Further, the length L(O, ϕi ) can be easily computed using the head (length of a longest path from O to z) and tail (length of a longest path from z to ϕi ) values. The new estimation function is of better quality than the estimation of (Taillard, 1994), and has a complexity equal to O(n) (for each job). Extensive experiments performed in (Mati et al., 2005) have shown that it outperforms the estimation function of (Taillard, 1994) and the exact move evaluation for the weighted tardiness criterion. 2.3.4. The iterated local search procedure Iterated local search (ILS) is a very simple and powerful metaheuristic which consists in repeatedly applying a local search algorithm to solutions obtained by small modifications to one of the previously visited locally optimal solutions. Our ILS algorithm is very simple and consists of two alternating phases, an improving phase and a perturbation phase. The improving phase is a steepest descent that consists in accepting only moves that improve the current solution. Once the neighborhood does not contain any improving move, the steepest descent is stopped and the
perturbation phase is started from the local optimum of the improving phase. The perturbation phase accepts both improving and non-improving moves, and is used to overcome the problem of getting stuck in a local optimum and thus to bring the search into new regions. The two phases are repeated successively until a stopping criterion is reached. In our application, the neighborhood size is different depending on whether an improving or a perturbation phase is carried out. In the improving phase, only critical paths of late jobs are considered since swapping arcs belonging to only early jobs will not improve the solution. In the perturbation phase, even early jobs are considered. The perturbation procedure employed consists in randomly selecting a move during t iterations, where the parameter t is randomly chosen in the uniform distribution [tmin , tmax ]. Computational tests show that fixing tmin = 5 and tmax = 8 is sufficient to escape local optima and to guide the search into promising regions. The ILS procedure is stopped after performing nSD steepest descents. Each chromosome is replaced by the one obtained by the local search procedure. In order to introduce a sort of diversity in the population while recording good solutions, the replacing chromosome after the local search procedure corresponds to the best local optimum with a fitness value not existing in the population.
3. PARAMETER TUNING The efficiency of a genetic algorithm depends on the choice of the best parameters in order to prevent the premature convergence, to ensure diversity in the search space, to intensify the search around interesting regions, etc. Empirical tests have been performed to find the best tuning parameters of our genetic local search algorithm on a benchmark test of 20 10 × 10 instances. • • • •
population size: 40 schedule builder δ = 1 nSD in the range [50,80] mutation probability: 0.1
Parameter tuning tests have pointed out an important feature of GLS. While setting the best value of the parameter δ for GLS, we note that varying δ has a little impact on the mean objective function. Previous studies on genetic algorithms for the job-shop problem point out that these algorithms are highly depended on the way the chromosomes are decoded. Figure 1 shows that when no local search operator is used (GA) and when only a steepest descent is used (GA+SD) instead of an ILS (GA+ILS) the best value is δ = 0.6 and the mean objective value is highly
impacted by the δ value. This result agrees with the findings of (Mattfeld and Bierwirth, 2004) who point out that GAs are very sensitive to the schedule builder and find that δ = 0.6 is the best value.
Fig. 1. Impact of the δ parameter on the performance of GAs and GLS
4. COMPUTATIONAL RESULTS The algorithm is coded in C++ language and experiments are carried out on a PC with 2.4 GHz processor and 512 Mb RAM.
4.1 Comparison with existing approaches The first set of instances is composed of 10 × 10 instances proposed in (Singer and Pinedo, 1998), where the classical instances of the makespan were generalized by introducing weights and due dates for jobs. The due date of a job depends on the processing times of its operations and calculated j isP k m using the following formula di = f ∗ j=1 pi,j , where f is a due date tightness factor. Three values of f are considered in the experiment that are 1.3, 1.5 and 1.6. Twenty two instances are tested for each value of f . In order to make an accurate comparison of the GLS algorithm with the large step random walk method (LSRW) in (Kreipl, 2000), the maximum computation time is set to 18 seconds. The LSRW is tested on a Pentium 233 MHz with a maximum run time of 200 seconds. Table 1 gathers the results of the comparison and detailed results can be found in (Essafi and Mati, 2005). For each value of f , we report the percentage %opt of optimal solutions found over 5 (resp. 10) runs of LSRW (resp. GLS). The relative error is (CGLS − Copt )/Copt with Copt the optimal solution and CGLS the objective function given by GLS. Column devm (resp. devb ) shows, for each value of f , the average value of the relative error of the mean (resp. best) value from the optimal solution for the two methods. The column devb for LSRW is empty since the best value is not given in (Kreipl, 2000).
Table 1. Comparison of GLS and LSRW on 10 × 10 instances class %opt 30 64 75
f = 1.3 f = 1.5 f = 1.6
LSRW devm 0,0205 0,0932 0,0300
devb n.g n.g n.g
%opt 65 83 71
GLS devm 0,0127 0,0274 0,0945
devb 0,0002 0 0,0147
Table 2. Comparison of GLS vs ILS class LA01-05 LA06-10 LA11-15 LA16-20 LA21-25 LA26-30 LA31-35 LA36-40
n 10 15 20 10 15 20 30 15
m 5 5 5 10 10 10 10 15
f = 1.3 devm 0,003 0,032 0,042 0,024 0,081 0,078 0,120 0,146
devb 0 0,016 0,029 0 0,069 0,058 0,103 0,104
In terms of devm , GLS outperforms LSRW on instances with f = 1.3 and f = 1.5 while it is outperformed on instances with f = 1.6. Among the 44 instances with f = 1.3 and f = 1.5, the GLS finds always the optimal solution for 43 instances after ten replications of the algorithm. Regarding the measure of performance %opt, there is a clear advantage to GLS which is able to find the optimal solution for 73% of cases while LSRW succeeds in 56% of cases. In the allowed computation time (i.e. 18 seconds) the GLS performs a relatively small number of generations thus genetic operators are not able to stabilize GLS. Further tests with a stopping criterion set to a maximum of 100 generations confirm that the GLS finds the optimal solution in all the ten replications.
4.2 New generated instances with medium sizes A new set of instances composed of 40 instances is generated from the instances of (Lawrence, 1984) used for the makespan criterion. The weights and due dates are generated using the same approach described in (Singer and Pinedo, 1998). Similarly, three values of the factor tightness f ∈ {1.3, 1.5, 1.6} are considered. Notice that instances LA16−20 are already investigated in the first set of experiments. Our GLS is run for 100 generations and detailed results can be found in (Essafi and Mati, 2005). For the 10 × 10 instances LA16 − 20 the optimal solutions are found in all the ten independent replications. This was not the case in Table 1 when the time limit is set to 18 seconds. The findings imply that our genetic algorithms is more stable and converge toward better solutions as the number of generations increases.
4.3 Role of the genetic operators A direct comparison between the GLS and its ILS core is presented. The local search operator
f = 1.5 devm 0,001 0,030 0,042 0,084 0,157 0,105 0,140 0,695
devb 0 0,007 0,025 0 0,067 0,111 0,117 0,238
f = 1.6 devm 0,004 0,029 0,037 0 0,218 0,124 0,144 0,069
devb 0 0,010 0,026 0 0,125 0,134 0,118 0,048
corresponds nearly to 98% of the computational time of GLS, so it is important to find out whether coupling a GA with ILS performs better than an ILS algorithm alone. We set the number of generations of GLS equal to 100 and a maximum number of iterations of 100 000 for ILS. Table 2 presents the average relative error of the solutions of ILS compared to GLS, and this for the mean (devm ) and best (devb ) values. The relative error for each instance is calculated as (CILS − CGLS )/CGLS , where CILS is the objective function obtained by ILS. From Table 2, we can see that the efficiency of the two methods is comparable for small size instances, but as the size of instances increases the GLS algorithm finds better quality solutions than the ILS procedure. We noticed that after a certain number of iterations the ILS does not improve the solutions anymore. On the contrary, in GLS we observed that even after a large number of generations without improvement, the best solution can be improved. These findings confirm the efficiency of our genetic local search algorithm and highlight the merit of combining genetic algorithms with an iterative local search.
5. CONCLUSION Genetic algorithms are combined with an iterated local search for solving efficiently the job-shop problem to minimize the total weighted tardiness. One of the most important findings is that the use of an iterative local search considerably enhances the quality of genetic algorithms, and diminishes the role of the schedule builder. Experiments carried out on instances of the literature show the efficiency of the proposed algorithm over the Large Step Random Walk Method which appeared to be the most effective method for this problem. New instances with medium-size are introduced as a
starting point for further research on this problem. The algorithm proposed in this paper can easily be re-exploited for optimizing regular criteria in job-shop environments. The stability of the GLS is ensured with a sufficient number of generations. Several perspectives can be considered to improve our algorithm by forcing the diversification of the population. We propose to compute a measure of distance between the individuals obtained by the local search operator in order to discard too similar individuals. A possible way is to use the idea of path relinking by comparing two solutions on the number of arcs that are different in the disjunctive graph representation. Another point not investigated in this paper is the crossover operator. In order to generate solutions with high diversity, it could be interesting to generate new off-springs by using the distance according to critical arcs. Finally, we intend to use a probability for applying the local search and select the individuals to be improved by the local search operator. This can be done by using a distribution on the fitness of solutions. Another way is to decompose the population into groups each one containing solutions with similar characteristics and then to select a solution for each group. Exploiting these ways of diversification makes possible to consider a small size of population with diverse individuals, GLS could then perform more generations in a small amount of time, thus covering a larger search space and achieving stability.
REFERENCES Cheng, R., M. Gen and Y. Tsujimura (1996). A tutorial survey of job-shop scheduling problems using genetic algorithms–i. representation. Computers & Industrial Engineering 30, 983–997. Essafi, I. and Y. Mati (2005). A genetic local search algorithm for minimizing the total weighted tardiness in a job-shop. Working paper n 05/7/AUTO Ecole des Mines de Nantes. Giffler, B. and G. Thompson (1960). Algorithms for solving production scheduling problems. Operations Research 8, 487–503. Goncalves, J.F., J.J.M. Mendes and M.G.C. Resende (2005). A hybrid genetic algorithm for the job shop scheduling problem. European Journal of Operational Research 167, 77–95. Graham, R.L., E.L. Lawler, J.K. Lenstra and A.H.G Rinnooy Kan (1979). Optimization and approximation in deterministic scheduling: A survey. Annals Discrete Mathematics 5, 287–326. Jain, A. S. and S. Meeran (1999). Deterministic job-shop scheduling: Past, present and future.
European Journal of Operational Research 113, 390–434. Kreipl, S. (2000). A large step random walk for minimizing total weighted tardiness in a job shop. Journal of Scheduling 3, 125 – 138. Laarhoven, P. J. M. Van, E. H. L. Aarts and J. K. Lenstra (1992). Job shop scheduling by simulated annealing. Operations Research 40, 113–125. Lawrence, S. (1984). Supplement to resource constrained project scheduling: An experimental investigation of heuristic scheduling techniques. Technical report, CarnegieMellon University, Pittsburgh. Lourenco, H.R. (1995). Job-shop scheduling: Computational study of local search and large-step optimization methods. European Journal of Operational Research 83, 347–364. Mati, Y., S. Dauz`ere-P´er`es and C. Lahlou (2005). A general approach for optimizing regular criteria in the job shop scheduling problem. Working paper Ecole des Mines de Nantes. Mattfeld, D.C. and C. Bierwirth (2004). An efficient genetic algorithm for job shop scheduling with tardiness objectives. European Journal of Operational Research 155, 616–630. Nowicki, E. and C. Smutnicki (1996). A fast taboo search algorithm for the job shop problem. Management Science 42, 797–813. Pinedo, M. and M. Singer (1999). A shifting bottleneck heuristic for minimizing the total weighted tardiness in a job shop. Naval Research Logistics 46, 1–17. Roy, M. and M. Sussmann (1969). Les probl`emes d’ordonnancement avec contraintes disjonctives. SEMA Notes DS, Paris. Singer, M. (2001). Decomposition methods for large job shops. Computers and Operations Research 28, 193–207. Singer, M. and M. Pinedo (1998). A computational study of branch and bound techniques for minimizing the total weighted tardiness in job shops. IIE Transactions 30, 109–118. Storer, R.H., D.S. Wu and R. Vaccari (1992). New search spaces for sequencing problems with application to job shop scheduling. Management Science 38, 1495–1509. Taillard, E. D. (1994). Parallel taboo search techniques for the job shop scheduling problem. ORSA Journal on Computing 6, 108–117. Vepsalainen, A.P.J. and T. E. Morton (1985). Priority rules for job shops with weighted tardiness costs. Management Science 33, 585–596. Volta, R., G. Della Croce and F. Tadei (1995). A genetic algorithm for the job shop scheduling problem. Computers & Operations Research 22, 15–24.