Solving Job-Shop Scheduling Problems by Means of Genetic Algorithms

general NP-hard, the only practical approaches are heuristic strategies (16, 25). Hence, one can find the application of almost every artificial intelligence.
218KB taille 3 téléchargements 304 vues
Chapter 8 Solving Job-Shop Scheduling Problems by Means of Genetic Algorithms Ramiro Varela*, Camino R. Vela*, Jorge Puente*, Alberto Gomez** and Ana M. Vidal *Centro de Inteligencia Artificial. **Dpto. de Admon. de Empresas y Contabilidad Universidad de Oviedo. Campus deViesques. E-33271 Gijón. Spain. Tel. +34-8-5182032. FAX +34-8-5182125. e-mail: *{ramiro, camino, puente}@aic.uniovi.es, **[email protected] http:\\www.aic.uniovi.es

8.1 Introduction It is well known that sequencing problems are a subclass of combinatorial problems that arise everywhere. We can find problems of this class in many areas of industry, management and science, ranging from production organization to multiprocessor scheduling. This not only justifies the intensive research carried out in this field over the last several years (5, 6, 13, 16), but also the interest in finding new solutions to specific problems. Because sequencing problems are in general NP-hard, the only practical approaches are heuristic strategies (16, 25). Hence, one can find the application of almost every artificial intelligence technique; for instance, logic programming (12, 27), neural nets (1), machine learning (29), space state heuristic search (2, 11, 22), branch and bound (21), local search (25) and genetic algorithms (GAs) (4, 7, 19, 24, 17), among others. Jain and Meeran (13) summarize the main techniques applied to solve a family of these problems, the job-shop scheduling problem, together with the category each technique belongs to. The application of GAs to scheduling problems has interested many researchers because they seem to offer the ability to cope with the huge search spaces involved in optimising schedules. In this work we describe an approach to solve job-shop scheduling problems by means of a GA which is adapted to the problem in various ways. First, a number of adjustments of the evaluation function are suggested, and then we propose a strategy to generate a number of chromosomes of the initial population that allows us to introduce heuristic knowledge from the problem domain. In order to do that, we exploit the variable and value ordering heuristics proposed by Norman Sadeh (22). These are a class of probability-based heuristics which are, in

© 2001 by Chapman & Hall/CRC

principle, aimed to guide a backtracking search strategy. We validated all the refinements introduced on well-known benchmarks and report experimental results showing that the introduction of the proposed refinements have an accumulative and positive effect on the performance of the GA. The software we have used in our experiments, as well as further releases, will be public through our Web site. The remainder of this chapter is organized as follows. Section 8.2 introduces the job-shop constraint satisfaction problem. Section 8.3 describes the genetic algorithm used in this work, in particular the codification of chromosomes and the genetic operators; and discusses two possibilities to define the fitness function, as well as the refinements proposed to the evaluation function (i.e., the penalty and scaling techniques) and how these techniques can be adapted to the confronted problem. Section 8.4 reviews the variable and value ordering heuristics proposed by Sadeh. Section 8.5 describes the way we propose to generate the initial population from the probabilistic knowledge provided by these heuristics. Section 8.6 reports the experimental results; here, we consider results about the efficiency and convergence of various versions of the GA, and compare the GA performance against other approaches. And finally, in Section 8.7, we present the main conclusions and some ideas for future work.

8.2 The Job-Shop Scheduling Constraint Satisfaction Problem The Job Shop Scheduling Problem (JSS) can be posed with small variations (1, 18, 22). In this work we consider the problem as posed in (22): the JSS requires scheduling a set of jobs {J1,...,Jn} on a set of physical resources or machines {R1,...,Rq}. Each job Ji consists of a set of tasks or operations {ti1,...,timi} to be sequentially scheduled, and each task has a single resource requirement. We assume that every job has a release date and a due date between which all the tasks have to be performed. Each task has a fixed duration duij and a start time stij whose value has to be selected. The domain of possible start times of the tasks is initially constrained by the release and due dates. Therefore, there are two non-unary constraints of the problem: precedence constraints and capacity constraints. Precedence constraints defined by the sequential routings of the tasks within a job translate into linear inequalities of the type: st il + du il ≤ stil+1 (i.e., stil before stil+1). Capacity constraints that restrict the use of each resource to only one task at a time translate into disjunctive constraints of the form: stil + du il ≤ st jk ∨ stjk + du jk ≤ st il (two tasks that use the same resource cannot overlap). The objective is to come up with a feasible solution as fast as possible, a solution being a vector of start times, one for each task, such that starting at these times all the tasks end without exceeding the due date and all the constraints are satisfied. None of the simplifying assumptions are

© 2001 by Chapman & Hall/CRC

required by the approach that will be discussed: jobs usually have different release and due dates, tasks within a job can have different duration, several resource requirements, and several alternatives for each of these requirements. P1

t 11 R1 2 [0,4]

t12 R2 2 [2,6]

C2 P3

t 21 R2 2 C1

[0,4]

[0,4]

P2

t22 R4 2

t13 R3 2 [4,8]

P4

C3

C4 t 23 R3 2 [4,8]

[2,6] t31 R1 3

P5

C5 t 32 R3 3

[3,7]

Figure 8.1 A JSS problem instance with three jobs. The release dates have value 0 for every task and the due dates have value 10. The duration of the tasks is indicated within the boxes, together with the task identification and the resource requirement Figure 8.1 depicts an example with three jobs {J1,J2,J3} and four physical resources {R1,R2,R3,R4}. It is assumed that the tasks of the first two jobs have duration of two time units, whereas the tasks of the third one have duration of three time units. The release time is 0 and the due date is 10. Label Pi represents a precedence constraint and label Cj represents a capacity constraint. Start time values constrained by the release and due dates and the duration time of tasks are represented as intervals. For instance, [0,4] represents all start times between time 0 and time 4, as allowed by the time granularity, namely {0,1,2,3,4}.

8.3 The Genetic Algorithm GAs were successfully used to solve sequencing problems (7, 8, 9, 17, 18, 24), in particular the job-shop scheduling problem. In this section we describe a classic implementation whose components are taken from the literature. The codification of individuals is the permutation with repetition (4, 8, 17, 24). According to this codification, an individual represents a permutation of the whole set of operations of the problem at hand. Consider for example the problem depicted in Figure 8.1 and the permutation of its tasks (t21 t31 t22 t11 t32 t12 t13 t23). From this permutation, an individual is obtained by replacing the identifier of each task by the number of its job; therefore, we obtain (2 3 2 1 3 1 1 2). So, this representation should be understood to mean the following: the first 2 represents the first task of the second job, the first 3 is the first task of the third job, the second 2 is the second task of

© 2001 by Chapman & Hall/CRC

the second job, and so on. The main reason for introducing this representation of individuals is that every individual produced by the genetic operators is feasible, as we will see in the following paragraphs. The mutation operator we use in this work is the order-based mutation: two tasks are selected at random and their positions are interchanged. At the same time, we consider two crossover operators. First, the generalized order crossover (GOX) which works as follows: Consider the following two parents: Parent1 (1 2 2 1 2 1)

Parent2 (1 1 2 2 1 2)

A substring is selected at random from parent1, for example the underlined substring that includes the second 2 and the second 1, and these tasks are deleted in parent2. Afterwards, the substring is implanted in parent2 at the position where the first operation of the substring has occurred in parent2. So, in this case we obtain the offspring (1 2 2 1 1 2). Another common crossover suitable for this codification is the generalized position crossover (GPX) which is similar to GOX. The only difference is the insertion position of the substring in the offspring, this position in GPX is the same as the first parent. In the example, the same result is obtained. In order to define a fitness function, we have to consider which potential solution is represented by an individual. Remember that a solution to our job-shop problem is a scheduling of the tasks that satisfies every constraint of the problem, including, of course, the completion of every job by its due date. In this work, we consider that a potential solution is a scheduling of the tasks satisfying every constraint except, maybe, the completion of jobs by their due dates. So a potential solution is actually a solution when this constraint is also satisfied. In order to display the potential solution represented by an individual, and to establish a rating among individuals, we consider two possibilities to implement the fitness function that in the following we refer to as fitness1 and fitness2, respectively. In both cases, a strategy is defined to build a scheduling from the individual representation, then the completion time of every job is calculated, and the maximum value of these times, that is the makespan, is the fitness value of the individual. It is clear that the lower the fitness, the better the individual. Therefore, we have a minimization problem. Now we describe the scheduling strategies of both fitness functions. In both of the cases, the sequence of tasks is enumerated following the order in which the tasks appear in the individual. For each task, a start time is assigned which is compatible with the start time assignments made to the previous tasks. In the first case, this start time is calculated as the largest completion time of those previous tasks sharing a constraint, either precedence or capacity, with the current task. In

© 2001 by Chapman & Hall/CRC

the second case, the start time assigned to the current task is the lowest possible that is compatible to the previous assignments. We clarify both strategies by means of an example. Consider the individual (3 3 1 1 1 2 2 2), which represents a potential solution to the problem of Figure 8.1. Figure 8.2a shows the Gantt chart produced by the fitness1 scheduling strategy, and Figure 8.2b shows the correspondent chart produced by the fitness2. The fitness1 value is 13, whereas the fitness2 value is 11 for the individual. As we can observe, the individual does not represent a solution to either of the strategies. 0 1 2 3 4 5 6 7 8 9 10 11 12 R1 t31

t11

R2 R3

R1 t31 t12

t32

0 1 2 3 4 5 6 7 8 9 10

t21

R2 t21

t13

R4 a)

t11

t23 t22

R3 R4

t12 t32

t13

t23

t22

b)

Figure 8.2 (a) Scheduling produced by the fitness1 strategy to the problem of Figure 8.1 from the individual (3 3 1 1 1 2 2 2). The fitness1 value is 13. (b) Scheduling produced from the same individual by the fitness2 strategy. The fitness2 value is 11 It is clear that the fitness1 value is always greater than or equal to the fitness2 value, but the fitness2 function is more costly than the fitness1 function. It is easy to see that the first one has a complexity of O(n) whereas the second has a complexity of O(n2), n being the number of tasks of the problem. Moreover, as we will see in Section 8.6, for every scheduling that can eventually be produced by the fitness2 function, there is an individual that produces the same scheduling by the fitness1 strategy. Therefore, in principle, we adopt fitness1 due to its lower complexity. Nevertheless, in this work we also use the fitness2 in a number of experiments. Moreover, we use this second scheduling strategy as a basis for a heuristic repair method to obtain an improved chromosome as we will see in Section 8.5.

8.4 Fitness Refinement The former fitness functions can be adjusted in order to better discriminate among good and bad individuals. Here we consider two common techniques (18) and adapt them to our problem

© 2001 by Chapman & Hall/CRC

Penalty: this technique consists of adding to the fitness a value for each of the jobs exceeding its due date. This amount can be, for example, the exceeding time of each job or a fixed amount for each of the exceeding jobs. This refinement allows the GA to discriminate among individuals displaying the same makespan, but having different exceeding time beyond their due dates. But the results can be misleading due to the fact that the lowest fitness does not guarantee the lowest makespan. Scaling: in this case, the objective is either to remark or smooth the difference between good and bad chromosomes in order to obtain a more accurate discrimination. The underlying idea is that small relative differences in the fitness of good and bad individuals do not facilitate the selection of the best individuals and the elimination of the worst. Whereas, large relative differences might produce a dominance of semi-optimum chromosomes and then a premature convergence of the GA. Here, we consider a linear scaling which consists of replacing the original fitness f by (1) f′ = f + b, b being a parameter which can be provided by the user or automatically determined from the problem either at the beginning or at each generation. 8.4.1 Variable and Value Ordering Heuristics As we have pointed out in the introduction, one of the main contributions of this work will be the utilization of heuristic information in the initial population generation to solve JSS problems. Our purpose is to incorporate the variable and value ordering heuristics proposed by Sadeh and Fox in (22). These heuristics are based on a probabilistic model of the search space. A framework is introduced that accounts for the chance that a given value will be assigned to a variable and the chances that values assigned to different variables conflict with each other. These heuristics are evaluated from the profile demands of the tasks for the resources. In particular the individual demand and the aggregate demand values are considered. The individual demand Dij(Rp,T) of a task tij for a resource Rp at time T is simply computed by adding the probabilities σ ij(τ) of the resource Rp demanded by the task t ij at some time within the interval [T–duij+1,T]. The individual demand is an estimation of the reliance of a task on the availability of a resource. Consider, for example, the initial search state of the problem depicted in Figure 8.1. As the task t12 has five possible start times or reservations, and assuming that there is no reason to believe that one reservation is more likely to be selected than another, each reservation is assigned an equal probability to be selected, in this case 1/5. Given that the task t12 has duration of 2 time units, this

© 2001 by Chapman & Hall/CRC

task will demand to the resource R2 at interval 4≤t