A Large Scale Timetabling Problem: and Jacques
A Large Scale Timetabling Problem: and Jacques
00
Printed in Great Britain. All rights reserved Copyright 0 1989 Pergamon Press plc
Scope and P-The purpose of this paper is to specify an approach capable of dealing with large
scale timetabling problems. As in the approach used by practitioners to handle the problem manually,
two dierent com~nents are analyzed sequentially: a timetabling is generated and students are assigned
to course sections. The timetable is derived taking into account student registrations and classroom
availabilities. The objective is to reduce the number of conflicts where lectures taking place simultaneously
have common students OKlecturers, or require the same classroom. The two components are strongly
interrelated since the assignment of students to sections influences the timetable derivation, and vice-versa,
the timetable influences the assignment of students to sections. The computerized approach iterates to
modify successively the timetable and the assignment until the heuristic procedures used to deal with the
subproblems can no longer improve the objective. The proper scope of these results is to use the approach
within a decision support system providing interactive functions to analyze closely the solution generated
and to modify it into the most suitable solution.
Abstract-This problem has two main components. In the timtab~ing subproblem a master timetable is
derived taking into account student registrations and lecturer and classroom availabilities. The grouping
subproblem specifies groups of students for large courses that have to be repeated several times during
the week. In this paper we propose an approach to handle both subproblems and to deal with their strong
relationship. The solution approach includes several heuristic procedures to handle the subproble~ which
are formulated as assignment type problems in which entities are assigned to resources by using penalty
terms for conflicts and excessive use of classrooms. Finally numerical results are also reported.
1. INTRODUCTION
The timetabling problem for large institutions is difficult because the model has to account for
individual student registration and lecturer and classroom availabilities. Furthermore, courses taken
by a large number of students have to be repeated several times during the week. Hence the
grouping of students into course sections needs to be carried out so as to create a timetable with
as few conflicts as possible. (We have a conflict whenever two lectures taking place simultaneously
have common students or lecturers, or require the same classroom.)
The problem involves two subproblems: the timetabling subproblem and the grouping sub-
problem. These have been analyzed separately by several authors. Many of the approaches for the
timetabling problem are summarized in de Gans [l] and Schmidt and Strohlein [2]. Bloomfield
and McSharry [3], Knauer [4], Almond [S], and Selim [6] propose heuristic procedures. Mulvey
[q suggests a network model, and Tripathy [8,93 uses Lagrangian relaxation to solve the
timetabling problem. Carlson and Nemhauser [lOJ, Davis et al. [ll], and Ferland and Roy [12]
formulate it as a problem of assigning conflicting activities to resources. On the other hand, the
grouping problem has been analyzed previously by Colijn [13], Winters Cl43 and Laporte and
Desroches [15].
The usual approach to solving the global problem where both subproblems are present is first
to generate a timetable and then to load the students into it to obtain the grouping. The iterative
procedure that we propose here is in this spirit. At each iteration both the timetable and the
grouping are adjusted:
(i) given the grouping generated during the preceding iteration, the timetable is modified to
reduce the number of conflicts;
*Jean Aubin is a Ph.D. student in the department of Informatique et Recherche Op&ationneIle at the Universit6 de
Mont&al. His research interests include linear stochastic optimization, resources allocation and scheduling, and transporta-
tion problems. He is also working at Urgences Sante as a staff member of the Operations Research Group.
tJacques A. Ferland is professor in the department of Informatique et Recherche Op6rationnelle at the Universith de
Mont&al. He received his Ph.D. in Operations Research and M.Sc. in Statistics from Stanford. He also obtained an MSc.
in Informatique and a B.Sc. in Mathematics from the Universitk de Mont&al. Hi main research interests include routing
and scheduling problems, transportation problems, large scale mathematical programming, and generalized convexity.
67
68 JEANAWINand JACQUES
A. FERLAND
(ii) with this new timetable, the grouping is modified to reduce the number of conflicts.
New exchange algo~thms well adapted to large problems are used to modify the timetable. The
procedure terminates when it cannot improve the solution.
This heuristic procedure generates a good solution that should be regarded as the initial one for
a user friendly decision support system providing interactive functions to analyze closely this
solution and to modify it. Such systems are outlined, for instance, in Ferland et al. [16], Glassey
and Mizrach [ 171, and Kassicieh et al. [IS].
In Section 2, a O-l programming model is introduced. It includes two assignment type
subproblems of entities to resources interacting through the objective function, One- of these
corresponds to the timetabling problem and the other to the grouping problem. Heuristic procedures
based on exchange techniques are used to deal with these problems. These developments are
included in Section 3, and the algorithms are presented in the Appendix. Finally numerical results
are reported, and remarks concerning current used and the context in which the approach should
be useful are included in the conclusion.
2. MATHEMATICAL MODEL
A mathematical formulation of the problem is now introduced. The model includes two main
components (the timetabling subproblem and the grouping subproblem) that interact via the
objective function. First, several concepts have to be specified to characterize the problem.
Each student s registers in a set of courses R,. Large courses in which numerous students are
registered are repeated several times during the week. Hence groups of students registered in such
a course w are determined (grouping subproblem), and a specific course section a EQ, is associated
with each group. Note that a course w which is not repeated includes only one section (i.e. IQ,+,/= 1).
Each course section includes a specified number of lectureseach week. The length of these lectures
is not uniform; some may last one hour, some two hours, etc. In the timetabling subproblem,
starting times have to be assigned to lectures.
The concept of a conflict between lectures must be introduced. Two lectures are said to be in
conflict if they are held (at least partly) simultaneously and
(i) they are given by the same lecturer, or
{ii) they require the same specific classroom (a specific laboratory which is unique, for instance),
Overlapping No overlapping
Fig. 1
constraints to eliminate all conflicts and to enforce upper bounds on the number of classrooms of
each type used during each teaching hour. This problem would be practically very difficult to solve.
Moreover, in many instances it is even doubtful that a feasible solution would exist. Indeed in
practice when dealing with the problem of a large administrative entity, it is common to require
that some students change their registration because “unsolvable” conflicts exist. For these two
reasons, we prefer to formulate the problem as an assignment problem of students to courses
sections and starting times to lectures where the objective is to reduce the number of conflicts and
utilization of classrooms exceeding their availabilities.
The model can be specified as follows
0) Availability cost:
flI(x) = i f cijxij
i=l j=l
where cij is the cost of starting lecture i atj specified in terms of the availability and preferences
of lecturer responsible for lecture i (cij = 0 if j is the most preferred starting time for i).
(ii) Cost for exceeding classrooms availabilities:
where
T is the number of teaching hours during the week,
B is the number of classroom types [excluding the singleton subset used to specify
conflicts of type (ii)],
&, is the number of classrooms of type b, 1 d b G B,
Kb, is the set of pairs (i, j) such that lecture i starts at j, lecture i requires a classroom
of type b and takes place during teaching hour t of the week.
70 JEAN AUBIN
and JACQUESA. FERLAND
f13(X) = i ,$ z $ $ bfklijlkXijXkl
I lj lk II 1
where
lijkr is the length of the conflict when lecture i starts at j and lecture k at 1.
6 = 1 if i and k require the same lecturer or the same specific classroom
ik
10 otherwise.
The component fi(x, Y) simply measures the number of conflicting hours for the students given
timetable x and grouping y. We will return to the specification of this function in the next section.
The scalars p, v, p are parameters to be specified by the user. They allow to give relative weights
to the different components of the objective function.
Finally, as a secondary objective for the grouping subproblem, we look for well balanced sections
for the same course (i.e. the number of students in each section of a course should be as equal as
possible).
3. SOLUTION APPROACH
Because the integer programming model (P) is defined in terms of independent constraints for
variables x and y which interact only at the level of the objective function, it seems interesting to
consider a solution procedure improving the objective by working successively on the timetabling
and the grouping subproblems until a stable solution (i.e. a solution that cannot be improved by
the procedure) is reached. In this approach each subproblem is solved successively keeping fixed
the value of the variables of the other subproblem. The procedure can be summarized by the
following algorithm:
Main algorithm
Step 0 (Initialisation)
Let x* and y* be a feasible solution of (P).
Let f* = f(x*, y*) and
possible = true
while possible do
Step 1 (Grouping subproblem)
Given x = x* determine an optimal solution (Y) of the
grouping subproblem
if f* < f(x*, J) then
possible = false
else
f* = .0x*, Y)
y*=jj
possible = true
Step 2 (Timetabling subproblem)
Given y = Y* determine an optimal solution X of the
timetabling subproblem
if f* < f(% y*)
possible = false
else
i; I;(% Y*)
possible = true
end while.
This procedure is related to the notion of projection as defined in Geoffrion [20]. Indeed, in
A large scale timetabling problem 71
Step 1 projection is carried out on the space of the x-variables whereas in Step 2, it is carried out
on the space of the y-variables. Furthermore, this procedure is heuristic in the sense that it does
not necessarily converge to an optimal solution. On the other hand, this integer programming
problem (P) is not likely to be solved exactly in an acceptable computer time, and hence such a
heuristic procedure, if it works, is appropriate.
In the next sections, the subproblems are analyzed as assignment type problems of entities to
resources where the objective is to reduce the number of conflicts. In this context, the preceding
approach makes even more sense since it can be viewed as an overall procedure to reduce the
number of conflicts by modifying successively the master-timetable and the grouping of students.
This type of approach can be used whenever the variables of the model can be partitioned into
subsets (having their specific constraints) interacting only through the objective function. Hence
the model can be optimized successively for each subset of variables keeping the others fixed until
an equilibrium is attained where the objective cannot be improved anymore. Such models are
illustrated in multicommodity flow problems where arc-capacities are included into the objective
via penalty terms for exceeding them. The classical traffic assignment problem where the objective
is specified in terms of arc-congestion costs is another example of such a model where this
methodology can be used.
and
y{k(Y*) is the number of students following both lectures i and k given the grouping y*.
The model can be rewritten as
Min i
i-1
5
j=l
cijxij + k
k
g
II
z
1
pijklxijxk1-b p :
b=l
f
r=l
Max 1
WkKbt
Xij - IJ,
II
(MTA) subject to
t xij=l, l<i<n
j=l
ji (i.e. xii, = 1, 1 s i < n). It is easy to show that (see Ferland and Roy [12] and Lavoie [21]):
(rij - rij,)-p if there is a shortage of classrooms of the type required by lecture
i when it starts at ji
eij = (~ij- riji) + p if there is a shortage of classrooms of the type required by lecture i (3.5)
when it starts at j
( (rij - riji) otherwise
where
Furthermore, the entries in matrix E are also used to evaluate the savings of reassigning two
lectures simultaneously.
At each iteration of his procedure, Lavoie [21] completes the single reassignment of lecture i
inducing the largest reduction of the objective function when starting at j (i.e. eij < 0 is the smallest
entry of E). When the objective function can no longer be improved with single reassignments (i.e.
Min 1Qi6 “,i d jB n {eij} = 0) then the procedure may be pursued with double reassignments where
two lectures are reassigned. In practice double reassignments are seldom used because the computer
time required to evaluate the saving is large.
It follows from relations (3.6) that the matrix E is easily updated after reassignments of lectures
and this explains the efficiency of the approach for small scale problems. Unfortunately, the size
of the matrix E grows rapidly when the size of the problem increases, and, more importantly, the
computer time required to initialize it becomes prohibitive. Results in Ferland and Roy [12] indicate
that more than 25% of the overall solution time is required to initialize E for small problems, and
this percentage increases rapidly with the size of the problems. Hence we propose here a new
exchange procedure that does not require the use of a savings matrix E.
This new procedure relies on the observation that in fact, rij in (3.6) measures a cost of starting
lecture i at j specified in terms of the availability cost cij and the conflicts created by this assignment.
Furthermore, the savings eij in (3.5) include a term related to the upper bounds on the number of
classrooms available. Hence the new procedure scans the master-timetable to reduce the number
of conflicts first and then to reduce the availability costs and excess use of the classrooms. It can
be summarized as follows:
l During the first half of the procedure, all the resources (teaching hours) are scanned. If some
entities (lectures) are in conflict, all possible single exchanges are tried to reassign new starting
times to the entities and eventually eliminate the conflict.
l During the second half, new exchanges are applied to reduced availability costs of entities
to resources and the excessive use of classrooms.
A detailed version of the procedure is given in the Appendix.
It is easy to see that (GA) can be decomposed into S independent problems, one for each student
(GA), subject to
WER,
y,,=O or 1, l<U<A.
The algorithm to solve (GA) deals with each subproblem (GA), individually for 1 d s < S.
Furthermore, to account for the secondary objective of balancing the sections, the algorithm tries
to redistribute as equally as possible the students among sections after the solution of each
subproblem (GA),.
The approach used to solve each subproblem (GA), is based on exchange procedure quite similar
to those in Section 3.1, combined with a simplified version of the branch-and-bound procedure
proposed by Laporte and Desroches [15]. A detailed version of the procedure is given in the
Appendix.
4. NUMERICAL RESULTS
The solution procedure was implemented in PASCAL on the CYBER 835 of the Computing
Center of the University of Montreal. Data from a large High School in Montreal were available
to test the procedure and to analyse the effect of modifying the values of different parameters.
4.1. The data
3300 (S) students are registered and each registration includes an average number of IRS1= 7
courses. More than 200 lecturers are available to teach.
The curriculum of the institution includes 250 courses generating A = 825 course sections. Most
of these require one or two lectures per week, but some require up to &e(5). This generates a
problem with more than n = loo0 lectures to be scheduled. Furthermore, each lecture lasts from
1 to 5 hours.
The institution has 85 classrooms available. They are partitioned into B = 5 types plus 30 specific
classrooms (singleton subset) used to specify conflicts of type (ii).
Each week includes T = 45 teaching hours generating m = 45 starting times.
4.2. Tests
This problem has been solved for different values of the parameters specified in Section 3. Recall
that in the timetabling model three different parameters were introduced:
p = penalty factor for conflicts of type (iii) due to students;
v = penalty factor for conflicts of type (i) and (ii) due to lecturers and specific classrooms;
p = penalty factor for excessive use of classrooms.
The quality of the solution is measured with respect to four different characteristics:
(i) Number of conflicts of type (iii) due to students
NCS = total number of hours during which students are scheduled to follow two lectures
simultaneously. (Note that if 3 students are scheduled to follow the same two lectures
simultaneously, then NCS is increased by 3.)
(ii) Number of conflicts of types (i) and (ii) due to lecturers and specific classrooms
NCPS = total number of hours during which conflicts of type (i) and (ii) last.
(iii) Distribution of students among sections
5. CONCLUDING REMARKS
The results reported in Section 4 are consistent with those obtained by Ferland and Roy [12]
for smaller problem with a similar technique. The problem analyzed numerically in Section 4 is
considered to be a large practical one. The CPU time required for its solution is quite reasonable,
specially when it is compared with the time needed to deal with it manually.
Two other versions of the procedure are running on VAX and SUN computers, respectively.
They are currently used in departments of two different universities and the results are consistent
Table 1
ReKlhl- Number *
CPU (s)
tion of NCS NCPS DIS Timetabling Grouping c
number Balanced Y P iteration Initial Final Initial Final LECDEP Initial Final NP algorithm algorithm Total s
x
1 Y 0.0001 /I 4 14918 65 118 50 50 6901.3 5945.3 10 2089.8 341.1 2430.9
k
2 Y s”r O.OwJIjl 4 14918 70 118 15 68 6901.3 5223.3 10 3117.4 339.2 3456.6
=.
3 Y 158 O.oool I( 4 14918 70 118 2 71 6901.3 4693.3 12 3040.1 342.1 3382.8
4 Y O.@_Mllp 3 14918 70 118 1 74 6901.3 4761.3 12 3111.9 282.7 3394.6 w
3Op i;
5 Y 30P 15P 3 14918 69 118 1 79 6901.3 4607.3 0 3161.2 285.5 3446.7
&
6 Y 3Op 15p 3 14918 70 118 1 79 6901.3 4751.3 0 2760.9 349 3109.9
7 N 4 22572 55 118 1 80 3095437 31875 0 2837.2 415.1 3252.3 fs
30/1 15p
e
8 N 3Op 158 3 22572 67 118 0 83 3095437 26043 0 4048.3 476.6 4524.9
a
Y: balanced initial grouping. &
J
N: unbalanced initial grouping.
76 JEAN AWN and JACQUESA. FERLAND
Table 2
: 152
14 21475.3
5427.3 158.1
63.6 148
84 20
IS 2162.8
589.1 635
3 70 5255.3 58.7 70 1S 365.5 0
4 70 5223.3 58.8
Problem characteristics: Y= S p; p = 0.0001 p; baianced initial grouping.
Total CPU = 3456.6 s.
NP = 10.
with those mentioned before. Hence all these instances concur to the robustness of the approach.
So far, the procedure has not been implemented on a micro~mputer. But the recent improvement
in processing speed could lead to a micro-version of the algorithm.
A user friendly decision support system for the timetabling operation is now being developed.
Besides providing functions to facilitate data handling (input and update), it allows manual
interventions during the process of generating the most suitable solution. The procedure presented
in this paper can be used to generate a starting solution. The results can be analyzed in detaiI by
using simple functions available in the system. Furthermore, when the starting solution meets most
requirements, the user can even improve it interactively in order to take into account some additional
constraints.
Acknowledgement-This research was supported by NSERC (Grant A8312) and FCAR (Grant 0899).
REFERENCES
1. 0. B. de Gans. A commuter timetablina- system
_ for secondary schools in the Netherlands. Eur. J. Opl Res. 7, 175-182
(1981). -
2. G. Schmidt and T. Strohlein, Time~bling construction-an annotated bibliography. Comput. .I. 23, 307-316 (1980).
3. S. D. Bloomfield and M. M. M&harry, Preferential course scheduling. Interface 9,24-31 (1979).
4. B. A. Knauer, Solution of timetable problem. Comput. Opns Res. 1, 3163-375 (1974).
5. D. M. Almond, A university faculty timetable. Comput. J. 12, 215-217 (1969).
6. S. M. Selim, An algorithm for producing course and lecturer timetables. Comput. Educ. 7, 101-107 (1983).
7. 3. M. Mulvey, A ~l~room/time assignment model. Eur. J. Opl Res. 9, 64-70 (1982).
8. A. Tripathy, A Lagrangian relaxation approach to course timetabling. J. Opl Res. Sot. 31, 599-603 (1980).
9. A. Tripathy, School timetabling-a case in large binary integer linear programming. Mgmt Sci. 30,1473-1489 (1984).
10. R. C. Carlson and G. L. Memhauser, Scheduling to minimize interaction cost. Opns Res. 14, 52-58 (1966).
11. F. E. Davis, M. D. Devine and R. P. Lutz, Scheduling activities among conflicting facilities to minimize conflict cost.
Murk. Pro@. 6224-228 (1974).
12. J. A. Ferland and S. Roy, Timetabling problem for university as assignment of activities to resources. Comput. Opns
Res. 12, 207-218 (1985).
13. A. Colijn, A sectioning algorithm. INFOR, pp. 210-225 (1973).
14. W. K. Winters, A scheduling algorithm for a computer assisted registration system. Communs Ass. comput. Mach. 14,
166-171 (1971).
15. G. Laporte and S. Desroches, The problem of assigning students to course section in a large engineering school. Comput.
Opns Res. 13,387-394 (1986).
16. J. A. Ferland, G. Babin and J. Aubin, A Course Scheduling System. Publication No. 590, Universitb de Montreal,
Canada (1986).
17. C. R.Glasseyand M. M~ach,Ad~isionsup~~systemforassigningc~~ses torooms. Inte@ces l&92-108 (1986).
18. S. K. Kassicieh, D. K. Burleson and R. J. Lievano, Design and implementation of a decision support system for
academic scheduling. In$ Mgmt 11, 57-64 (1986).
19. J. Aubin, Une approche heuristique pour la confection d’horaires de CEGEP. M-SC. thesis, Universite de Montreal,
Canada (1985).
20. A. M. Geoffrion, Elements of large scale mathematical programming. Mgm Sci. 16,652-691 (1970).
21. S. Lavoie, Probltme de confection d’horaire de cours au niveau d’un GECEP. M.Sc. report, Universite de Montreal,
Canada (1985).
22. M. C. Carter, A survey ofpractical application ofexamination timetablingalgorithms. Opns Res. 34,193-202 (1986).
APPENDIX
starting with the earliest one on Monday morning). Whenever a conflict is found, move to Step 2. If no
conflicts are found, move to Step 4.
Step 2 Let i, ji, k, j, be the indices such that
j&*)l&j~xsi,xtj~ >0
Determine j* and I* (1 d j*, I* <at) such that
ei,.= Min {e,,}, eki. = Min {s,}.
16&m l=ZlGm
If e,,’ < ekl0,and if eij. < 0, then lecture i starts at j*, and FLAG = 1.
If ek,. < ei,., and if e,,. < 0, then lecture k starts at I*, and FLAG = 1.
Step 3 Continue thescan.Ifaconflictisfound,move toStep2.Otherwise,ifFLAG = 1,thenFLAG = O,andrepeat Step 1.
Step 4 Initialize the scan of the current master-timetable. If for some lecture i, starting it at j, induces an assignment cost
ci,, >O or that the number of classrooms of the type required by lecture i is exceeded, move to Step 5.
Otherwise
Step 5 Determine j* such that
eij. = Min {eij}
1Clhm
Grouping algorithm
Step 0 Denote by y a feasible solution (grouping) for problem (GA). For 1 Q s < S and all w E R,, denote aswe QW the
section of course w to which student s belongs (i.e y_.,, = 1). Let s = 1.
Step 1 (Single reassignment)
For each wER,, if N,_>O,
(i) determine a* E Qu such that N,,. = Mitt,,_ {N,}
(ii) arw = a*.
Step 2 (Double reassignment)
For each w E R,, if Nasv > 0,
(i) determine a* E QW, u* E R, and b* E Q,. such that
NNsv..v.b. = Min {NN,,&
UGQ”,
“ER,
kQ.