Supporting Scheduling with Temporal Logic - Semantic Scholar

4 downloads 0 Views 371KB Size Report
I like to acknowledge the helpful discussion with the members of the “DÉJÀ VU” project and the reviews of this paper by Gabi Thalhammer and Roger Kerr.
Supporting Scheduling with Temporal Logic Jürgen Dorn Christian Doppler Laboratory for Expert Systems Vienna University of Technology email: [email protected] Abstract In this paper interval logic (Allen 1983) with some extensions is proposed for knowledge-based scheduling of production processes. The logic is embedded in a three-layered architecture consisting of the knowledge representation of the production process, the constraint checking and propagation mechanism, and a heuristic algorithm that determines which jobs are scheduled when. The representation of the production process, i.e. the required resources and their allocations by operations is object-based and facilitates so the structuring of the knowledge base. Furthermore, this object structure improves temporal reasoning since the propagation of temporal constraints can be localized partly to these objects. The explicit knowledge representation and the object-oriented structure of the whole software design promise an easier reuse of software artifacts.

1. Introduction Scheduling is the task of allocating jobs or operations to resources. In most applications the number of available resources is restricted and usually one resource can process only one operation at a time. If several resources are regarded in a scheduling application, the problem of finding a feasible schedule, i.e. a feasible allocation of all operations to resources under temporal constraints, is a really hard task. Even for most simplistic models the deterministic algorithms for solving the scheduling problem are NP-hard (Garey and Johnson 1979). Consequently, approximate algorithms are looked for. Often heuristics are applied in knowledge-based scheduling to direct the search for a solution1. In the scheduling literature we find many heuristics, e.g., schedule first jobs with the earliest due date (EDD) or jobs that take the shortest processing time (SPT). These strategies that focus on the jobs to be scheduled are called sometimes job-centered. In contrast, resource-centered strategies look for jobs that would fit on a certain resource. In dispatching systems one looks for a job that could be processed on the next available resource or machine. The recognition of bottleneck resources (Adams et al. 1988), (Biefeld and Cooper 1991), (Sadeh 1991), and (Berry 1992) fits also in this framework. A bottleneck resource is typically a resource that is required by many operations. Obviously, combinations of both kinds of strategy may also be meaningful. As described before, heuristics are applied to direct search. However, they are not sufficient to solve the scheduling problem, because there are usually so many constraints that must be considered. The heuristic should be used only for the most constrained features of 1

Of course, it is not true that only in knowledge-based scheduling heuristics are used. However, in knowledge-based systems the explicit reasoning with heuristics is stressed and it is easier to implement domain specific heuristics.

-1-

the scheduling problem. A promising technique to support these heuristics seems to be constraint satisfaction (Prosser 1993). In contrast to mathematical models from Operations Research (e.g. mixed integer programming), this seems to make the formulation of the scheduling problem easier. However, the main advantage to me is the possibility of extending the constraint model. One can easily introduce new objects and constraints for a certain application. An integer model can be an elegant mathematical description of a class of scheduling problems. However, to extend this model with new kinds of objects, constraints, or optimization criteria it will be necessary to define a new model. Furthermore, usually there is no way to easily modify the strategy used to solve such an integer problem. There are several ways to combine heuristics with a constraint-based algorithm. Sadeh (1991) presents a simple algorithm to combine heuristics and constraints. The algorithm selects an operation, a resource, and a time when the operation should be performed by applying heuristics. Then the consistency algorithm checks this allocation. If an inconsistency is found, backtracking is applied. I sketch such a solution in the following PROLOG-algorithm: schedule(ListOfOperations, Schedule) :select_operation(ListOfOperations, Operation, NewListOfOperations); select_resource(Operation, Resource); allocate(Operation, Resource, Schedule, NewSchedule); check_constraints(NewSchedule); schedule(NewListOfOperations, NewSchedule).

Algorithm 1: Simple Scheduling Algorithm A different class of scheduling algorithm based on constraints are repair-based strategies. In a repair-based strategy a first schedule is generated with simple linear effort and then one tries to repair it iteratively. An evaluation function is necessary to check whether single repair steps have improved the schedule. Minton and his colleagues (Minton et al. 1990) use the number of conflicting constraints as evaluation function. We have developed a more detailed evaluation function based on fuzzy sets (Dorn and Slany 1993). In our model a constraint is satisfied with a certain grade and furthermore, different constraints have weights associated. A simplified version of such an algorithm is sketched as follow: iterativeRepair(Schedule, Eval, Iteration) :Eval / Iteration < threshold. iterativeRepair(Schedule, Eval1, Iteration) :find_constraint_violation(Schedule, Job), exchange(Schedule, Job, AnyJob, NewSchedule), evaluate(Schedule, Eval2), Eval2 < Eval1, NewIteration is Iteration + 1, iterativeRepair(NewSchedule, Eval2, NewIteration).

Algorithm 2: Simple Iterative Repair Algorithm We assume that a smaller evaluation value is better than a larger and to have a termination criteria we introduce a threshold. We stop the iterative repair as soon as the ratio between the achieved value and the number of iterations reaches this threshold. Unfortunately, such a repair-based strategy has some affects on the constraint consistency mechanism, since chronological backtracking is insufficient in this case and a kind of nonmonotonic temporal reasoning is necessary.

-2-

2. Temporal Reasoning in Scheduling Many authors stress the importance of temporal reasoning for scheduling (Tate 1977), (Vere 1983), (Rit 1986), (Le Pape and Smith 1987), (Burke and Prosser 1991), and (Canzi and Guida 1993). Temporal reasoning is used to synchronize operations, to make allocations for resources, to determine sequences of operations, and to evaluate mean tardiness or earliness of a schedule. Furthermore, time is used to represent the schedule. 2.1. Existing Temporal Models In many scheduling problems time is modeled by quantitative values and constraints. Start and finishing time of scheduled operations are represented by integers or reals. Furthermore, precedence constraints between these time points are posted that constrain for example, that the finishing time of one operation must be less than the start time of another operation. More or less, the same mathematical calculus is used as in Operations Research enabling local consistency. A critical path or the total makespan can be enforced for a given set of operations and sequence relations between these operations. Often constraint formulation, satisfaction, and propagation are introduced as formal models to perform the required processing of time. Usually, constraints on one or two objects are formulated. The idea of constraint propagation is to reduce the possible values of object domains by preprocessing techniques as for example transitive closure. In temporal reasoning two approaches exist: to model time points by such object domains or relations between time objects. In the second case, the number of possible relations is reduced during propagation. Dean and McDermott (1987) and Vilain et al. (1990) have developed constraint-based models that work on relations between time points and achieve global consistency, i.e. n-consistency. The n-consistency can be achieved in polynomial time if the allowed relations are chosen carefully (Vilain et al. 1990). However, these models have the disadvantage that only convex interval relations may be processed (Nökel 1989). Non-convex relations cannot be expressed in this logic. For example, we cannot use the constraint that one job cannot be processed on two machines in overlapping intervals. A different temporal model was proposed by (Allen 1983). He constrains intervals by other intervals. For example, we can constrain an operation to be performed in the day shift without knowing when the day shift will start. Allen has given an algorithm to check the consistency of a graph of intervals connected by temporal relations. This algorithm also deduces new relations through transitive conclusions. In the following discussion I use the notation of Allen consisting of 13 symbols to represent all possible relations between intervals: “=, , m, mi, o, oi, d, di, s, si, f, fi”. These relations are mutual exclusive. With disjunctive relations we can express uncertainty about the actual relation. Thus, I1 {