Interactive scheduling as a constraint satisfiability problemgolumbic/papers/J27.pdf · INTERACTIVE...

25
Annals of Mathematics and Artificial Intelligence, 1 (1990) 49-73 49 INTERACTIVE SCHEDULING AS A CONSTRAINT SATISFIABILITY PROBLEM Ronen FELDMAN Department of Mathematics and Computer Science, Bar-Ilan University, Ramat Gan, Israel Martin Charles GOLUMBIC IBM Israel Scientific Center, Technion City, Haifa, Israel Abstract A constraint satisfiability problem consists of a set of variables, their associated domains (i.e., the set of values the variable can take) and a set of constraints on these variables. A solution to the CSP is an instantiation (or labeling) of all the variables which does not violate any of the constraints. Since constraint satisfiability problems are, in general, NP-complete, it is of interest to compare the effectiveness and efficiency of heuristic algorithms as applied, in particular, to our application. Our research effort attempts to determine which algorithms perform best in solving the student scheduling problem (SSP) and under what conditions. We also investigate the probabilistic techniques of Nudel for finding a near-optimal instantiation order for search algorithms, and develop our own modifications which can yield a significant improvement in efficiency for the SSP. Experimental results have been collected and are reported here. Our system was developed for and used at Bar-Ilan University during the registration period, being available for students to construct their timetables. Keywords: Constraint satisfiability, scheduling, search. 1. Introduction Techniques for solving constraint satisfiability problems * (CSPs) have re- ceived much attention in artificial intelligence, operations research and symbolic logic. Applications which may be viewed as CSPs are found in scene identifica- tion in computer vision, space and motion planning, database consistency, combinatorial optimization and cryptarithm puzzle solving. Our research has dealt with algorithmic aspects of solving CSPs and using these methods for interactive scheduling in the Academic Planning Environment expert system * Constraint satisfiability problems are also known in the literature as consistent labeling problems [9,10]. J.C. Baltzer A.G. Scientific Publishing Company

Transcript of Interactive scheduling as a constraint satisfiability problemgolumbic/papers/J27.pdf · INTERACTIVE...

Page 1: Interactive scheduling as a constraint satisfiability problemgolumbic/papers/J27.pdf · INTERACTIVE SCHEDULING AS A CONSTRAINT SATISFIABILITY PROBLEM Ronen FELDMAN Department of Mathematics

Annals of Mathematics and Artificial Intelligence, 1 (1990) 49-73 49

I N T E R A C T I V E S C H E D U L I N G AS A C O N S T R A I N T S A T I S F I A B I L I T Y P R O B L E M

R o n e n F E L D M A N

Department of Mathematics and Computer Science, Bar-Ilan University, Ramat Gan, Israel

Mar t in Charles G O L U M B I C

IBM Israel Scientific Center, Technion City, Haifa, Israel

Abstract

A constraint satisfiability problem consists of a set of variables, their associated domains (i.e., the set of values the variable can take) and a set of constraints on these variables. A solution to the CSP is an instantiation (or labeling) of all the variables which does not violate any of the constraints. Since constraint satisfiability problems are, in general, NP-complete, it is of interest to compare the effectiveness and efficiency of heuristic algorithms as applied, in particular, to our application. Our research effort attempts to determine which algorithms perform best in solving the student scheduling problem (SSP) and under what conditions. We also investigate the probabilistic techniques of Nudel for finding a near-optimal instantiation order for search algorithms, and develop our own modifications which can yield a significant improvement in efficiency for the SSP. Experimental results have been collected and are reported here. Our system was developed for and used at Bar-Ilan University during the registration period, being available for students to construct their timetables.

Keywords: Constraint satisfiability, scheduling, search.

1. Introduction

Techniques for solving cons t ra in t sat isf iabil i ty p ro b l em s * (CSPs) have re- ceived m u c h a t t en t ion in artificial intell igence, ope ra t ions research an d symbol ic logic. Appl ica t ions which m a y be viewed as CSPs are f o u n d in scene ident i f ica- t ion in c o m p u t e r vision, space and m o t i o n planning, da t abase consis tency, combina to r ia l op t imiza t ion and c ryp t a r i t h m puzz le solving. O u r research has deal t with a lgor i thmic aspects of solving CSPs and us ing these m e t h o d s for in teract ive schedul ing in the Academic P lann ing E n v i r o n m e n t exper t sys tem

* Constraint satisfiability problems are also known in the literature as consistent labeling problems [9,10].

�9 J.C. Baltzer A.G. Scientific Publishing Company

Page 2: Interactive scheduling as a constraint satisfiability problemgolumbic/papers/J27.pdf · INTERACTIVE SCHEDULING AS A CONSTRAINT SATISFIABILITY PROBLEM Ronen FELDMAN Department of Mathematics

50 R. Feldman, M.C. Golumbic / Interactive scheduling

project [6,7], a system which provides advising and assistance to university students in the planning of their program of studies.

A constraint satisfiability problem (CSP) is composed of a set of variables V = { v I . . . . , v n }, their related domains D1,. . . , D n and a set of constraints on these variables. (The domain of a variable is a group of values to which the variable may be instantiated.) The domain sizes are m l , . . . , m, , respectively, and we let m denote the maximum of the m r Each constraint Cj is relevant to a subset of variables vja, . . . , vj k~ and may be regarded as containing all tuples of values over this set of variables that are legal with respect to Cj, that is, Cj _ Dj,1,... , Dj,kj. A constraint which is relevant to exactly one variable is called a unary constraint. Similarly, a binary constraint is relevant to exactly two variables.

A solution to the CSP consists of an instantiation of all the variables which does not violate any of the constraints, i.e., a consistent labeling of each variable with a value from its domain. Computationally, constraint satisfiability problems are NP-complete, which implies that there are no known polynomial time algorithms which can guarantee finding a solution. Therefore, it is of interest to compare the effectiveness and efficiency of various heuristic algorithms for solving CSPs as applied, in particular, to our application.

The simplest algorithm is the brute force algorithm which simply tries every possible combination of values being instantiated to the variables. It can be realized by n nested loops, with each loop assigning a value to one variable from its domain. At the innermost loop we make all our tests because only there are all the variables already instantiated. If all the constraint tests succeed, we have found a solution; otherwise, we backtrack and assign another value to the closest variable. The worst case complexity of this algorithm is M = I-I,~lm i. Because of the potentially exponential search that this algorithm will execute in order to find a solution, there are a number of techniques for improving its performance by statically or dynamically pruning the search space. For example, constraints which are relevant to a small subset of variables can be used to throw out, in a single consistency check, a much larger group of possible tuples (all the exten- sions of the rejected tuple). In section 2, we will describe the most interesting and effective of these modified algorithms, and after introducing the student schedul- ing problem as a CSP in section 3, we will formulate these algorithms from the scheduling system point of view in section 4 and investigate their performance characteristics.

Our research effort attempts to determine which algorithms perform best in solving the student scheduling problem and under what conditions. Since the order in which variables are assigned values significantly affects the performance of such algorithms, we investigate the probabilistic techniques of Nudel [13] for finding a near-optimal instantiation order and develop our own modifications which can yield a significant improvement in efficiency for the SSP. This is presented in section 5. We conclude with several topics for further investigation in section 6.

Page 3: Interactive scheduling as a constraint satisfiability problemgolumbic/papers/J27.pdf · INTERACTIVE SCHEDULING AS A CONSTRAINT SATISFIABILITY PROBLEM Ronen FELDMAN Department of Mathematics

R. Feldman, M.C. Golumbic / Interactive scheduling 51

2. Approaches for solving a CSP

There are two opposite approaches which have been developed for solving CSPs. The first approach is called filtering, which works by preprocessing the domains using constraint propagation in order to limit the search space and thereby reduce the time taken to find the first solution. The second approach is a tree-search, which starts by giving some value to the first variable, then to the second and so on and if we fail then we backtrack, often in some intelligent manner. A third, hybrid approach, combines features of both of these techniques and is most often the preferred method. We will now describe these approaches in more detail.

2.1 F I L T E R I N G A L G O R I T H M S

Mackworth [9] has shown that there are CSPs where we can successfully reduce the search space by using simple preprocessing procedures. Dealing only with unary and binary constraints, three phenomena are characterized that can eliminate unnecessary work when searching for a solution. (1) Variable inconsistency *: A variable v, is inconsistent if there is a value u in

its domain 1), which does not satisfy a unary constraint. When this is the case, that value u should be deleted from 19, since v, will never be instanti- ated to u in any solution. Eliminating variable inconsistency can be done in linear time.

(2) Pairwise inconsistency * *: A pair of variables v, and vj are inconsistent with each other if there is a binary constraint relevant to them and a value u in/9, such that no value in Dj is consistent with the assignment v, = u. When this is the case, u can be deleted from D i. Eliminating pairwise inconsistency can be done in low polynomial time and succeeds in a substantial reduction in a number of application areas.

(3) Path inconsistency: This type of inconsistency involves sequences of k varia- bles such that an instantiation of the first k - 1 implies no consistent value for the last. Eliminating this type of inconsistency has high complexity and it is generally agreed that it is rarely worthwhile.

2.2. T R E E S E A R C H A L G O R I T H M S

The basic member of this class of algorithms is the standard backtracking algorithm. It is based on the existence of constraints which can check smaller tuples on our way to an expected solution.

The process Of finding a solution is separated into n stages, one stage for each successive variable being instantiated. At stage k, the variables are partitioned

* Mackworth calls this n o d e incons i s tency . * * Mackworth calls this arc i n c o n s i s t e n c y .

Page 4: Interactive scheduling as a constraint satisfiability problemgolumbic/papers/J27.pdf · INTERACTIVE SCHEDULING AS A CONSTRAINT SATISFIABILITY PROBLEM Ronen FELDMAN Department of Mathematics

52 R. Feldman, M.C. Golumbic / In terac t ive scheduling

into two groups, .4 k containing the instantiated variables and F k containing all the remaining variables.

The standard backtracking algorithm. init: i ~ 1; A ~ ~ j J ; new-stage: Ai ~ A i - l U (v,}; select: select a value u ~ D; that does not violate any constraint

whose set R of relevant variables satisfies v~ ~ R c_ A'; instantiate u to v,; if there is no such value u then

backtrack to the preceding stage (i.e., uninstantiate vi_ 1 and try to find another value for it);

iterate: i <-- i + 1; goto new-stage;

Another algorithm in this group is the back-jumping algorithm. When this algorithm detects a failure, it looks for the most recent variable which caused the failure, and backtracks directly to that variable, uninstantiating all the variables between the current one and the jump-back target. This algorithm solves the thrashing problem caused by certain inconsistencies, in particular, pairwise incon- sistency.

It is well known that the instantiation order of the variables may have a substantial impact on the performance of tree search algorithms. This issue will be addressed in section 5.

2.3. HYBRID ALGORITHMS

2.3.1. The forward checking algorithm Some of the inefficiencies of the simple backtrack algorithm served as the

motivation for the filtering algorithms described above. However, the filtering algorithms themselves are not powerful enough to solve the problems alone. Therefore, a variety of hybrid combinations of the two have been suggested. The basic member of this group is the forward checking algorithm. The forward checking algorithm may be Viewed as augmenting standard backtracking by removing from the domain of each uninstantiated variable all values which are inconsistent with the new instantiation, and thus eliminating in advance all possible Violations of constraints on A i.

The forward checking algorithm. init: i<--- 1; A~ <---~f; new-stage: A i ,,-- A ' - 1 U { v, }; select: select a value u ~ D~;

instantiate u to vi; if there is no such value u then

backtrack to the preceding stage;

Page 5: Interactive scheduling as a constraint satisfiability problemgolumbic/papers/J27.pdf · INTERACTIVE SCHEDULING AS A CONSTRAINT SATISFIABILITY PROBLEM Ronen FELDMAN Department of Mathematics

R. Feldman, M. C. Golumbic /Interactive scheduling 53

update:

iterate:

for all Dj (i < j ~< n) do remove from Dj all values inconsistent

with the current instantiation; end if any Dj becomes empty then do

restore all the domains to their preceding state; goto select;

end i ~ i + 1 ; goto new-stage;

Remark. When programming in Prolog, the restoration of domains upon backtracking is done automatically.

Haralick [8] has suggested two variations of the basic forward checking algorithm, namely, full look ahead and partial look ahead. These variations perform some additional consistency checks in the update step in order to narrow the search for a solution to the CSP. Briefly, in the full look ahead algorithm after updating the domains according to the current instantiation, one also performs consistency checks between all pairs of future variables. Thus, if the size of F k is t, then t ( t - 1) such consistency checks are done. The consistency check is the standard Mackworth pairwise consistency procedure mentioned in section 2.1. In the partial look ahead algorithm, instead of activating the pairwise consistency procedure for each pair of variables in F k, one assumes an ordering of the variables and propagates the constraints only over the t ( t - 1)/2 ordered pairs (v;, vj) with i < j , thus reducing the effort by half.

2.3. 2. The word-wise forward checking algorithm The word-wise forward checking algorithm [8] improves upon regular forward

checking in terms of the number of consistency checks done before finding a solution by exploiting the parallel bit-handling capability of the computer. The algorithm, as will be described here, applies only to binary constraints. The main idea is to code the constraints between each two variables v, and vj explicitly by a set of binary words: For each value u ~ D i we have a word value-variable- mask,,j(u) which represents the compatible values in the domain Dj. We look at this word as an ordered set of bits, the k th bit equal to 1 if u is compatible with the k th value in Dj and equal to 0 otherwise. Although it would seem that the masks require at lot of space, O(nEm 2) bits, it can be shown that they are cost-effective for large problems. We may assume that the size of the largest domain is less or equal to the number of bits in the computer word, since otherwise we can represent the domain with a few words. Each variable vi also has an associated domain-mask i which represents the status of each value in its domain: If the value is still consistent with the preceding instantiations, then the corresponding bit will be 1, otherwise it will be 0.

Page 6: Interactive scheduling as a constraint satisfiability problemgolumbic/papers/J27.pdf · INTERACTIVE SCHEDULING AS A CONSTRAINT SATISFIABILITY PROBLEM Ronen FELDMAN Department of Mathematics

54 R. Feldman, M.C. Golumbic /Interactive scheduling

After ordering the variables according to some chosen criterion, we first enter a preprocessing phase that initializes the domain-masks and computes the con- straints explicitly representing them in the value-variable-masks by performing Mackworth pairwise consistency once. This is followed by a search phase which is exactly the regular forward checking algorithm but with the masks being used as follows:

In the select statement, the value u is one whose associated bit in domain-mask, is 1; the update of Dj is obtained by reassigning to domain-maskj the result of performing one bit-and operation between domain-maskj and value-variable- mask,, j (u).

Remark. The major benefit of the word-wise forward checking algorithm is that the update step is completed in (n - t) bit-and steps.

3. The student scheduling problem as a CSP

The student scheduling problem (SSP), which we present in this section, can be looked at as a variation of a CSP. Thus, we will be able to apply the algorithms and theory of CSPs to help in solving the SSP.

Associated to each course at a university is a set of offerings where " taking a course" means registering for one of its offerings. An offering consists of a number of meetings which the student must attend. For example, 88.101.5, the fifth offering of course 101 in department 88, might be represented by

M F 10-11 semester l , 2 lecture prof .golumbic Th 16-17 semester 1 recitation mr.feldman T 14-17 semester 2 laboratory dr.schiM

Two offerings conflict if their time intervals intersect. We assume here that time intervals do not include their endpoints, (e.g., W 11-12 does not conflict with W 12-13.) These conflicts constitute the implicit constraints. The basic unit of the SSP, called a group, consists of a list L, of courses and lower and upper bounds, I i ~< ui ~<lLz l, indicating the min imum and the maximum number of courses to be taken from the list. A group is strict if l i = U i = I L, I- If the student wants to force the scheduler to schedule a particular course, he can do so by declaring a strict group.

The input to the SSP will be a disjoint list of groups, called the requirements, a timetable of offerings (as published by the university), and a set of explicit constraints and priorities to be described below. A successful output will be a set of offerings which satisfies the requirements and all implicit and explicit con- straints.

We regard each course as a variable whose set of offerings is its domain. If the requirements are all strict groups, then our problem would be to find a consistent labeling of the set of all the courses included in the requirements, i.e., the union

Page 7: Interactive scheduling as a constraint satisfiability problemgolumbic/papers/J27.pdf · INTERACTIVE SCHEDULING AS A CONSTRAINT SATISFIABILITY PROBLEM Ronen FELDMAN Department of Mathematics

R. Feldman, M.C. Golumbic / I n t e r a c t i v e scheduling 55

of all the course lists of the groups. But if the requirements include non-strict groups, then there will be courses that need not be instantiated in a solution to the problem. In this sense, one may either regard the SSP as a slight generaliza- tion of the regular CSP to allow for uninstantiated variables, or simply add a "dummy" offering to each domain and incorporate the number of dummy instantiations in a group with the lower and upper bound constraint checks. Therefore, the algorithms presented in section 2 can be applied to the student scheduling problem.

Priorities and constraints: In addition to the implicit constraints defined above, we also allow certain "user defined" explicit constraints. In this paper * we define a priority to be one of the numbers - P or P. Each of the following two types of objects can have a priority assigned to it: - Fixed time constraints. Each hour in the week is assigned a priority indicating

how important it is for the student to learn or not to learn in this hour. Any hour with priority - P is completely blocked, while any hour with priority P must be scheduled.

- Non-f ixed time constraints. A n hour range (start hour to end hour) and a number of days in a single week may be assigned a priority. This differs from the fixed time constraints in that it leaves the actual days to be blocked or preferred unspecified.

There is one additional type of constraint which is not assigned a priority, namely the - Hour load constraints. The minimum and maximum number of hours in the

week, for each semester, that the student wants to learn. The hour load constraints together with the fixed and non-fixed time constraints constitute all the explicit constraints.

4. Solution techniques for student scheduling problems

4.1. STAGES OF THE SSP

We can divide the procedures and algorithms for solving an SSP into four stages: (I) procedures done as preprocessing before starting the search, (II) checks done during the search to choose the next instantiation,

* In a companion paper [3] we allow a priority to be any number in the range - P ..... 0 .... , P with the actual constraints being those which have priority P or - P and all other priorities being simply recommendations to the scheduler. The scheduler uses those priorities to indicate which schedule will be preferred over another by the student. This is particularly important when there is no solution, and the system attempts to relax the explicit constraints or adjust the groups in order to find a good partial solution. In [3] we investigate algorithms to find solutions to the SSP which rank high according to these general priorities.

Page 8: Interactive scheduling as a constraint satisfiability problemgolumbic/papers/J27.pdf · INTERACTIVE SCHEDULING AS A CONSTRAINT SATISFIABILITY PROBLEM Ronen FELDMAN Department of Mathematics

56 R. Feldman, M.C. Golumbic / In terac t ive scheduling

(III) procedures done in each stage of the search process after a new instantiation is made, and

(IV) checks done against the final schedules. We will now describe which procedures, algorithms and checks are included in each stage of our solution technique.

4.1.1. Stage I: Preprocessing We use the Mackworth algorithm for achieving variable consistency. Since the

variables correspond to the courses, we will remove all offerings which are inconsistent with the fixed time constraints or very tight non-fixed time con- straints having priority - P . Experiments have shown that this preprocessing is necessary to substantially reduce the search space in the presence of such constraints. After this preprocessing is done, these constraints may be ignored.

4.1.2. Stage H: Checks done to choose the next instantiation Three checks are done during backtracking in order to make extensive cuts in

the search. In order to enhance the efficiency of how our predicates operate, we use bit masks extensively for the actual data types in our implementation.

Each offering is represented by an offering mask indicating the semester and hours during the week in which it is active. Two offerings overlap if the bit-and between their masks is 1, i.e., there is at least one time conflict between their meetings on a certain day at the same hour. In addition, for each semester we maintain a semester mask of all courses that have been scheduled so far in that semester (the bit-and of all the offerings selected). As we try to instantiate the next variable (called the current course), we perform the following three checks: (1) The overlapping check: a bit-and check between each offering mask of the

current course and the semester masks. (2) The hour load check: verifying that we have not yet scheduled more hours

than the top limit. (3) Negative non-fixed time constraint checks (with priority - P ) . This last check

is done as follows: Each non-fixed constraint has an hour range which we code into a mask and a specified number n of days. We then perform the following check:

count ~ 0; for all day_ mask in semester_ mask do

Res ~ bit-and (day_ mask, n f _ mask); if ( Res ~ 0) then count *-- count + 1;

end;

if count >I n then the constraint is satisfied;

else fail;

Page 9: Interactive scheduling as a constraint satisfiability problemgolumbic/papers/J27.pdf · INTERACTIVE SCHEDULING AS A CONSTRAINT SATISFIABILITY PROBLEM Ronen FELDMAN Department of Mathematics

R. Feldman, M. C. Golumbic / Interact ive scheduling 57

4.1.3. Stage 111." Procedures done after a new instantiation is made Here we have two kinds of procedures. (1) Procedures done to update the domains of the future variables. These proce-

dures are adopted from the update step of the forward-checking algorithm (section 2). From experiments it was shown that it is best to sort the courses after each update step according to increasing domain size, because the sizes of their domains are constantly changing.

(2) Procedures which check that we still can relax the positive priority constraints. It is preferable to find out as soon as possible if we cannot relax any of the positive priority constraints rather than to wait until after the search. This can be accomplished in two similar ways: (a) Take all the offerings of the courses that have not been scheduled yet and do

a bit-or of each of them with the suitable semester masks, and apply to the two final masks (one for each semester) all the tests that check if we can relax the positive constraints. (The resulting masks represent the maximal number of hours that can be scheduled.)

(b) At the preprocessing phase we build a structure called the hour-tree. (The hour-tree is used extensively in our optimization algorithms which are dis- cussed in [3].) In addition, we maintain with each positive non-fixed con- straint a status. The status of a constraint is the mask list of the hours still available for it (i.e., we have already scheduled a course in that hour or there is still a chance that a course will be scheduled in that hour). The initializa- tion of the statuses is done using the hour-tree. After obtaining the status of each constraint, we can check if they have a chance to be satisfied. After each scheduling the hour-tree is updated. During the update process we check if any of the hours have no courses left and thus its entry should be discarded. For each of these hours, we update the status of all constraints which include this hour within their range. Every constraint that was updated is checked to see that it can still be satisfied. This is an event driven approach. Only when an hour is being discarded from the tree does the status of a constraint change, and not after each scheduling. The disadvantage of this approach is that we have to maintain the hour-tree in memory, which takes a lot of memory, a resource in very short supply.

4.1.4. Stage IV: Checks done to the final schedules Two final validating checks are to be performed here on each candidate

schedule. (1) Verify that the bottom limit of the hour load constraint has not been violated,

i.e., that enough hours have been scheduled. (2) Check whether all the positive constraints have been satisfied.

Page 10: Interactive scheduling as a constraint satisfiability problemgolumbic/papers/J27.pdf · INTERACTIVE SCHEDULING AS A CONSTRAINT SATISFIABILITY PROBLEM Ronen FELDMAN Department of Mathematics

58 R. Feldman, M.C. Golumbic /Interactive scheduling

4.2. ALGORITHMS FOR SOLVING THE STUDENT SCHEDULING PROBLEM

This section presents SSP specific versions of the algorithms. Modifications must be made since, as we noted in section 3, the SSP is slightly more general than a regular CSP. In the case of a CSP, when there is no way to satisfy a given variable, we reach a "dead end" in the search for a solution. In the case of an SSP, however, if the variable is in a non-strict group, we leave it uninstantiated and continue the search in the event that satisfying other members of the group will be sufficient to satisfy the bounds associated with that requirement.

In the preprocessing phase, a variable consistency check is done on all the courses. This checking of the unary constraints is very cost-effective, and can reduce the search space dramatically. The regular backtracking algorithm is nearly the same as that described in section 2. It has the same control mechanism but it has the obvious modifications in the selection and validation procedures. The forward checking algorithm also has the same control mechanism as in section 2; however, its three primary procedures (select, update, and validate) are specially adapted to the SSP. They are given in the appendix.

The selecting procedure assumes that the head of each group course-list is the course with the smallest domain. This is accomplished and maintained by the update procedure. The criterion of selecting the course with the smallest domain from the available courses is the default and was used exclusively in [6]. In section 5, however, which deals with obtaining the best instantiation order, we will see better criteria for estimating the most "difficult" variable to instantiate, which can be chosen as an option.

4.3. EXPERIMENTAL RESULTS

Comparisons between different CSP algorithms when used for solving the SSP, i.e., finding one schedule, have been carried out. Now we will describe in detail the exact experiments, which algorithms were used, the class of problems address- ed, and their relative performance.

In these experiments, we have compared three CSP algorithms for finding one schedule: (1) regular backtracking algorithm, (2) forward checking algorithm (with sorting of the variables in increasing order

of their domain sizes after each stage), (3) word-wise forward checking.

In the experiment we have generated random sets of 30 courses (each denoted by List), and then tried all three algorithms on the requirement g(Min, Min, List) with Min varying between 30 and 1. For each algorithm, we measured the time in seconds it took to solve the problem. We have generated about 3000 problems and have computed the average time it took for each algorithm to solve a problem for each value of Min.

Page 11: Interactive scheduling as a constraint satisfiability problemgolumbic/papers/J27.pdf · INTERACTIVE SCHEDULING AS A CONSTRAINT SATISFIABILITY PROBLEM Ronen FELDMAN Department of Mathematics

R. Feldman, M.C. Golumbic /Interactioe scheduling 59

foPwaPd c J l e c k i n g

| woPd w i s e

�9 Peg ~ c k t P a c k i n y

numbeP os couPses to be s c h e d u l e d (s 3g)

Fig. 1. Comparison between CLP algorithms.

"I"3r

1 ~ foPw~Pd c h e c k i n g A Peg b a c k t P a c k i n g | woPa w i s e

I I I t I I I I I I I I I I I I I 1'

nu~})ez, o f couPses to }~e s o h e d u l e d { fPom 3(])

Fig. 2. Comparison between CLP algorithms.

Page 12: Interactive scheduling as a constraint satisfiability problemgolumbic/papers/J27.pdf · INTERACTIVE SCHEDULING AS A CONSTRAINT SATISFIABILITY PROBLEM Ronen FELDMAN Department of Mathematics

60 R. Feldman, M.C. Golumbic / Interactive scheduling

From the results shown in fig. 1, we see that the word-wise algorithm clearly appears to be better than the other two and regular backtracking is the worst. If we will look at fig. 2, however, we will see that when Min is low enough (e.g.,

19), then the regular backtracking is the best. This phenomenon is caused by the overhead we have in both the word-wise and the forward checking algorithms. The overhead of the word-wise algorithm is larger than that of the forward checking algorithm. So we may conclude that when Min is low it is best to use the simple backtracking algorithm because the problem is so simple we do not need such a "weapon" like the word-wise algorithm. But when the problems become more complicated, word-wise can be 5 times better than regular backtracking.

5. Instantiation order

It is well known that the instantiation order of the variables affects the time it takes to find a solution to a CSP. Therefore, if we can find a method which can help in determining a good order for our problem, it will save us a substantial amount of computing effort in the search. However, this method must be computationally easy enough so as not to forfeit the benefits.

5.1. HEURISTIC TECHNIQUES

Intuitively, it would appear that the variable most difficult to be instantiated ought to be instantiated first, the second most difficult next, and so forth in decreasing order of difficulty. This criterion is called "most promising to fail first" in some of the literature. The justification of such a criterion is that the sooner we fail, the sooner we can stop an unproductive search and backtrack, thus avoiding unnecessary and unfruitful checks. Haralick [8] has proved that under a suitably defined mathematical notion of "difficulty", this strategy will be optimal for the standard backtracking algorithm. Unfortunately, it is usually impossible to find such a parameter which fully captures "difficulty".

So our aim would be to select which variable is the most "difficult" to instantiate using a heuristic approach. The most obvious heuristic is to choose the variable with the smallest domain. We call this domain-size sorting and it is carried out a priori immediately following filtering by unary constraints (variable consistency). This well known criterion was found to be useful in [6] because of its simplicity and efficiency in providing substantial benefit over random order- ings. In general, however, it is not a good estimate of the optimal order, apparently because it uses very little information about the problem itself. For example, no use is made of the relationships and interconnection between offerings.

A dynamic approach, determining the instantiafion order as the search pro- ceeds, was proposed for standard backtracking in [1] and analyzed in [14]. (See

Page 13: Interactive scheduling as a constraint satisfiability problemgolumbic/papers/J27.pdf · INTERACTIVE SCHEDULING AS A CONSTRAINT SATISFIABILITY PROBLEM Ronen FELDMAN Department of Mathematics

R. Feldman, M.C. Golumbic / Interactive scheduling 61

also [2,4].) Ideally, we might wish to apply such a dynamic approach to the forward checking algorithms (described here in section 3.3) by always choosing the uninstant iated variable whose current domain is smallest. As attractive as this may seem for cutt ing the search space, in some applications the computa t ional complexity of constantly updat ing the domains in forward checking can make it infeasible.

Therefore, Nudel [13] has studied other criteria for measur ing the difficulty of the variables by estimating the number of required consistency checks in the forward checking algorithms. In particular, he analyzed the influence of the inter-variable compatibil i ty for choosing an instant iat ion order in arbitrary CSPs with binary constraints.

In our investigations, we have compared various strategies, including those of Nudel, as they apply to the SSP. In the remainder of this section, we will describe these approaches for selecting the most difficult variable, including our own approach, analyze their expected behavior and summarize our basic experimental findings.

5.2. NOTATION

The compatibility matrices T,.,j (i C j ) are defined by T,,j(k, l) = 1 if and only if v i = d,, k is compatible with vj = dj, l, where domain D, = { d, ,1 , . . . , d,,m, }. We say that two CSPs are equivalent if their compatibi l i ty matrices are the same. We further define

m~,j ----- m , m j , /,,j = the number of l ' s in T,,~ (the number of pairwise compat ible instantia-

tions of v, and vj), Ri, j ~ - I~ ,Jmi , j (the probabili ty that a label of v~ and a label of vj will be

compatible). R,,j = 1 means that v, and vj are fully compatible, whereas R,,j = 0 means they are completely incompatible. To simplify notat ion, let us assume that the varia- bles v 1 . . . . , v n have been renumbered according to their instant ia t ion order, and let A ~ = { v l , . . . , Vk} and F k = { Vk+l , . . . , Vn} denote the par t i t ion of the varia- bles into those already instantiated after the k th stage and those to be instanti- ated in future stages, e.g., A ~ = ~ and F ~ = ~.

The following parameters estimate the l ikelihood of succeeding to complete a partial instantiation.

w~k(t) = the probabili ty that a future variable v, ~ F k will still have t of its initial m, labels consistent after the variables in A k have been instantiated.

S, k = 1 - w,.k(0), the probabili ty that v, ~ F ~ will not be wiped out, i.e., left with an empty domain, after stage k in the forward checking algorithm.

P,k(u, t) = the probabili ty that of u consistent labels for v, before the instanti- ation of Vk (the current variable at stage k) t labels will remain consistent.

Page 14: Interactive scheduling as a constraint satisfiability problemgolumbic/papers/J27.pdf · INTERACTIVE SCHEDULING AS A CONSTRAINT SATISFIABILITY PROBLEM Ronen FELDMAN Department of Mathematics

62 R. Feldman, M.C. Golumbic /Interactive scheduling

Pik(u, t) is called the transition probability and stands for the probabili ty that some labels of v, will survive the transition f rom stage k - 1 to stage k. A recursive definition of W/'(t) can then be given as follows:

mt

w)(t)= E t). u=0

5.3. PROBABILISTIC ANALYSIS OF T H E I N S T A N T I A T I O N O R D E R

Nudel 's investigations [13] are based on the transition probabilities which are computed or approximated from information on the particular problem. He advocates using two levels of information. The first level (called level-1 ) assumes that you know the compatibility probabilities R;,y between the variables and the initial sizes m i of the domains. The second level (level-2) assumes that you also know for each two variables the number of compatibilities I,,j between them. Actually the information we have in both levels is the same since we can calculate Ii,j from m,,j and R,,j. The difference between the levels is the statistical model we are adopting. For level-1 we have the binomial distribution model and for level-2 the hypergeometric distribution model. The level-2 model declares a finer partition of the CSPs than the level-1 model. (The partit ion is the classes of CSPs that have, according to the model, a common ordering scheme, i.e., all the relevant details of the problems are identical.)

5.3.1. The transition probability for level-1 For the level-1 theory, the transition probability Pik(u, t) is a simple binomial

probability. We want t events to occur (from u tries), each one having probability R,, k and we want the other u - t tries to fail (the failure probabili ty being 1 - R,,/,).

e , k ( u , t ) = t ( R , , k ) ( 1 - - R i , k ) , W,k(0) = 1-- I-I R,,j . j ~ A k

The term in the parentheses is the probability that a value of v i would not be consistent with the instantiations made already. In order to find the probability of a total failure of v i, we raise this term to the power m,.

5.3.2. The transition probabifity for level-2 We know that we have Ii, j consistent pairs from mi, j possible pairs, and we

are asked for the probability that from u pairs whose first components are the same and whose second components vary there will remain t which stay con- sistent, i.e., belong to the li, j pairs. Here we have to choose which t labels from the possible u labels will stay consistent and then choose how the other li,j - t consistent labels will be distributed among the m;,j - u remaining pairs. Thereby

Page 15: Interactive scheduling as a constraint satisfiability problemgolumbic/papers/J27.pdf · INTERACTIVE SCHEDULING AS A CONSTRAINT SATISFIABILITY PROBLEM Ronen FELDMAN Department of Mathematics

R. Feldman, M.C. Golumbic / Interactive scheduling 63

we have a transition probability which is hypergeometric:

e?(u, t)= m i ' k - - U E ( - -1) q q E~ I i , j _ q

L,k-- t wtk(0) = q=0 j mi 'k ] ' mi , j

j ~ A k

5.3.3. Number o f nodes in the kth stage A node is a tuple that has k components - the values of the already

instantiated variables. If all the variables were totally independent, then the number of nodes N k at the k th stage would be the product ~r k of the domain sizes of the variables in A k. But the existence of constraints implies that not all the variables are totally independent. Therefore, we have to multiply ~r k by the product of all the Ri. J for all v,, vj ~ A k, and, in order to be sure that all the future variables were not wiped out, we have to multiply that result by the product of all the S k - 1 for all o i ~ F k. (The reason for S/k- 1 is because we are at the beginning of the k t h stage, i.e., before performing forward checking.) There- fore, we can write the following:

N k = 1--I m, I-I Ri , j I-I s f -1. j~A k i<j~A k f E F k

The total number of nodes can be a good approximation for the total number of consistency checks done until the first solution is found because the total number of consistency checks C can be written

c= ENkck, k

where c k is the average number of consistency checks per node at the k th stage. Computing c k is much more complicated than computing N k, so, using the criterion of cost-effectiveness, we will use the total number of nodes as our target for minimization as a function of the instantiation order of all the variables. The best instantiation order will be the one that minimizes N = E N k, the total number of nodes. But to find this opt imum instantiation order we would need to compute N for every one of the n ! permutations of o 1 . . . . , o n. Since this exhaustive process will be too long, we will use a different, local approach.

We will find the order in stages; first we will determine which variable minimizes N1, then after the first variable is fixed find the next one which minimizes N2, and so on until we have the full instantiation order. In order to find the variable that minimizes N k where A k-1 is fixed already, we do not have to compute for each variable the full expression of N k, but rather we have to compare only those terms that concern the candidate variable and not those concerning variables in A k -1 o r in F k. So we have to find the variable o! from

Page 16: Interactive scheduling as a constraint satisfiability problemgolumbic/papers/J27.pdf · INTERACTIVE SCHEDULING AS A CONSTRAINT SATISFIABILITY PROBLEM Ronen FELDMAN Department of Mathematics

64 R. Feldman, M.C. Golumbic / In terac t i ve scheduling

F k - 1 which minimizes the expression

mf VI Rz,f t E A k-1

S~ -a

This expression is much simpler and, of course, easier to compute than N k. Although this formula may be good for dealing with a regular CSP where a solution must be a consistent labeling for all the variables, in the case of an SSP we usually do not have to find a consistent labeling for all the variables, because of the non-strict groups. In this latter situation, all such variables that are inconsistent with A g- 1 will have Sf k- 1 = 0 and we cannot compare them.

5.4. EXTENDING LEVEL-1 AND LEVEL-2 THEORIES

If we want to use level-1 and level-2 for the general case where Min < Len(List), i.e., when the groups are not strict, a few changes must be made. The changes are in the term containing the Sf k-1. In the original formula, when we must find a consistent labeling for all the variables, it was correct to multiply by the product of all the I-I/~ F k S f k - 1 because we were to schedule all the future variables. But in the general case when Min is lower than Len(List), we do not schedule all the variables.

To solve this more general problem we will use probabili ty theory. If we have n non-related events E = ( E l , . . . , E n } whose respective probabilities are P1 . . . . , In, then the probability for all of them to happen is I-IT=IP~. Now we have to find the probability that at least m of these n events (n > m) will happen. First we will denote by Sub(S, i) the collection of all subsets of S of size i. The probability that at least m events will happen is given by the expression

r / - -m

E I I P , + E ( - 1 ) ' ( m + i - 1 ) E I - I P j �9 S ~ S u b ( E , m ) t E S i = 1 S ~ S u b ( E , m + i ) j ~ S

�9 s k - 1 k - 1 In our case m = Min - k, n = l = Len(List) - k and PI , . . P, are d, , . . . , S,7, So in the formula for N k we would replace the product l-If ~ vkSf -1 by the above expression with the appropriate substitutions.

This formula is very complicated and to compute it would require quite a long time�9 Therefore, we have developed and used methods that will be described next which have been proved by our experiments to be much more efficient than level-1 and level-2 based algorithms.

5.5. F INDING THE OPTIMAL ORDER FOR RE G U L A R BACKTRACKING

The two methods described as level-1 and level-2 require quite a long computa- tion to find the desired order even when using a hill climbing version. In this subsection we will describe a criterion for the regular backtracking algorithm

Page 17: Interactive scheduling as a constraint satisfiability problemgolumbic/papers/J27.pdf · INTERACTIVE SCHEDULING AS A CONSTRAINT SATISFIABILITY PROBLEM Ronen FELDMAN Department of Mathematics

R. Feldman, M.C. Golumbic / Interactive scheduling 65

which uses only the size of the candidates's domain and the inter-relations R,,: between it and the variables in A k-1.

We want to develop a formula to minimize Ck, the expected number of checks performed at the k th level as a function of the selected order of the first k variables. We note that C k = NkC k, where c k denotes the average number of consistency checks for each node in the k th level. In our case, for each node we have to do only two consistency checks regardless of the inter-relations between the variables. The checks are the two bit-and operations between the candidate offerings against the semester masks. So the only factor that matters to the order is Nk (because c k is a constant) from which it follows easily that

Nk= YI m, 1-- I R,,j. l E A k t < j ~ A k

In order to minimize N k as a function of the new candidate when the order of A ~-1 is determined already, we have to minimize only the terms in N k that concern the candidate f chosen. The terms that are relevant are combined into the expression

(BT) my H Rf, t. i ~ A k -1

So the method is to find in each stage the variable f from F ~- 1 which minimizes (BT). We shall call this algorithm hill-cfimb past because we are using the information about the inter-relation between the candidate and the past variables.

5.6. FINDING THE OPTIMAL ORDER FOR FORWARD CHECKING

The criterion (BT) just presented for regular backtracking, being simpler than the level-1 and level-2 criteria, has motivated us to look for a similar criterion for the forward checking algorithm. In our solution, we consider the same type of expression except that, instead of using the inter-relations between the candidate and the past variables, we use the inter-relations between the candidate and the future variables. This distinction follows from the nature of the algorithms. The experimental results reported here have verified the validity of this approach.

Our first criterion for finding the next variable to be instantiated is to find the index f which minimizes

( rCl ) m: FI R,,:. I E F k

We shall call this method hill-climb future (because we use the inter-relations between the candidates and the future variables.)

An alternative approach is to use the inter-relations between the candidate and both the past variables and the future variables. The past variables are responsi- ble for reducing the domain of the candidate, and the inter-relations between the candidate and the future variables are a good estimate for reducing the domains

Page 18: Interactive scheduling as a constraint satisfiability problemgolumbic/papers/J27.pdf · INTERACTIVE SCHEDULING AS A CONSTRAINT SATISFIABILITY PROBLEM Ronen FELDMAN Department of Mathematics

66 R. Feldman, M.C. Golumbic /Interactive scheduling

of the future variables' domains. Thus, our second criterion, using both of these factors, is

mf,~A k-lU Ri,fiI~FkRi,f, which, in fact, does not depend on the partition of the variables into A g and F k, and thus reduces to

( FC2) mf I-I R,,y, 1~v-{f}

where V is the set of all variables. To use this method, we have to compute for each variable f ~ V the value of

(FC2) and sort the variables in increasing order of their results. This criterion therefore needs less computation effort than (FCI) . We shall call this approach the inter-relation algorithm or simply the IR algorithm.

5.7. C O M P A R I S O N B E T W E E N I N S T A N T I A T I O N O R D E R A L G O R I T H M S - E X P E R I M E N - T A L RESULTS

Experiments have been performed to investigate the performance of the various methodologies presented here. Our comparison between different al- gorithms for finding the optimal instantiation order of random SSPs is separated into two parts: backtracking algorithms and forward checking algorithms.

Three backtracking algorithms are compared: N The naive algorithm (increasing domain size). HC-p The hill-climbing algorithm with (BT) as the minimum criterion (hill-

climb past). IR The IR algorithm.

Five forward checking algorithm are compared: N The naive algorithm (increasing domain size). HC-f The hill-climbing algorithm with (FC1) as the minimum criterion (hill-

climb future). IR The IR algorithm. L1 The hill-climbing algorithm using level-1 criterion. L2 The hill-climbing algorithm using level-2 criterion.

Now we will describe the exact details of the experiments as performed for each of the two parts.

5. 7.1. The backtracking algorithms We generated sets of 30 randomly chosen courses and then applied each of the

three algorithms on the requirement g(Min, Min, List) with Min varying from 1 to 30. Having gotten the instantiation order according to each one of the algorithms, we activated the regular backtracking algorithm on each one of requirements (where the courses are ordered according to the order obtained

Page 19: Interactive scheduling as a constraint satisfiability problemgolumbic/papers/J27.pdf · INTERACTIVE SCHEDULING AS A CONSTRAINT SATISFIABILITY PROBLEM Ronen FELDMAN Department of Mathematics

R. Feldman, M.C. Golumbic / Interactive scheduling 67

6gl01

h i l l e l :

D n a i v e O IR

- p a s t

n u m b e r o f c o u r s e s ( f r o ~ 3 { ] )

Fig. 3. Ordering algorithms - regular backtracking.

before) and the number of instantiations was counted. Figure 3 shows the average results on a set of 1218 problems.

The conclusion drawn is that the hill-climb past algorithm is perhaps slightly better than the IR algorithm but both clearly outperform the naive algorithm, i.e.,

HC-p = IR < N.

The graph shows that there are problems where IR is better and problems where the hill-climbing past is better. The advantage of the IR algorithm is that it takes less time than the hill-climb past algorithm.

5. 7.2. The forward checking algorithms We have used the same method as we used for the backtracking algorithms but

the size of the sets was 20. This is because the level-1 and level-2 based algorithms are so memory consuming that when we tried to work with larger sets we got heap overflow. These algorithms proved to be very bad, not only because they need a lot of memory and a very long time to obtain the desired order but, as can be seen from fig. 4, the results themselves were very poor. In fact, we can order the algorithms by descending order of performance for 13 ~< Min ~< 20 (the best algorithm is first) as follows:

HC-f ~< IR < N < L1 < L2. In fig. 5 we can see a magnification of the results where Min is between 1 and 12. Here the difference in performance of the algorithms is much less significant but

Page 20: Interactive scheduling as a constraint satisfiability problemgolumbic/papers/J27.pdf · INTERACTIVE SCHEDULING AS A CONSTRAINT SATISFIABILITY PROBLEM Ronen FELDMAN Department of Mathematics

68 R. Feldman, M.C. Golumbic /Interactive scheduling

4200

'i G

A l e v e l - 2 A l e v e l - I D h i l l - c l i M J ~ s II n a i v e

0 IR

n u H b e r os c o u r s e s t o be s c h e J u l e d ( 2 8 p o s s i ~ ) | ~ )

Fig. 4. Ordering algoritluus - forward c h ~ l ~ g .

2~

3oe_~

.~ l e v e l - 2 A l e v e l - . t / [J }ti 1 l - c ] i,'~b f u t u r e | n a i v e ~ , ~ - ~ - ~

I I I I I I I I I l ~ ,

n u m b e r o f c o u r s e s t o be s c h e d u l e J ( 2 0 p o s s i b l e )

Fig. 5. Ordering algorithms - forward checking.

Page 21: Interactive scheduling as a constraint satisfiability problemgolumbic/papers/J27.pdf · INTERACTIVE SCHEDULING AS A CONSTRAINT SATISFIABILITY PROBLEM Ronen FELDMAN Department of Mathematics

R. Feldman, M.C. Golumbic / Interactive scheduling 69

J

~J

c- o

n a i v e

[7 A h i l l c l i . ~ - f u t u r e

O I R

nu~bez" o f c o u r s e s ( f r o M 30)

Fig. 6. Ordering algorithms - forward checking.

7%

0

0 e

C 0

t~ h i l l c l i ~ - f u t u r e

D n ~ i v e O I R

I I I I I I I I I I I I I I I 1 6

number o f c o u ~ , s e s ( f r o ~ 30 )

Fig. 7. Ordering algorithms - forward checking.

Page 22: Interactive scheduling as a constraint satisfiability problemgolumbic/papers/J27.pdf · INTERACTIVE SCHEDULING AS A CONSTRAINT SATISFIABILITY PROBLEM Ronen FELDMAN Department of Mathematics

70 R. Feldman, M.C. Golumbic /Interactive schedufing

does give a different ordering:

IR ~< HC-f < L2 < L1 -- N.

Finally, in order to check the performance on larger sets of up to 30 courses, we ran another experiment only with the three algorithms IR, Hill-climb future, and Naive. The results are shown in fig. 6 and suggest that the performance order of the algorithms for larger values is:

HC-f < IR < N,

where here Hill-climb future significantly beats IR. In fig. 7 we see a magnifica- tion of the results when Min is between 1 and 16, showing a slight preference for the order:

IR < HC-f < N.

6. Conclusions

In this paper, we have demonstrated the suitability of the CSP model for use in the student scheduling problem. We have investigated several aspects of the SSP and for each we have determined the algorithm with the best performance. Our conclusions are as follows.

For finding a solution to an SSP having only binary constraints, the best algorithm was the word-wise forward checking algorithm which made extensive use of the parallel bit handling capability of the computer, which is consistent with [8]. For determining the best instantiation order, the best backtracking algorithm was the hill-climbing past algorithm although the IR algorithm was very close in performance. Among the forward checking algorithms, hill-climbing future performed the best.

An idea similar to that of the instantiation order affecting the performance is found in [11,12], in which algorithms for optimal and semi-optimal invasion order are introduced and tested experimentally.

Topics for future investigation: (1) All the methods for finding the best instantiation order were based on the

fact that only binary constraints are involved. It is important to enhance these methods so that they can deal with non-binary constraints as well.

(2) The methods for finding the best instantiation order were global (i.e., once at the preprocessing phase). It would be interesting to investigate if it is cost-effective to determine the best order after each instantiation.

(3) It seems that the methods developed for the SSP may be appropriate for other kinds of problems that can be viewed as CSPs. Therefore, it would be interesting to check how well these methods apply to such problems, for example, time-table construction.

Page 23: Interactive scheduling as a constraint satisfiability problemgolumbic/papers/J27.pdf · INTERACTIVE SCHEDULING AS A CONSTRAINT SATISFIABILITY PROBLEM Ronen FELDMAN Department of Mathematics

R. Feldman, M. C. Golumbic / Interactive scheduling 71

Appendix

This appendix contains the three primary procedures, select, update, and validate, for the forward checking algorithm specially adapted to the SSP. (1) The selecting procedure (forward checking):

procedure FORWARD_ SELECT_ COURSE(Requirements): Candidate_list <--- ~; for G ~ Requirements where G = g(Min,Max,List)) do

if Min > 0 then do C ~ first course from List; Rest ~ the other courses from List; if dom size(C) = 1 return(C); else Candidate_list ~ Candidate_list u {C};

end end if Candidate_ list 4: cp then

return (the course in Candidate_list with minimum domain size); al l_min_were_0:

for G ~ Requirements where G = g(Min,Max,List)) do if Max > 0 then

goto copy_ max_ to_ min; end return("no more courses");

copy_ max_ to_ min: for G ~ Requirements where G = g(Min,Max,List)) do

replace G by g(Max,0,List); end return (the new requirements);

end FORWARD_ SELECT_ COURSE;

(2) The update procedure (forward checking):

procedure UPDATE_REQUIREMENTS(Requirements) : for G ~ Requirements where G = g(Min,Max,List)) do

for C ~ List do update_course_domain(C);

end / * Update all the courses-domains in List according to the last instantiation made. After the update operation has taken place, the domain of the course is consistent with the current instantiations. If after activating the update procedure on any course its domain becomes empty, then remove that course from List. * /

if listlen(List) < Min then fail;

Page 24: Interactive scheduling as a constraint satisfiability problemgolumbic/papers/J27.pdf · INTERACTIVE SCHEDULING AS A CONSTRAINT SATISFIABILITY PROBLEM Ronen FELDMAN Department of Mathematics

72 R. Feldman, M.C. Golumbic /Interactive scheduling

/ * If after activating the update procedure on all the courses of G we are left with too few courses (less than the minimum), then we cannot satisfy this requirement. Therefore, we have to backtrack and uninstantiate the last course that was instantiated. * /

sort_list(List) / * Sort the courses in List according to their domain sizes in ascending order or according to any of the other criteria. * /

end end UPDATE_ REQUIREMENTS;

(3) The validate procedure (forward checking):

procedure VALIDATE(Requirements): for G ~ Requirements where G --- g(Min,Max,List)) do

if Min > 0 and Max > 0 then return(false);

else return(true);

end end VALIDATE;

References

[1] J.R. Bitner and E.M. Reingold, Backtrack programming techniques, Comm. ACM 18 (1975) 651-655.

[2] M. Bruynooge, Solving combinatorial search problems by intelligent backtracking, Infor. Process. Lett. 12 (1981).

[3] R. Feldman and M.C. Golumbic, Optimization algorithms for scheduling via constraint satisfiability, IBM Israel Technical Report (Jan. 1989), submitted for publication.

[4] E.C. Freuder, Synthesizing constraint expressions, Comm. ACM 21 (1978) 958-965. [5] M.C. Golumbic, Knowledge-based techniques in an academic environment, Proc. Int. Conf. on

Courseware and Design and Evaluation, Symp. on Artificial Intelligence and Education, Ramat Gan, Israel (April 1986) pp. 355-362.

[6] M.C. Golumbic, M. Markovich, S. Tsur and U.J. Schild, A knowledge-based expert system for student advising, IEEE Trans. Education E-29 (1986) 120-124.

[7] M.C. Golumbic, M. Markovich and M. Tiomkin, A knowledge representation language for university requirements, Decision Support Systems 6 (1990).

[8] R.M. Haralick and G.L. Elliot, Increasing tree search efficiency for constraint satisfaction problems, Artificial Intelligence 14 (1980) 263-313.

[9] A.K. Mackworth, Consistency in networks of relations, Artificial Intelligence 8 (1977) 99-118. [10] U. Montanari, Networks of constraints: Fundamental properties and applications to picture

processing, Information Science 7 (1974) 95-132. [11] S. Nishihara and K. Ikeda, A solution algorithm for the consistent labeling problem using the

structure of constraints, Proc. 8th IEEE Int. Conf. on Pattern Recognition, Paris (1986) pp. 198-200.

Page 25: Interactive scheduling as a constraint satisfiability problemgolumbic/papers/J27.pdf · INTERACTIVE SCHEDULING AS A CONSTRAINT SATISFIABILITY PROBLEM Ronen FELDMAN Department of Mathematics

R. Feldman, M.C. Golumbic /Interactioe scheduling 73

[12] S. Nishihara, Y. Matsuo and K. Ikeda, Optimization and performance evaluation of inexact consistent labeling problem using merge method, J. Jpn. Soc. Artificial Intelligence (1988) 196-205.

[13] B. Nudel, Consistent-labeling problems and their algorithms: expected-complexities and the- ory-based heuristics, Artificial Intelligence 21 (1983) 135-178.

[14] P.W. Purdom, Search rearrangement backtracking and polynomial average time, Artificial Intelligence 21 (1983) 117-133.