Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
17 views10 pages

Reesearch Paper On TMS

Uploaded by

vbdtcc5hdm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views10 pages

Reesearch Paper On TMS

Uploaded by

vbdtcc5hdm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

An algorithm for constructing University timetables

By Mary Almonds
This paper gives details of a simple heuristic approach to the University timetable problem.
The method is used to construct a timetable for one department and an integrated timetable for
all departments in a Science Faculty.

Scheduling lectures is tedious and frustrating work, and


the problem of applying computers to this task is cur-
rently being investigated in many countries. Several of
the published reports discuss theoretical solutions only

Downloaded from https://academic.oup.com/comjnl/article/8/4/331/400750 by guest on 15 April 2022


(Gotlieb, 1963; Csima and Gotlieb, 1963; Sherman 1963).
Other authors have achieved some practical success in
constructing school or University class timetables
(Appleby, Blake and Newman, 1961) in preparing
examination tables (Broder, 1964; Cole, 1964) and in
assigning students to sections of a class according to a
previously prepared timetable (Bossert and Harmon,
1963).
This paper describes algorithms for a heuristic
approach starting with a blank timetable and making
class-lecturer assignments so as to satisfy complex Fig. 1
conditions. Two problems have been considered:
(a) a timetable for one department in which courses Input
for each class are fixed; and Initially the matrices in faces 1 and 2 contain input
(b) a timetable for a whole faculty in which courses data. The Initial Class Requirements matrix gives the
offered by different departments may be combined total number of hours each lecturer is to meet each class.
in various ways to suit individual students. The Initial Lecturer Availability matrix has entries true
The algorithms have been written in ALGOL 60 and when a member of staff is lecturing to another depart-
used on the University of London Atlas computer. ment or has a free day. These two matrices are dupli-
The resulting timetables will be used in the Mathematics cated in the Current Requirements matrix and the
Department and the Science Faculty at Queen Mary Current Lecturer Availability matrix which can be
College, University of London. repeatedly updated as the timetable is constructed.

PROBLEM (a): Timetable for one department Output


Statement of the Problem The matrix in face 3 is at first a null matrix, and
finally it contains the completed timetable. It is printed
Given a set of lecturers, a set of classes and a Class
in its existing form using a write-text procedure for
Requirements matrix with integer elements representing
the number of hours lecturer (/) is to meet class (c) lecturers' names.
during each week, the problem is to allocate times (?)
to these hours satisfying certain given conditions. Hence A Igorithm
there are 3 variables, /, c, t and it is convenient to think The method for solution is to consider the entries in
of assignments being made in a 3-dimensional Boolean the Requirements matrix one-by-one and allocate to
array as shown in Fig. 1. The algorithm uses the three each a suitable lecture hour. When an allocation has
2-dimensional arrays which form the three rectangular been made at time t for class i and lecturer /, then one
faces of this brick. Face 1 is the Class Requirements is subtracted from the integer in row c and column / of
matrix. Face 2 is of dimensions (lecturer) x (time) the Current Requirements matrix, the Current Lecturer
and is called the Lecturer Availability matrix. It is a Availability matrix is marked true at row / and column t
Boolean matrix whose coefficients are false for hours and the value of / is inserted at a point on the cth row
when the lecturer is free and true for hours when he and rth column of the Timetable matrix. This process
is unavailable. The Timetable, face 3, is an integer is illustrated in Fig. 2. In general the solution will not
matrix of size (class) x (time) whose coefficient in row c be unique, and different versions of the timetable may
and column / will be the name of the lecturer / meeting be obtained by scanning the Requirements matrix in
class c at time t. different directions. If any allocation fails certain con-

* Mathematics Department, Queen Mary College, Mile End Road, London, E.\.
331
Timetables
Table 1
timetable: for c : = 1 step 1 until total classes do
for « := 1 step 1 until number of hours do
begin allocate one lecture;
if fail then
begin alter conditions;
copy initial matrices;
goto timetable
end
end;

Downloaded from https://academic.oup.com/comjnl/article/8/4/331/400750 by guest on 15 April 2022


exercise class is being allocated it may use the same hour
as a previous exercise class provided that the lecturers
involved are available.
ditions are changed, the Timetable is wiped clean and
the whole process is restarted from the initial conditions. (ii) The alter conditions procedure which is called in
The ALGOL version of the program is given in Table 1. when an allocation fails carries out a series of manoeuvres
in an attempt to find a solution. First the classes are
Three predeclared procedures allocate one lecture, reordered so that the one proving difficult will be
alter conditions and copy initial matrices are used. inserted in a blank timetable. If this is unsuccessful the
lecturer whose hour cannot be allocated is given a
(/) The allocate procedure (see Fig. 3), searches for a different free day. Finally if all free days prove impos-
suitable lecture time avoiding the hours already filled and sible the lecturer will have his extra free hours removed,
satisfying any desired conditions. For example the or he may have to give three consecutive lectures. If
results illustrated in Tables 2 and 3 meet the following this fails the procedure prints a postmortem and brings
conditions. the program to a halt.
(a) Several lecturers take classes at fixed times in (iii) After an alteration in conditions the Initial
other departments or faculties. Requirements and Initial Lecturer Availability matrices
(b) All members of staff have one free day each week. are recopied into the Current Requirements and Current
(c) Senior members of staff do not like 9.30 a.m. Lecturer Availability matrices, and the timetable matrix
lectures. is made null. The allocation procedure is then re-entered.
{d) Lecturers may ask for extra free hours which will
be allowed if possible. Result
(e) A lecturer should not meet the same under- Timetables produced by this program are shown in
graduate class twice in any half day, but he might Tables 2 and 3. The program was contained in 32
meet a class in both the morning and afternoon of 512-word blocks on the Atlas computer. Compilation
one day. took approximately 9 seconds and execution for these
(/) Lectures to postgraduate classes last for two conse- examples took about 1\ seconds.
cutive hours and should begin at 10.30 a.m. or Execution time will vary considerably with the diffi-
2.30 p.m. culty of finding a solution. When the alter conditions
(g) Undergraduates have no lectures on Wednesday procedure was not needed times of 5 to 8 seconds were
afternoons. taken, and each additional attempt took approximately
(hi) If possible, no-one should be asked to lecture for 2 extra seconds. A few seconds would be saved if the
three consecutive hours. Timetable were printed in terms of lecturer's numbers
(/) All lectures should be given in the morning in rather than names.
preference to the afternoon.
(j) The classes are split into two or three groups for PROBLEM (b): Timetable for the Faculty
exercises.
Statement of the problem
To meet conditions (o), (b), (c), (d) appropriate entries Given a set of lecturers, a set of courses on individual
true must be made in the Initial Lecturer Availability topics and a Course Requirements matrix with integer
matrix. The allocation will then avoid these hours. elements representing the number of hours lecturer (/)
Conditions (e), (/), (g), (//) are satisfied by a series of meets course (c) during each week, the problem is to
tests in the allocation procedure. The hours of the week allocate times (t) to these hours so that a student may
are numbered in such a way that the mornings are take as many suitable combinations of courses as possible.
always filled first, i.e., numbers 1 to 5 for the first hours As before the assignments are made in a 3-dimensional
of the mornings Monday to Friday, numbers 6 to 10 array, see Fig. 4. Side c is now of length corresponding
for the second hours of the day, and so on. When an to the total number of courses. Again the algorithm
332
Timetables

enter

Is there a lecture F
to allocate ?

T
\ 1

1 st time

Downloaded from https://academic.oup.com/comjnl/article/8/4/331/400750 by guest on 15 April 2022


Have all times been T
fail: = true
tried ?

F
i

T Is this a 3rd
consecutive lecture p

F I
__J
^ T Is this a F
postgraduate class p
\
Is the time suitable p F T Is this Wed. pm ?

T F
1 }

Is lecturer free F F
Is lecturer free ?
for 2 hours p

T T
I

Is class free F F
Is class free p
for 2 hours ?

T T
r

T Has class had this


next time subject in same V2 dayp

r \ F
i

Fill in TT and CLA. Fill in TTa nd CLA.


Subtract 2fromCR. Subtract fromCR.

exit

Fig. 3

333
Timetables
Table 2
Timetable for the Mathematics Department, Version 1
CLASS Hill PHI PG

Monday
9.30 Thomas Carter King Shaw —
10.30 Fisher Exercises Hughes King Peters
11.30 Shaw Thomas Pratt — Peters
12.30 — — Rose — —
2.30 — — Pratt — Gray
3.30 — —- — — Gray

Downloaded from https://academic.oup.com/comjnl/article/8/4/331/400750 by guest on 15 April 2022


Tuesday
9.30 Lewis White Shaw —
10.30 Fisher Rogers White Exercises —
11.30 Andrew Green Fuller King —
12.30 — — Reader
2.30 — Green King — —
3.30 — — — — —

Wednesday
9.30 Thomas Exercises' Rogers — —
10.30 Andrew Carter Reader Fisher
11.30 — Thomas Green — Fisher
12.30 — —
2.30 — — —
3.30 — — — — —

Thursday
9.30 Shaw Rowland Rose —
10.30 Lewis Andrew Hughes — Grant
11.30 Thomas White Shaw Grant
12.30 — — Fuller
2.30 — — Green
3.30 — — — — —

Friday
9.30 Shaw Rowland King — —
10.30 Andrew Rogers White Shaw Coles
11.30 — Andrew Rogers — Coles
12.30 — — Rose
2.30 — — White
1
3.30 — —

uses the three rectangular faces of this brick for the and may be occupied with lectures in other faculties.
Course Requirements, Lecturer Availability and Time- As before these matrices are copied into Current versions
table matrices. In addition, a 2-dimensional Boolean which can be updated during the allocation.
array known as the Conflicts matrix, lists groups of Groups of courses which should be available for a
courses whose lecture times must not conflict. For student are put into rows of the Conflicts matrix. These
example, in row 1 chemistry, physics, mechanics and their groups may be in two categories, essential and desirable.
associated laboratory classes could all be given the value
true. Output
In keeping with the usual Faculty convention the
Input timetable is printed as a matrix of dimensions (day of
Input data must include information for the Initial week) x (time of day) whose coefficients are lists of the
Course Requirements and the Initial Lecturer Avail- lectures taking place at that hour. To produce this
ability matrices. Again lecturers will have free days timetable, face 3 of the brick in Fig. 4 is stored as a
334
Timetables
Table 3
Timetable for the Mathematics Department, Version 2
(Version 2 uses the same data as Version 1, but the Requirements matrix is scanned in
the opposite direction)
CLASS HI Hill PHI PG

Monday
9.30 Lewis Rogers Reader Shaw —
10.30 Shaw Thomas Rose King Gray
11.30 Thomas Carter Rogers — Gray
12.30 — — Pratt — —
2.30 — Carter King — Fisher

Downloaded from https://academic.oup.com/comjnl/article/8/4/331/400750 by guest on 15 April 2022


3.30 — — Pratt — Fisher

Tuesday
9.30 Andrew Green Fuller Exercises j
10.30 Fisher Exercises Shaw King
11.30 Lewis White King — —

12.30 — Thomas White — —

2.30 Hughes
3.30 — — —

Wednesday
9.30 Andrew Exercises Green
10.30 Thomas Green White — Coles
11.30 Fisher Rogers Hughes — Coles
12.30
2.30
3.30

Thursday
9.30 Shaw Andrew Rose
10.30 Andrew Rowland Green Grant
11.30 Thomas White Fuller Grant
12.30 White
2.30
3.30

Friday
9.30 Shaw Andrew Reader
10.30 Rowland Rogers Shaw Peters
11.30 — Shaw Peters
12.30 — Rose
2.30 — King
3.30

Boolean matrix of size (course) x (time). The output consecutive hours. These are allocated first by putting
procedure must scan the columns of this matrix to form them at the head of the list of courses. The number of
the lists of lectures for each hour. lectures allocated at each hour can be limited by the
number of lecture theatres available.
Algorithm The procedure also scans the Conflicts matrix for any
The basic algorithm is unchanged. The previous groups of courses containing the course which is being
ALGOL program- is repeated with courses replacing allocated, and ensures that its lecture hour will not
classes in the outermost cycle. coincide with any of the other courses in any of these
The allocation procedure must satisfy the same con- groups.
ditions as before. In addition some of the courses now The block diagram for procedure allocate is shown in
include laboratory classes which require from 2 to 5 Fig. 5 and the ALGOL version is given in Table 4.
335
Timetables

enter

Is there a lecture
to allocate ?

1st lab time Is this a laboratory


1st time
class p

Downloaded from https://academic.oup.com/comjnl/article/8/4/331/400750 by guest on 15 April 2022


fail: = true Have all times Have all times fail:=true
been tried ? been tried ?

Is this Wed. pm p Is this Wed. pm?

Are all groups which Is the lecturer free?


include this lab free p

Has he given 2
Is the lecturer free ? next lab time adjacent lectures ?

Fill in TT and CLA Has lecture on same


with 2 . 3 . 4or S hour subject been held
in this half day p
period.
Reduce CR to zero

Arc all rooms ful I?

Are all groups which


next time include this course freep

Fill in TT and CLA.


Subtract I from CR.

exit

Fig. 5

336
Timetables

Table 4

ALGOL version of procedure allocate

procedure allocate (c, I); integer c, I;


begin integer t, j , g,p;
if CR[c, /] ^ 0 then
begin if c < laboratory then goto lab; t : = 0;
//we: Z : = Z + 1; if / < 40 then
begin if CLA[l, t] then goto next time;

Downloaded from https://academic.oup.com/comjnl/article/8/4/331/400750 by guest on 15 April 2022


fory : = 23,28,33,38 do if Z = . / then goto next time;
forj : = 1,2,3,4,5,21,22,24,25 do if Z = y and ((CL,4[/, * + 5] and CLA[l, t + 10]) or
(7T[c, Z + 5] or 7T[c, Z + 10] or TT[c, t + 15])) then goto next time;
forj : = 6,7,8,9,10,26,27,29,30 do if t =j and ((CLA[l, t + 5] and
(CLA[l, t - 5] or CL/4[/, Z + 10])) or (TT[c, t - 5] or 7T[c, / + 5] or TT[c, t + 10]))
then goto next time;
fory : = 11,12,13,14,15,31,32,34,35 do if t = y and ((CL/i[/,f - 5] and
(CLA[l, t - 10] or CLA[l, t + 5])) or (TT[c, t - 10] or TT[c, t - 5] or 7T[c, / + 5]))
then goto next time;
forj : = 16,17,18,19,20,36,37,39,40 do if * =j and ((CLA[l, t - 10] and CL/4[/, r - 5])
or (TT[c, t — 15] or TT[c, t — 10] or TT[c, t — 5])) then goto next time;

if rms[t] > rooms then goto Hex/ //we;


for g : = 1 step 1 until course do
if C[g, c] then
for p : = 1 step 1 until lecture do
if C[g,/>] then begin if TT[p, t] then goto next time end;
TT[c, t] : = CL^[/, /] : = true; CR[c, I] := CR[c, /] - 1; rms[t] : = rw.y[/] + 1
end
else fail := true; goto exit;
lab: t := 10;
next lab time: / : = / + 1; if / < 15 then
begin if / = 13 and CR[c, l]>2 then goto next lab time;
for g : — 1 step 1 until course do
if C[g, c] then
for p := 1 step 1 until lecture do
if C[g, p] then begin if 7T[/», /] or TT[p, t + 10] and CR[c, l]>2
then goto next lab lime end;

if (CR[c, /] = 2 or C7?[c, /] = 5) and not CLA[l, /] and not CLA[l, t + 5] then


begin TT[c, t] := TT[c, t+5] : = CLA[l, t] : = CLA[l, t+5] := true;
CR[c,l] := CR[c,l]-2
end;
if (CR[c, l]=3 or CR[c, /]=4) and not CLA[l, t + 10]
and not CLA[l, t + 15] and not CL^[/, z+20] then
begin 7T[c, z+10] : = 7T[c, z+15] : = TT[c, /+20] : = true;
CLA[I, t + 10] := CLA [I, t+\5] := CLA[I, t+20] : = true;
CR[c, I] := CR[c, l]-3
end;
if CR[c, l]=l and not CL/4[/, Z+25] then
begin TT[c, t+25] : = CLA[l, t+25] : = true; C/?[c, /] : = 0 end
end
else fail := true
end;
exit: end allocate;

337
Timetables
The alter conditions procedure again tries first a
reordering of the courses. If this fails then the lecturers'
free days can be adjusted, one or two extra lecture
theatres may be used, or finally those groups of courses
which are desirable rather than essential can be neglected.

Results
Typical results are illustrated in Tables 5 and 6. The
program was contained in 40 storage blocks of Atlas,
compilation took about 10 sec, execution for Table 5
12-5 sec and for Table 6 40 sec.

Downloaded from https://academic.oup.com/comjnl/article/8/4/331/400750 by guest on 15 April 2022


Possible groups of courses
A student is expected to take three courses at once,
hence an extra procedure was added which would scan
the final Boolean timetable and list all possible com-
binations of three courses. For example, there are over
100 possible groups of three courses for the timetable in
Table 5.
Timetables and lists of possible courses were produced
for each of a student's first four semesters.
An extra program then takes as input data these four
lists of three courses and also any prerequisite courses
for courses in semesters 2 to 4, and produces a list of
Table 5
Science Faculty Timetable for Semester 1
Courses are represented by the department initial (B Botany, Z Zoology, C Chemistry, P Physics, M Mathematics,
G Geology, g Geography), followed by g reference number within the department.

9.30 10.30 11.30 12.30 2.0 3.0 4.0 5.0

Monday Bl C2 Bllab
Zl M2 Zllab
Z2 Z21ab
M3 M5
M4 M6

Tuesday Bl PI Z31ab
Zl Ml P2 C3 Cllab
Z2 Gl M2 M6 g31ab
gl g2

Wednesday
Z3 PI P2 C3
Cl Ml M3 M7
P3 Gl M5 gl
Thursday
Z3 PI M3 M7 C21ab
Cl Ml M4 gl Gllab
P3 Gl

Friday
C2 P2 M4 M7 Pllab
g3 M2 M6 g4 P31ab
M5

338
Timetables
Table 6
Science Faculty Timetable for Semester 4

9.30 10.30 11.30 12.30 2.0 3.0 4.0 5.0

Monday B2 B9 B21ab
B7 C4 B71ab
Z4 C16 Z41ab
Z10 P9 ZIOlab
C12 M10 C17 M16 C121ab
Pll M28 P12 M17 Plllab
M8 M36 Mil M31 M33
M14

Downloaded from https://academic.oup.com/comjnl/article/8/4/331/400750 by guest on 15 April 2022


M34 M37
M35 G5 M29
gl5 g5 gl51ab

Tuesday B2 Z13 B81ab


B7 C5 Z51ab
Z4 P9 Zlllab
Z10 M10 P51ab
C12 M28 P12 M17 C161ab
Pll M38 M13 g20 gl71ab
M8 G2 M30
Mil G6 g8
M34 gl9
M35

Wednesday B8 Z13 BIO M12 ,


Z5 C5 P4 M16
Zll P10 P12 M17
Z12 M10 M15 M32
C12 M28 M30
P5 G2 g20
M9 G5
g7

Thursday B8 C17 B91ab


Z5 P10 Z121ab
Zll M8 C6 M12 G41ab
Z12 Mil M14 M32 M33
C16 M29 M15
P4 M38 M30
M9 G2 G51ab
M36 gl6
M37
g5

Friday B9 BIO BlOlab


C4 C17 Z131ab
C16 P4 M12 C6 C51ab
P9 P10 M15 M32 C171ab
M9 M13 M16 G21ab
M14 M29 M31
M34 M36 M38
M35 M37 G61ab
G5 g6
g5 gl8 •

339
Timetables
Table 7
Some possible combinations of courses

SEMESTER 1 SEMESTER 2 SEMESTER 3 SEMESTER 4

Z3 M4 M6 Z5 Mil M16 P7 P8 M26 P9 P10 Pll


Ml M6 M7 M13 M15 M17 M23 M25 M27 M34 M36 M38
P3 Ml M3 P5 M8 M10 P6 M18 M19 M28 M29 M30
Cl C2 M4 C4 C5 Mil C7 C8 M2 C12 C16 C17
Zl Cl C2 Z4 C4 C5 B4 B5 B6 B7 B8 BIO
Z2 Cl Gl B2 C4 G2 C7 G3 G4 C12 G5 G6
Z3 PI M5 B2 Z5 M12 Z6 Z7 Z8 Z10 Zll Z13

Downloaded from https://academic.oup.com/comjnl/article/8/4/331/400750 by guest on 15 April 2022


all possible groups of twelve courses which a student Acknowledgements
could study during his first four semesters using the The author wishes to thank Dr. B. H. Chirgwin of
given timetables. A section of the results of this program Queen Mary College, who had previously produced the
is illustrated in Table 7. Mathematics Department timetables, for impetus in
The basic principles of these algorithms for producing starting this work and for many helpful discussions;
timetables seem very simple and it is hoped that other also Professor V. C. A. Ferraro, Head of the Mathe-
people may be able to adapt them for their own purposes. matics Department, for his encouragement.

References
GOTUEB, C. C. (1963). "The Construction of Class-Teacher Timetable," Proc. IFIP Congress 62, Munich, North Holland
Pub. Co., Amsterdam.
CSIMA, J., and GOTUEB, C. C. (1963). "A Computer Method for constructing School Timetables," Presented at the Eighteenth
Annual Conference of the Association for Computing Machinery, Denver, Colorado.
SHERMAN, G. R. (1963). "A Combinatorial Problem arising from Scheduling of University Classes," Journal of the Tennessee
Academy of Science, Vol. 38, No. 3, p. 115.
APPLEBY, J. S., BLAKE, D. V., and NEWMAN, E. A. (1961). "Techniques for producing School Timetables on a Computer and
their Application to other Scheduling Problems," The Computer Journal, Vol. 3, p. 237.
BRODER, S. (1964). "Final Examination Scheduling," Communications of the ACM, Vol. 7, No. 8, p. 494.
COLE, A. J. (1964). "The preparation of examination timetables using a small store computer," The Computer Journal, Vol. 7,
No. 2, p. 117.
BOSSERT, W. H., arid HARMON, J. B. (1963). Student sectioning on the IBM 7090, IBM Corp., Cambridge, Mass.

Notice: Newsletter for numerical analysts


The ACM Special Interest Committee on Numerical A partial list of the type of material which is appro-
Mathematics (SICNUM) will begin publication of a priate for publication in the newsletter follows:
newsletter in order to provide numerical analysts with a
fast means of communication below the journal level. (a) Material relating to numerical algorithms.
The newsletter is free and will be sent upon request. (b) Announcement of available programs, espe-
(ACM membership is not required.) The newsletter will
appear as frequently as there is sufficient material. cially packages; critical discussions of existing
programs.
Material for the newsletter is solicited. The material
will not be refereed. It should be submitted in duplicate (c) Announcement of availability of technical reports;
on bond in a form ready for publication. Material announcement of new books.
appropriate for journal publication should not be sent {d) Announcement of meetings of interest to numerical
to the newsletter. Requests to receive the newsletter analysts.
and material for the newsletter should be sent to the
chairman of SICNUM: (e) Letters to the editor—thinkpieces.
DR. J. F. TRAUB, Mathematics Research Center, (/) Problems and their solutions,
Bell Telephone Laboratories, Incorporated, (g) Discussions of curricula.
Murray Hill, New Jersey. (/;) Personal news.
340

You might also like