A Temporal Reasoning Expert System for Job Shop Scheduling

A Temporal Reasoning Expert System for Job Shop Scheduling

Copyright 0 lFAC Artificial Intelligence in Real-Time Control, Kuala Lumpur, Malaysia, 1997 A TEMPORAL REASONING EXPERT SYSTEM FOR JOB SHOP SCHEDULI...

1MB Sizes 0 Downloads 54 Views

Copyright 0 lFAC Artificial Intelligence in Real-Time Control, Kuala Lumpur, Malaysia, 1997

A TEMPORAL REASONING EXPERT SYSTEM

FOR JOB SHOP SCHEDULING Mohamed Khalil and L. Shanker Faculty ofElectrical Engineering Universiti Teknologi Malaysia Locked Bag 791, Skudai 80990 Johor Bahru, MALA YSIA [email protected]. utm. my

Abstract fields of OR and AI have been developed to obtain near-optimal solutions, the more recent of which, include simulated annealing, genetic algorithms, fuzzy and neural networks [6,7,8,9]. Results with these techniques have been promising, but the computational effort involved is still unacceptable, especially in large-size problems. In these cases, to compute in reasonable time, constructive algorithms employing heuristics, rather than implicit enumeration, has to be devised. In this paper, we present a temporal reasoning approach to solve the job shop scheduling problem. The constructive technique is based on Beikzadeh's work on duration reasoning [2] and Allen's temporal interval based relations framework [3]. However, we do not intend to provide a rigorous mathemical treatment nor discuss the formal aspects of the algorithm, but rather to present the basic ideas behind this new AI approach and discuss temporal reasoning's potential to solve problem at hand. Therefore, our contribution is structured as follows. Section 2 formulates the job shop scheduling problem. Section 3 explains the temporal modelling scheme applied in the algorithm. We then discuss how temporal modelling and reasoning is applied to the problem at hand to generate feasible schedules, in Section 4. These temporal paradigms are then implemented in a sample system developed in a frame-based expert system discussed in Section 5. Finally, section 6 presents some promising preliminary results, future work and conclusions.

The most obvious application of temporal reasoning to intelligent systems is in the development of scheduling and planning systems. In scheduling, a fundamental problem is job shop scheduling, a problem in which the optimization of its solution is classified as NP-complete. Active research is continuously being conducted on this problem, especially for cases when the size of the problem is large. This paper introduces an Al technique based on a temporal reasoning model for solving large job shop scheduling problems. The method, which is essentially an application of duration reasoning in a temporal relations framework, has been successfully developed into a workable frame-based expert system, implemented using the Windows-based Kappa PC hybrid development tool. The system is tested on a rather complex 13/21/G/Cmax problem, and a feasible but acceptable schedule is generated in a very reasonable computation time. Preliminary results are presented to show the viability and potential of this method in real-time control of manufacturing processes. Copyright © 1998 IFAC

1 Introduction Temporal-based reasoning is inferencing about time using temporal models that represent time relations between operations or processes. This reasoning paradigm is increasingly applied in domains like planning, scheduling and timetabling where the temporal event is the modelling primitive [2,3,4,5]. Scheduling is a kind of combinatorial optimization problem, and it is wellknown that it is among the hardest optimization task to solve. From computational complexity theory, most scheduling problems are known to be NP-hard [1]. No optimal solution exists that can solve this problem in polynomial time. Many methods in the

2 The Job Shop Scheduling Problem Job shop scheduling is a resource allocation problem subject to allocation and sequencing constraints. The resources are called machines and

215

the ~asic tasks are called jobs. Each job may consIst of subtasks referred to as operations which are interrelated by precedence relations. To specify a job shop problem, we define a set J of n jobs, a set M of m machines and a set of k operations. For each member of set 0, p } 0, there is a job, j p3 J, to which it belongs to, and one machine, mp} M, which it is proc~ssed ~y, for a processing time, lp at startmg p~mt, Sp. The processing sequence of the operations m a particular job is given by

A representation of this basic temporal relationships would then permit the construction of a temporal relations network (TRN). The second problem then is the transitive closure problem which is, how to propagate the constraints imposed by the events and their temporal relations (TR) throughout the network. An algorithm which operates on the transitivity rules and a complete knowledge network of events and their relations can then be constructed for a temporal reasoning system to operate on. AlIen in [3] defines that temporal events are time intervals on the same time line. Thirteen temporal relations (TRs) then exist between two time intervals X and Y. These thirteen temporal relations, as defined in Table I, are atomic entities, since they are not divisible into any simpler relation. However, we can create a relation between two time intervals to be a disjunction of these atomic relations. For example, a temporal relation between the intervals X and Y, represented by a relation set, denoted by {<,m,>}, is the disjunction of: (X before Y) v (X meet Y) v (X after Y) A time interval or temporal event X is characterized by its endpoints: the starting point SPx and the ending point EPx. Clearly, its duration is of length Lx = EPx - SPX. A temporal relation (TR) describes the relationship between two time intervals. We can also view this relation by all the possible relationships between the endpoints of the two time intervals. The relationship between SPs and EPs of each pair of intervals X and Y can be defined by using four parameters, ISSxy, ISExy, IESxy and IEExy, given below.

°

the temporal ordering operator, ~ , defmed by, if x~y (x,y} 0) then jy=jx and Sy - Sx 2! t x'

The objective is to find a feasible schedule in which the sequence of jobs for each machine is determined such that a given objective function or performance metric is optimized. For example, we can choose to minimize the schedule length or makespan, , i.e. the time at which the last job is completed on machine m. To describe a specific job shop problem the conventional notation is n/mlAIB where 'n' is the number of jobs, 'm' is the number of machines, 'A' describes the flow pattern (e.g. F stands for flow shop and G stands for general flow shop) and 'B' describes the performance metric. This paper focusses on the nlm/GI Cmax problem. In the method that follows, 'several standard assumptions are observed. These include: a) All job shop problems are deterministic, b) Operations cannot be interrupted and each machine can handle only one job at one time, c) There are no precedence constraints among operations of different jobs, d) In a problem there is only one machine of each type. Also in our model, setup, load and unload times, and transportation of jobs between resources are not included, assuming that they are either small with respect to the operation duration or they have a constant duration, in which case, they are incorporated into the operation duration.

i) Distance betw. the Start point of X Start point ofY: ISSxy = SPx - SPy. ii) Distance betw. the Start point of X End point ofY: ISExy = SPx - EPy. iii) Distance betw. the End point of X Start point ofY: IESxy = EPx - SPy. iv) Distance betw. the End point of X End point ofY: IEExy = EPx - EPy.

and the and the and the and the

AlIen's thirteen TRs can now be more conveniently represented in terms of these relation parameters. Table I shows this Alien's representation with three of AlIen's TRs that is relevant here. Intervals X and Y are used as examples, where x, y are the starting points, and x', y' are the ending points for the respective intervals. Notice that the last four columns in Table I represent the values of the relations parameters with respect to O.

3 Temporal Modelling From a certain perspective, the scheduling task can be viewed as a special case of reasoning about time. When considering the task of reasoning about time, the first problem that arise is how to represent temporal information. Basically, a knowledge base of events and their interrelationships need to be developed.

216

TRs before after during

defintion «) = {«x,x'),(y,y'»: x < x' y'< x'} (d) = {«x,x'),(y,y'» : y < x < x' < y'}

ISS < > >

lEE < > <

ISE < > <

IES < > >

Table I: Alien's Temporal Relations represented with Relations Parameters

TRs before (b) after (a) not during (n)

definition = {«x,x'),(y,y'» : x < x' S Y
ISS < >

lEE < >

ISE < ~
IES S > >orS

Table 2: Temporal Relations, b,a and n Definitions For example, ISS is < means that ISS = Y - x < o. These relations parameters (ISS, lEE, lSE, lES) are not interval length dependent and therefore the interval lengths are not represented . To extend the temporal relation framework to a network of time intervals, a graphical diagram caned the interval temporal relationship network (ITRN) is used. This ITRN is similar to the network diagram used in CPM or critical path method. However, for the ITRN, the nodes represent activities or operation in tenns of intervals and the links or arrows between nodes represent TRs. In an ITRN, each node must have a TR with every other node in the network. An example of an ITRN used in conjuction with a job shop scheduling problem is shown in Figure 2.

the case where jx*jz but mx=m z . In the example where jx*jz but mx*m z, x TR z is immaterial, i.e. there are no temporal constraints between x and z. These three TRs are defined and further signatured by the relation parameter set {ISS, lEE, lSE, IES} as shown in Table 2. As explained in section 3, an ITRN is used to graphically represent a network of time intervals. Here, an ITRN is used to map the entire network of time intervals for a job shop scheduling problem. Figure 2 shows an ITRN which represents a sample problem described below. (The start and end nodes are dummy nodes which represent start time (default is 0) and end time (i.e. Cmax ) of the entire schedule.) Sample Problem: Jobl : x~y~z, Job2 : p~q, where (Jobl,Job2) 3J, (x,y,z,p,q) 3 0, rnx=mp

4 Temporal Reasoning in Job Shop Scheduling In this section, we describe how the job shop scheduling problem is modelled into the temporal reasoning framework, from which an algorithm can be fonnulated to solve the problem. In this model, the temporal events is used to represent the members of the operation set 0, that is, each operation of the problem is a time interval with an SP, EP and L. The notation Pab, p30 is used to define an operation of job a, aJ , using machine b, b3

_ _ lRlII'1B. _ _ 1IlIIRlUl • • • • • lRJIOrJUINJ

M. Figure2: ITRN for sample problem The temporal representation of the job shop problem has now been explained. The next step is to explain how reasoning is applied to this model for the generation of a feasible schedule. Essentially, the objective of the reasoning process is to detennine the start and end points of all the operations in set without violating the temporal relations between them.

The precedence constraints between operations are modelled as TRs. It turns out that, for the job shop scheduling problem, only three TRs (which are disjunctions of Alien's atomic TRs) are needed. The three TRs are: before (b) {<,m}, after (a) {>,mi}, not during(n) {<,m,>,mi} . For example, consider x,y,z 3 0. In the case where x~y, we have the TRs: x before y, and y after x. The TR, x not during z would be

°

217

heuristics include, among others, Shortest Processing Time (SPT), Least Total Work (L TWK) and Most Operations Remaining (MOPNR). However, it has been shown that, SPT is the most suitable in the case if the objective function to be optimized is the total sch.edule length, C max [1]. If the conflicting operations have equal interval lengths, then the operation in the job with the smallest total processing time (L TWK) is chosen. Note that for the operation that has to be shifted, all the operations that it precedes in the same job will have to be shifted as well. This updating creates new partial schedules in which new conflicts arise between operations from different jobs. Therefore, the second pass is run recursively until a final schedule with all conflicts resolved is found . The SP values derived are then used to construct a Gantt Chart.

Figure 3: The Temporal Reasoning Process The reasoning process is illustrated in Figure 3. The algorithm is basically a constraint propagation mechanism based on the notion of task conflicts. A conflict is a pair of operations competing for the use of the same resource . Initially, in the problem defintion step, the hard constraints, which include precedence relations, resource availability and operations data, are provided, from which the representing ITRN is built. In first pass, a schedule is generated for the hypothetical case of unlimited resources. Clearly, no task confllicts arise in building this basic schedule. This basic schedule serves only as the initial schedule from which, an iterative procedure (in second pass) checks on each pair of operations, in turn, for task conflict, and if it exists, enforces the necessary temporal relations requirements (precedence and propagation rules) to update the time limits of the temporal windows associated with each operation. Partial schedules are thus iteratively generated, and the process terminates when no more conflict exists, that is when the final schedule is found. The first pass module of the algorithm, in producing the basic schedule, uses only the TR, after, to derive the SP and EP values of all the operations. Since the not during TR was not considered,certain pai~ of operations are scheduled the same machine at the same time. This conflict is detected in the second pass by checking the values of the relations parameter set {ISS, IES, lSE, lEE} of a pair of operations. If the values are other that of the after or before TRs, then there is a conflict.. A decision has to be made on which of the two competing operations temporal window is to be shifted or propagated to the end of the other. To resolve this conflict, dispatching or priority rules are applied. These priority rules, which are used as

5 Frame Based Implementation A working program of the temporal reasoning based scheduler is implemented in a frame based expert system environment. A frame based system was chosen because the problem domain of job shop scheduling needs a natural way of representing objects and inter-frame relations which a frame based system can provide. Furthermore, encapsulation of structural and behavioral aspects of frame in a single data construct simplifies coding. It also facilitates knowledge exchanges between associated frames through inheritance, functions and message passing constructs. A development shell called Kappa-PC is used to develop the solution. Kappa-PC is a windows based tool which provides many features which includes a frame editor, a function editor, a rule editor, and a user interface development toolkit [11]. Figure 4 shows the frames/objects used and their hierarchical relationships. The operation frame, is the key frame for the whole solution. It consists of slots: [ operation name, job number, process number, machine used, interval length L, start point SP, TR_before, TR_not during It can be seen that the operation frame holds the problem specifications as well as temporal

218

propose to develop a selection criteria to choose among the current set of conflicts, which exist in each iterative cycle, those which are interesting to solve first. Further tests on benchmark problems will be conducted in order to prove the true worthiness of the method. However, the preliminary results obtained here clearly indicate the potential of temporal reasoning in providing a fast, simple and flexible solution to the complex scheduling problem, and its viability in solving real-time control problems In the manufacturing environment.

infonnation. Other frames like tr_during_chk do not represent any objects of the problem but are used to store control parameters in a program run.

6 Results And Conclusion The temporal reasoning based scheduling system described above has been tested on a 1312l1G/C max job shop scheduling problem experienced in an actual furniture manufacturing factory . The problem specification is outlined as follows: Syntax Job i : (Machine). proc time in hours) Job I : (M I ,0.5), (M8,0 7),(M 11,0 2) Job 2 : (M2,0 4),(M4,3 .3),(0.3),(0.3),(0.7) Job 3: (M5,0.7),(MII ,0 4) Job 4: (MI,0.4),(M9, 1 0),(MI2,0.4) Job 5: (MI ,0.5) Job6:(M I ,0.4),(M5,0. 7),(M8, 1.6),(M 11 ,0.5), (M13 ,0.9),(MI7,3 .1) Job 7: (M7,0.7),(MI4,0.4) Job8:(M I ,0.4 ),(MS,O.7),(M 11 ,0.2),(M IS,2.S) Job9:(M2, I .7),(MS, 1.2),(M 13, 1.2),(M 15, 1.3) (MI6,0.7),(MI7,1 .2),(MIS,0.7), (M 19,I.3),(M20,5.2) Jobl O:(MII ,O 2),(MI2,0.4),(M 13, 1.0), (MI4,10),(M20,5.0) Job 11 :(M2,2.2),(M3,0.7),(M 11 ,0.1), (M I 4,0.9),(M I 5,0.4),(MI6,2. I ), (MI7, 1.5)(MI9,0.1),(M20,2.6), (M21 , I.S) Job 12:(M I ,0.1),(M3, I.S),(M4,3.4),(M7 ,O.S), (M 14,0.5),(MI9,0.4) Job 13: MI ,0.5),(MI0,2.1)

References [1] French, Simon "Sequencing and Scheduling: An introduction to the Mathematics of the Job-Shop", John Wiley & Sons, USA, 1982. [2] Beikzadeh, M.R. "Automatic High-Level Synthesis Based Upon Artificial Intelligence Techniques", University of Essex, U.K., 1992. [3] JAllen, "Maintaining Knowledge about Temporal Intervals." CACM, Vo1.26, No. ll, Nov.1983, pp.832-843 . [4] Saksena, Manas c., Agrawala, Ashok K., " Temporal Analysis For Hard Real-Time Scheduling" IEEE, 1993, pp 538-544. [5] Van Beek, Peter, Manchak, Dennis W., "The Design and Experimental Analysis of Algorithms for Temporal Reasoning" Journal of Artificial Intelligence Research ,AI Access Foundation, Canada, 1996. [6] Soma, Hiroshi, Hori, Masaki, Sogou,Taiji, "Schedule Optimization Using Fuzzy Inference", IEEE, 1995, pp 1171-1176. [7] Mitra, e.t., "A Possibilistic Contstraint Problem: Fuzzy Temporal Reasoning", IEEE, 1994,pp1434 -1439. [8] Reeves, Colin R., "A Genetic Algortihm For Flowshop Problem", Comp.Ops Res., Vol. 22, No.l, Elsevier Science Ltd., 1995, pp.5-13. [9] Y.P.S.Foo and Y.Takefuji, " A Stochastic Neural Network Approach to Solving Job-shop Scheduling", submitted to IEEE Trans. on Systems, Man, and Cybernetics. [10] Sofian Ibrahim, and M. Khalil, "Kajian Kemungkinan Applikasi Otomasi di Kilang Perabot", Universiti Teknologi Malaysia, 1994. [11] Durkin, J., "Expert Systems Design and Development", MacMillan Publ. Co., U.S.A, 1994.

The precedence constraints is clearly defined, e.g., the line Job 3: (M5,0. 7).(MI 1,0.4) above reads that, in job 3, the operation processed on Machine 5 with the processing time of 0.7 hour precedes the operation processed on Machine 11 with the processing time of 0.4 hour. Clearly this is a large-sized problem. The number of operations totalled 58. Running on a Windows based 33MHz 486 PC, the scheduler produced a feasible schedule in a computation time of 36 seconds, and a Cmax value of 22 hours is obtained. The resulting schedule is shown in Figure 5. This compares favourably to the result of a manual solution which obtained a value of Cmax of 20 hours, but took almost 4 hours to complete. It must be noted that our work here is still preliminary in that we have only provided a solution that develops a feasible schedule which is practical but not optimal. We propose to improve on the optimization aspect by several ways. Further study will be conducted to detennine which heuristic best to use in conflict resolution at a particular stage. User interaction will be considered. Also, we

219

rROOT \

KAPPA-PC OBJECTS SCHED SCHEDULE SCHED-TEMP OPERATION 0 SCHED=OPERATIONS . SCHED_MACHINES ~ OPERATION k SCHED _ TR_DURING_CHECK

/ " - - - SCHED_ROOT \

*

~

OBJECT DESCRIPTION ROOT KAPPA PC OBJECTS SCHEDULE TEMP

-

Default Kappa-PC root object Kappa-PC created objects (e g buttons. sessions) Object to keep constant values about schedule (e g no of job Object to keep temporary values (e g Current operation being processed) - Object to keep details of an operation (refer to Figure 5) - Object to keep details on machines in the schedule

OPERA TIONS MACHINES

TR_DURING_CHECK - Object to keep details on TR_during check (e glEE. ISE)

Figure 4: Hierarchical frame relationship

MI M2 M3 M4 M5 M6

19

112

I I

I I

I I

~~

....

M7 M8

~I

M9

M 12 M 13 M 14

: :

~

I I I JsIl3III

M 10 M 11

I I I I I I . ' I1 ) I I I I I I I I I I I I I I I

,

1I111

121

i

112

I

i

I.... ... ... 1.1 I )21 I I I I I I

I

I

I

I

III

1-1-~ ,. ,. Ji. .Ji. : ...-1JI I

16

--

III 0 I

~ 12

112

I I I I I I I I

III

110 I I I 1111 III 0 I I~

I I

-12

PIIIfI. I1 I. I I h I

1 19 I

M 19

I I I

I I I

M 20

~o

MI5 MI6 M 17 M 18

J.

i

1111

:

I J9 I I ,.,. 1 19 _ I 11 I 11 _ I I I

M 21

11

I

I

I

I I I

I I

I

19

I1 I III I ~I

Figure 5: Gantt Chart of the Resulting Schedule for the 1312l1G/Cmax problem. (each division equals I hour)

220