Professional Documents
Culture Documents
Satisfaction Problem
Juan Jose Blanco and Lina Khatib
Florida Institute of Technology
Melbourne, FL 32901
email:fjblanco,linag@cs.t.edu
Abstract
This paper describes a scheduling system to fulll the timetabling needs of the Computer
Science program at Florida Institute of Technology. The system handles both general
constraints of timetabling problems and constraints specic to our problem. It has
the
exibility of allowing for either manual or automatic assignments. The scheduling
process is split into two phases; each phase is modeled as a CSP. The rst phase tackles
resource allocation which is, in our case, the problem of assigning faculty to courses.
The second phase tackles the problem of assigning consistent time slots to courses.
Optimization techniques are used in both phases. The rst phase optimizes faculty
assignment to courses in terms of faculty preferences. The second phase optimizes time
slot assignment in terms of dierences with previous term. The main goal of the system
is to provide high quality timetables to the Computer Science program with as little
delay as possible. This goal was fullled as experiments on real data showed that ideal
solutions are generally obtained in a few seconds.
1 Introduction
The construction of course timetables for universities or other schools can be an extremely complex
problem whose diculty grows exponentially with its size. A manual solution typically requires
much eort (from hours to days depending on the dimension of the timetable and the number of
restrictions in the domain). It is a process that involves numerous reformulations of the problem's
settings in order to nd a \compromise" solution. The work described in this paper aims to auto-
mate the timetabling needs of the Computer Science program at Florida Institute of Technology.
The problem instance constitutes one in which both general and specic constraints need to be
handled eciently with as much
exibility as possible. The many features that are, typically, left
out by other timetabling systems, in order to decrease complexity, are managed successfully in this
system. Some of these features are:
Faculty preferences for courses, as well as times, are taken into consideration.
Sophisticated types of preferences are supported such as a preference to have temporal gaps
between courses.
Courses can be constrained to not be scheduled at the same time.
Choices between manual pre-setting or automatic assignments are provided. These assign-
ments include
{ assigning a faculty to a certain course.
{ assigning a time slot to a certain course.
General and domain-specic heuristics are applied to speed up the process and provide higher
quality solutions.
The scheduling is split into two phases; each phase is modeled as a CSP. The rst CSP tackles
resource allocation which consists of assigning faculty to courses. The second CSP tackles the
problem of assigning consistent time slots to courses. This allows for a complex problem to be
decomposed into two simpler ones. Optimization techniques are used in both phases. The rst
phase optimizes faculty assignment to courses in terms of faculty preferences. The second phase
optimizes time slot assignment in terms of discrepancies over the previous term. The rst phase
optimization criteria are general but the second phase optimization criteria are problem specic
and related to the university's procedure for classroom assignment.
The main goal of the project is to provide high quality timetables to the Computer Science
program with as little delay as possible. This goal was fullled as experiments on real data showed
that ideal solutions are generally obtained in a few seconds. More specically, averaged over several
trial cases, with the number of faculty between 10 and 12, and the number of courses between 40
and 50, the rst phase took less than a second and the second phase took 10 to 15 seconds.
The rest of this paper is organized as follows. Section 2 denes the timetabling problem as CSP.
Section 3 is a detailed description of our course scheduling system. Section 4 closes this paper with
a conclusion and discussion of future work.
2 Background
A Constraint Satisfaction Problem (CSP) is composed of a nite set of variables, each of which is
associated with a nite domain, and a set of constraints that restrict the values that the variables can
simultaneously take. The task is to assign a value to each variable in the problem satisfying all the
constraints. Variation of algorithms have been devised to deal eciently with CSPs encompassing
a broad eld of solving methods. For more details the reader is referred to [4], [5], [6], [8], and [9].
One instance of timetabling problem is the problem of scheduling courses in an educational
institution. In general, one must assign instructors to courses, and then assign courses to classrooms
and time slots. The objective is to obtain a timetable of courses-professors-classrooms-times over
a prexed period (typically a week), satisfying a set of constraints of various types. The manual
solution of the timetabling problem usually requires several days of work. In addition, the solution
obtained may be unsatisfactory due to limited human oversight. For example, students may not
be allowed to take the courses they want (or need) because they are scheduled at the same time.
For this reason, considerable attention has been devoted to automated timetabling and, over the
last thirty years, many papers related to automated timetabling have appeared in conferences and
journals [7].
Most of the early techniques for solving the timetabling problem were based on simulation of the
human way of solving the problem. All such techniques were based on a successive augmentation,
that is, a partial timetable is extended, course by course, until all the courses have been scheduled.
They are simple search procedures based on backtracking and in heuristics such as scheduling the
most constrained course rst. Later on, researchers started applying general techniques (mainly
borrowed from Operations Research) to this problem, which has led to timetabling algorithms based
on mathematical approaches such as integer programming or network
ow, as well as reduction to
graph coloring. More recently, approaches based on search techniques used in Articial Intelligence
appeared in the literature. These include simulated annealing, tabu search, genetic algorithms, and
in general constraint-guided search algorithms [7]. The timetabling process consists of two distinct
phases [3]
The curriculum, i.e. a list of courses oered for a specic term, is dened and various resources
(typically professors and classrooms) are assigned to them.
A detailed timetable is composed which is compatible with the previously dened requirements
and with additional constraints as well.
The complexity of the second phase has led to eorts in solving it automatically instead of manually.
On the other hand, not much attention has been paid to automating the rst phase even though, for
many institutions, obtaining coherent or \fair" resource assignments may be a demanding challenge.
The timetabling problem is formulated either as a feasibility problem, where a single feasible
solution is required, or as an optimality problem, where the optimum solution according to an
objective function is sought. Timetabling problems are easily mapped into CSPs. The general
task in timetabling is to assign resources (professors, and sometimes also classrooms) to all courses
oered in a given term, and then to assign times to those courses. In our scheduling system, both
phases of the timetabling problem were tackled, and both were modeled as a CSP in order to apply
systematic CSOP (Constraint Satisfaction Optimization Problems) techniques to solve them.
Undergraduate courses can be scheduled at any valid time slot, but graduate courses, as well
as undergraduate courses that meet with graduate courses, can only be scheduled in the late
afternoon and evening.
Faculty preferences have to be satised. This includes the time range they specify for their
courses and the possible need for breaks between classes.
Courses that are correlated cannot be scheduled at the same time. This includes courses that
are usually taken by the same students (e.g. senior required courses).
The goal of this phase is to obtain a valid schedule, i.e. an assignment of time slots to courses that
satises all the constraints. The number of valid timetables, in the absence of inconsistencies, is
very large. Hence, the result is improved by introducing a goodness function. The idea is that a
given schedule is better than another if it is closer to the previous corresponding term schedule.
Therefore, CSOP techniques are again used to optimize the timetable in relation to an objective
function.
Once the solution to the rst phase is accepted, the system compiles all the courses that are
not TBA (To Be Assigned, i.e. courses for which a professor has not been assigned, due to the lack
of faculty and/or insucient work loads) and begins the process of assigning times to them. The
rst step in the procedure is time preferences consistency checking, a preprocessing of faculty time
preferences to make sure there is no initial inconsistency. Each faculty species their preferred time
slots as well as their wishes in having temporal gaps (breaks) between classes. Sometimes, there
are inconsistencies in the specication, such as specifying only 3 time slots as preferences with gaps
between classes while the work load is 3 courses.
Stage 1: Consistency checking
At this stage, the system determines if the specied time slots for each professor allow for
sucient slot expansion, where these are dened as follows.
Denition 1 A slot expansion for a set of time slots is the maximum number of courses
that can be scheduled in these time slots taking into consideration overlaps of time slots, gaps
between classes, and constraints on time range of courses.
Denition 2 Sucient slot expansion. A set of time slots S has a sucient slot expansion
for a faculty F if the work load of F is no more than the slot expansion of S taking into
consideration F 's preference for gaps between classes and the constraints on courses assigned
to F .
In other words, this stage detects if nding times for a specic professor's courses is impossible
with the current preferences of the faculty member. For a professor's preferences to pass this
consistency phase, the time preferences have to satisfy the inequality
slot expansion course load
In case a faculty member does not satisfy this condition, the system noties the user that the
faculty's time preferences need to be relaxed. Otherwise, the second stage starts.
Stage 2: assigning time to courses
At this stage, each course is assigned a time slot that satises faculty time preferences, course
correlation restrictions, and general constraints. Also, the assignment should be as close as
possible to the previous corresponding term schedule.
Denition 3 A slot usage is the number of courses scheduled at each time slot.
Slot overuse occurs when more courses are assigned than was assigned for the same slot in
the previous term.
The system reads the reference (history) le and obtains a table of slot usage for the reference
term. A systematic constraint satisfaction method is applied to search through the space of
schedules, coupled with branch and bound to optimize the solution in terms of the number
of changes from the reference timetable. The variables of the problem are the courses. Each
course has to be assigned a time slot which has to be consistent with previously assigned ones
and with all the constraints. The procedure is initially called to start with the rst course in
the list. At each step of the procedure, a time slot is considered for the given course. The
overuse, if any, that would occur if the course is assigned the current slot is added to the
accumulated overuse, and at this point the search continues or is bounded. If the overuse
accumulated is larger than the minimal total overuse obtained in a previous solution, then
that branch of the search space can be pruned. The optimal solution obtained is one with a
minimum slot overuse.
Undergraduate courses rst Graduate courses rst
Day time slots rst 15 minutes 10 seconds
Evening time slots rst 16 minutes 15 seconds
Using branch and bound as the optimization technique once again reduces greatly the comput-
ing time needed to obtain the optimal solution. On the average, the rst solution is displayed
in less than one second while the optimal solution is displayed after about 10 seconds. This
is the average of several runs on real data with 10-12 faculty and 40-50 courses with various
constraints. Also, we applied some heuristics related to variable and value ordering that are
explained in the \Heuristic" section below. We choose to display the rst solution to insure
the user that a solution exists while waiting for the optimal solution.
3.3 Heuristics
Initially, the system processed courses in the order in which they appeared in the input le. This
order is based on the course number where undergraduate courses has lower numbers than graduate
courses. However, since graduate courses have a smaller range of time slots at which they can be
scheduled, tests were performed where the system orders the list of courses to place graduate ones
at the top of the list, hence applying the variable ordering heuristic of most-constrained-rst. It
was found that by scheduling the most constrained courses rst, the search space is pruned much
quicker since most inconsistencies arise during the rst nodes of the search tree, which results in
huge performance gains (see Table 1).
Value ordering was also tested in a similar way. Evening time slots, in our domain, have
more demands than day time slots. This is because graduate courses, which equals in number to
undergraduate courses, are restricted to evening slots which are less than day slots. Experiments
were conducted by considering the most con
ict-prone values rst, but the response of the system
was actually very similar in both cases of value ordering. Results of tests executed with 10 faculty
40 courses, and 32 time slots (among which 9 are evening slots), are shown in Table 1.
A dierent approach to value ordering was also tested for the purpose of enhancing the output.
Several instances of the problem's solution space could be scored the same by our optimization
function, and the search algorithm would output the rst of those encountered (which serves as
a limit for bounding the search). Hence, we enforced an ordering on the time slots such that the
most preferred one is chosen rst. This will guarantee that the output from the set of optimal
solutions is the one with the most preferred slots (usually, most faculty prefer slots that are around
the middle of the day or early evening).
4 Conclusions
The system presented in this paper exhibits several dierences with timetabling programs from the
literature. In our system, time slots can be considered as a collection of meetings for a course over
a week, where each of those individual meetings is often referred to in the literature as a lecture [7].
By grouping weekly lectures of courses into time slots, the system not only resolves the so called
multiple sections problem, but we have also reduced the size of the domain while including the
common constraint that all lectures of a given course should be taught at the same time and evenly
distributed during the week.
While many other timetabling programs leave out some features to decrease complexity, our
system is able to manage many objectives successfully. Non-standard characteristics of timetabling
systems that are all considered in our course scheduling program are:
Division of the problem into two easier to tackle, relatively independent, phases.
Presence of constraints associated with correlated courses (referred to as the grouping sub-
problem in the literature).
The
exibility of xing a course to a specic faculty or a specic time slot.
Future work includes investigating more elaborate techniques that will allow the system to scale
to larger domains. This includes employing advanced systematic search algorithms [6] coupled with
branch and bound, and constraint relaxation techniques (currently, all the constraints are hard,
so overconstrained problems must be handled by manually relaxing constraints). A web-based
interface to the database is under development. When completed, faculty will have access to their
own records to be able to update them remotely with ease. Other possible enhancements to the
system include providing helpful explanations of inconsistencies, adding schemes to insure proper
rotation of faculty to courses, and
exible adjustments to faculty preferences.
References
[1] Stephen Beale, 1997. Using branch-and-bound with constraint satisfaction in optimization
problems. In Proceedings of AAAI-97, pp. 209-214
[2] J. J. Blanco, 1997. Constraint-Based Course Scheduling. M.S. Thesis, Computer Science,
Florida Institute of Technology.
[3] D. de Werra, 1985. An introduction to timetabling. European Journal of Operational Research,
vol. 19, pp. 151-162.
[4] S. Minton, M. Johnston, A. Philips, and P. Laird, 1992. Minimizing con
icts: a heuristic repair
method for constraint satisfaction and scheduling problems. Articial Intelligence, vol. 58, pp.
161-206.
[5] B. Nadel, 1988. Tree search and arc consistency in constraint satisfaction algorithms. Chapter
9 in Search in Articial Intelligence, edited by L. Kanal and V. Kumar, Springer.
[6] P. Prosser, 1993. Hybrid algorithms for the constraint satisfaction problem. Computational
Intelligence, vol. 9, no. 3, pp. 268-299.
[7] A. Schaerf, 1995. A survey of automated timetabling. Technical report CS-R9567, CWI, Am-
sterdam, The Netherlands. Available at http://www.cwi.nl/ftp/CWIreports/AP.
[8] A. Schaerf, 1996. Tabu search techniques for large high-school timetabling problems. In Pro-
ceedings of AAAI-96, pp. 363-368.
[9] E. Tsang, 1993. Foundations of constraint satisfaction. Ed. Academic Press, New York.
[10] Mark Wallace, 1996. Practical applications of constraint programming. In Constraints, an
international journal, 1, 139-168.