You are on page 1of 15

European Journal of Operational Research 160 (2005) 106120 www.elsevier.

com/locate/dsw

Ecient solutions for a university timetabling problem through integer programming


S. Daskalaki
b

a,*

, T. Birbas

a Department of Engineering Sciences, University of Patras, Rio Patras, GR-26500, Greece Department of Electrical & Computer Engineering, University of Patras, Rio Patras, GR-26500, Greece

Received 1 September 2002; accepted 1 June 2003 Available online 6 November 2003

Abstract Integer programming has always been an alternative for formulating combinatorial problems such as the university timetabling problem. However, the eort required for modeling complicated operational rules, as well as the computational diculties that result from the size of real problems have discouraged researchers and made them turn their interest to other approaches. In this paper, a two-stage relaxation procedure that solves eciently the integer programming formulation of a university timetabling problem is presented. The relaxation is performed in the rst stage and concerns the constraints that warrantee consecutiveness in multi-period sessions of certain courses. These constraints, which are computationally heavier than the others, are recovered during the second stage and a number of subproblems, one for each day of the week, are solved for local optima. Comparing to a solution approach that solves the problem in a single stage, computation time is reduced signicantly without any loss in quality for the resulting timetables. The new solution approach gives a chance for further improvements in the nal timetables, as well as for certain degree of interaction with the users during the construction of the timetables. 2003 Elsevier B.V. All rights reserved.
Keywords: Timetabling; University timetabling; Integer programming

1. Introduction Several times during each academic year, administrative personnel, resource managers and schedulers in university departments occupy themselves with timetabling problems. Many decisions have to be made concerning assignments of

Corresponding author. Tel./fax: +30-2610-997810. E-mail addresses: sdask@upatras.gr (S. Daskalaki), tbirbas@ee.upatras.gr (T. Birbas).

students to student groups, allocation of faculty members to courses, scheduling of courses during the week, as well as assignment of courses to classrooms. The assumptions and rules that are taken into consideration for any of these decisions vary amongst the dierent institutions and highly depend on the structure of the school, the departments curriculum, the availability of resources and the various societal conditions. In this paper, we present a university timetabling problem as it appears in a large number of universities. It belongs to the class/teacher type of

0377-2217/$ - see front matter 2003 Elsevier B.V. All rights reserved. doi:10.1016/j.ejor.2003.06.023

S. Daskalaki, T. Birbas / European Journal of Operational Research 160 (2005) 106120

107

timetabling problems, embellished however with several special requests for the courses oered. The problem is then formulated with the help of an integer programming (IP) model using a large number of suitably dened binary variables. In order to avoid computational diculties, caused by the size of the problems, the model is solved in two stages. During the rst stage, the heaviest computational constraints are relaxed so that an initial solution is obtained, while during the second stage these constraints are recovered for a locally optimal solution. The proposed models may be constructed for any department operating in the described way and may be solved by commercial software for IP. The modeling approach along with the proposed solution procedure are coupled together very eciently, even for large departments, and thus support the idea that IP may prove to be an eective tool for these large scale combinatorial problems. Given that in most timetabling problems, the optimisation refers to quality features of the timetable, the solutions resulting from the proposed solution approach are judged at the quality level. Timetabling problems have been studied by several researchers since the 1960s. Since educational timetabling problems vary widely, the solution approaches also vary and depend highly on the size of the problem. However, in the heart of each timetabling problem always lies a combinatorial problem that needs to be solved. Therefore, most known techniques for discrete optimisation have shown applicability for at least a set of timetabling problems. Local search techniques [17], tabu search [7,14], constraint programming [9,15,23], genetic algorithms [5,6,12,16,20], and goal programming [1] are among the techniques one may nd in the timetabling literature. Traditionally, IP formulations have also been provided from several authors [11,19,21], usually for simpler versions of the problem, however, in most cases real problems are solved by heuristics or techniques from graph theory and network ows. Successful solutions using IP have been reported in [8,10,18] for university timetabling problems and in [24] for high school timetabling problems. A common criticism for the IP-based approaches is the heavy computational requirements that

branch-and-bound method imposes to these models. This was also true with the IP model presented in [8], where computational diculties are reported for large problems. In this paper, an alternative solution approach for the IP model in [8] is proposed and the resulting timetables are compared from a quality perspective. Section 2 presents the assumptions, as well as the hard and soft rules, which are used for our timetabling problem; it concludes with the denition of the binary variables, which are later used for the IP formulation. In Section 3 the computational diculties of the original IP formulation are discussed and two possible solution approaches are suggested. Section 4 presents the relaxation approach as a two-stage procedure for an ecient solution of the original IP model. Each stage comprises the solution of separate IP models, solved sequentially until all constraints are satised. In Section 5 the performance of the relaxation approach is compared with that of the original optimisation model rst at a computational level and then at a quality level dened by the ability of each model to satisfy teachers preferences for certain time periods. Lastly, in Section 6 it is discussed how the eciency of the two-stage relaxation procedure gives the green light for features that may be added to the timetables in order to enhance further their quality and their users satisfaction.

2. Assumptions and problem formulation The timetabling problem to be solved in this paper appears in universities where departments oer study programs three to ve years duration and provide quite structured curricula for welldened groups of their students. For the rst two or three years of study the courses are mostly mandatory, with a small number of electives for minor courses; this changes in the last two years of study and the number of elective courses increases compared to the mandatory ones, while their subjects become more focused and specialized. Moreover, the courses for the students of a given department are mainly oered from the department itself. In this sense, the dierent departments do not share any courses or timetables.

108

S. Daskalaki, T. Birbas / European Journal of Operational Research 160 (2005) 106120

Under the scenario just described, the students of the rst two or three years form well-dened student groups, where in this case a student group is dened to be the students of a specic year of study. The students of each one of these groups follow the same schedule for a major portion of their timetable by attending courses for large audiences; however, they split in smaller groups in order to attend a number of laboratories or recitations as well as a smaller number of elective courses. In addition, we consider the case where the students of the last one or two years of studies are required to select one among several divisions of the department in order to specialize further their studies. Under this assumption, a student group is formed by the students of a given year that choose a specic division. As a result, for the later years of study the sizes of the student groups become smaller and their curriculum requires small number of mandatory courses and larger number of electives. Moreover, some of their courses are shared with other groups of students (from different year and/or dierent specialization). Based on the requirements discussed above, the problem to be modeled belongs to the category of class/teacher timetabling problem, although it carries several characteristics of the timetabling problems known as University Course Timetabling. These additional features not only make the problem NP-complete [22], but also quite complicated in modeling. In other IP formulations of the university timetabling problem e.g. [10,18] students have more choices in structuring their schedule, so in order to make things more tractable, courses are grouped into subject groups. With this realization the notion of a course is embodied into the notion of the subject group and for the timetabling the assignments are performed between subject groups and the time periods within each week. On the contrary, with our modeling approach, courses are maintained as such and the assignments are performed between individual courses and time periods. In other cases, time periods are also grouped into time groups [10,11], again for reducing the number of variables and thus making the problem tractable. In our case this approach was not an option because departments require more exibil-

ity for the assignments they make. The two points just mentioned form dierences that eventually alter the approach followed in the solutions and which of course emanate from dierences in the problems themselves. Following the problem description given above, several rules may be outlined for our timetabling problem. 1. Every group of students attends a list of courses, some mandatory and some elective. The courses may comprise of just lectures, or lectures and recitations, or lectures, recitations and/or lab work. 2. Collisions are not permitted among courses designed for the same group of students. The underlined assumption is that all mandatory and all elective courses suggested for a specic group of students should be scheduled at dierent time periods, unless the students have to choose only one out of several elective courses. 3. Conicts are not allowed in the schedule of any individual member of the teaching sta. Given that professors teach courses of dierent student groups, this is a rule that should be taken into consideration. 4. Two dierent courses should never be scheduled for the same pair of period and classroom. 5. Certain courses may be attended by more than one group of students. This occurs only for the students of the last one or two years, when a division oers certain courses designed for the students of more than one specialization. The underlined assumption here is that a course offered for more than one student group may not overlap with any of the courses oered for all involved student groups. 6. All timetables should be complete, which means that all courses for all student groups should be scheduled, along with all their requirements for recitations and lab work. The scheduling of any given course should always obey any additional requirements set forth, in terms of splitting the weekly teaching load in single or multi-period sessions or the student group in a number of sub-groups. 7. Dening as session of a course to be the gathering of a student group or a part of a student

S. Daskalaki, T. Birbas / European Journal of Operational Research 160 (2005) 106120

109

group and a teacher for one or more time periods of a day, we assume that multi-period sessions of any size are allowed, thus requesting consecutive time periods for a given session. The teaching sta is requested to give a desired split for the weekly teaching load for all courses that each one is responsible and the timetabler then makes an eort to meet all these requests. 8. Certain courses, for example courses that carry a part with lab work, require repetitive sessions, which are single or multi-period gatherings of a teacher and a part of a student group. Given that a large student group sometimes should be trained in smaller gatherings, the group splits into several sub-groups and an equivalent number of sessions are scheduled either in the same day or in dierent days. Since the subject to be taught is repeated several times, each individual student attends at most one of these repetitive sessions every week. 9. Classrooms have dierent capacities, therefore given a course taught to a specic group of students only the classrooms that carry the capacity for this group and satises the requirements for the course are considered. All of the above rules constitute the hard rules of our problem and therefore are modeled explicitly with the constraints of the suggested IP model. Apart from these rules, an additional number of desired (soft) rules might also be added to the list. Soft rules usually are not covered with the model constraints, however they are used to direct the choices for the cost coecients in the objective function. As a result their role is mainly to drive the nal solutions to more qualitative timetables. These soft rules are: 1. Teachers may be requested to provide their preferences for specic days and time periods. Under this assumption their preferences should be matched as much as possible. 2. Student schedules should be as compact as possible. Even students of the same group may have dierent timetables because of the elective courses and the splitting into sub-groups for lab work or recitations, so full compactness for all students is not feasible, however some

rules may be applied to achieve a satisfactory level. 3. There should be lunch breaks for all students, if possible. This rule makes timetables more workable and easier to follow. 4. Classroom changeovers should be as minimal as possible. This rule facilitates large audiences, given that changing classrooms creates unsettlement and more noise. Following the modeling approach of [8], we use IP to build the model that may construct university timetables. With this modeling philosophy the equations for the actual IP model may alter from institution to institution to reect the special requirements imposed by each one of them, however, the underlying structure of the model remains the same. Six quantities are considered as the basic structural elements for this approach and in the sequel they turn into indices for the basic variables of the model. These are: The day of the week, denoted by the letter i 2 I f1; 2; 3; 4; 5g. The time period of a day, denoted by the letter j 2 J f1; 2; . . . ; 14g. Traditionally in Greek universities the teaching period is 45 minutes, thus allowing a 15-minutes break for the students and change of teaching sta, unless the session requires more than one period, in which case the teacher also takes a break and returns back to the same session. The 14 periods in J refer to time periods from 8:00 a.m. till 10:00 p.m. The group of students for which a course in the timetable is designed, denoted by the letter k 2 K fgroup#1; group#2; . . . ; group#jK jg. In our approach, examples of groups of students may be the rst year students of a given department or the fourth year students of a specic division. Here it is assumed that a department may consist of several divisions, each one oering a dierent specialization and the students are required to select one division after their second or third year of studies. The teacher (professor, lecturer or other teaching sta) that teaches a course, denoted by the letter l 2 L fteacher#1; teacher#2; . . . ; teacher#jLjg. For our problem, it is assumed that the

110

S. Daskalaki, T. Birbas / European Journal of Operational Research 160 (2005) 106120

assignment of courses to teachers precedes the timetabling process, and the teaching requirements for each teacher is an input to the timetablers. The course which need to be scheduled, denoted by the letter m 2 M fcourse#1; course#2; . . . ; course#jM jg. As explained earlier, all dierent parts of a given course (lectures, labs or recitations) have to appear in a weekly timetable and in the desired scheme, which may be dierent for every course. The classroom that may be utilized for scheduling a session of a course, denoted by the letter n 2 N fclassroom#1; classroom#2; . . . ; classroom#jN jg. Classrooms have dierent capacities, so certain classrooms are not available for some groups of students. Two dierent sets of binary variables are adopted. The rst comprises the basic variables, denoted by xi;j;k;l;m;n , which takes the value of 1, when course m, taught by teacher l to the group of students k , is scheduled for the jth period of day i in classroom n. The second set comprises the auxiliary variables, denoted by yi;pm ;k;hm ;m;n , where i 2 I , k 2 K , m 2 M , and n 2 N , are dened as previously, while pm and hm are natural numbers. The variable yi;pm ;k;hm ;m;n takes the value of 1, when course m, which requires a session of hm consecutive periods, is scheduled for day i for the group of students k in classroom n. Index pm takes the values 1; 2; 3; . . . ; p maxm , when the session is repeated p maxm times (repetitive sessions). When variable yi;pm ;k;hm ;m;n refers to those sessions of course m, which are intended for lectures and are given just once, then pm takes the value of 1. The two sets of variables just described are quite detailed, therefore exible enough and with their help all basic rules for the timetabling prob-

lem are easily described. This is the major dierence of our modeling approach with other IP formulations, because it allows turning quite complex relations among the structural elements of the problem into equations.

3. Computational dicultiessuggested solutions A formulation of the problem using a single IP model may be found in [8]. That model is complete in terms of the hard and soft rules described by its constraints and objective function. Moreover, the suggested strategy for determining values for the cost coecients in the objective function provides solutions of high quality. However, as already reported in [8], it presents certain computational diculties. Table 1 shows some of the problem sizes that have been solved with that model and the corresponding CPU times required by the MIP solver of CPLEX 5.1 for their solution in an HP J7000 workstation. Realistic timetabling problems, especially for engineering departments with a veyear program are usually of the larger size (problem #3) and sometimes even larger, so in this paper a new implementation procedure of the model is presented. The new solution approach, is a two-stage relaxation procedure, and is based on an initial relaxation of the heaviest computationally constraints for an optimal solution of the relaxed problem. During the second stage, the relaxed constraints are introduced afresh and the timetable is solved on a day-by-day basis to nd local optima of the original problem. An alternative to the relaxation approach would have been a decomposition approach, which suggests breaking the problem into smaller problems. This may also be applied quite eectively in cases

Table 1 Computation times for problems of dierent size Problem size Courses (#) Problem #1 Problem #2 Problem #3 25 47 92 Lab courses (#) 8 19 27 Required teaching periods 139 187 319 Rooms/labs(#) 3/6 4/10 6/12 Computation CPU time (min) 2.5 18.5 96.0

S. Daskalaki, T. Birbas / European Journal of Operational Research 160 (2005) 106120

111

where some groups of students form much smaller audiences than the rest of the groups. In this case the two distinct sets of student groups do not compete for the same classrooms, except only if the rooms of small capacity are not enough, however even in those cases the larger student groups should normally have priority over the groups of smaller size. Thus it is suggested that rst the timetabling sub-problem for the large student groups is solved; then the other timetabling sub-problem for the smaller student groups follows, where of course the allocations of courses to teachers and classrooms that resulted from the rst problem are declared as unavailabilities for the second problem. With the decomposition approach, better computation times can be achieved. For example, a problem of approximately the size of problem #3 in Table 1 can be decomposed in two problems of approximately the size of problems #1 and #2, so computation time is reduced by a factor of 5.

Stage 1: Relax consecutive constraints Weekly timetable with multi - period sessions Solve relaxed problem (not necessarily consecutive) Re-arranged timetable with consecutiveness for multi - period sessions

Stage 2: Solve an IP problem for each day of the week

Fig. 1. The two-stage relaxation procedure.

4. The relaxation approach A major source of complexity in the complete IP model has been the constraints for consecutiveness. Based on our modeling experience with it, approximately 50% (and sometimes even more) of the constraints written for any given timetabling problem are attributed to the requirements for blocks of multi-period sessions. Of course, most university courses carry requirements for sessions of two, three, or sometimes even four consecutive hours; therefore every formulation used for real problems should accommodate them. Furthermore, in [13] it is proven that the requirement for consecutive time periods is one of the features in a timetabling problem that by itself turns the problem from easy to hard, i.e. from polynomially solvable to NP-hard. Thus, our new solution approach suggests the relaxation of these constraints during the rst stage and their introduction during the second stage, after all courses have already been assigned to days. Then the only concern is to re-arrange the courses of each day so that consecutiveness is achieved, whenever is required. Following our modeling approach, the relaxation procedure is

further facilitated by the fact that the requirement of a course for multiple consecutive time periods is achieved with the help of three sets of equations [8]. The rst set assigns the course to the required number of time periods all in a given day, while the next two force these time periods to be consecutive. This modeling approach gives now the exibility of relaxing only the two later equations, but still maintain the rst one. As depicted in Fig. 1, solving the problem without the equations for consecutiveness results in weekly timetables that guarantee the assignment of the right amount of time periods to courses, however, for any given course that requires multiple periods, the assigned periods may or may not be consecutive. The problem of consecutiveness is mended in the second stage, where the timetabling problem is solved afresh for each day of the week, this time paying attention to consecutiveness. The result of the second stage is a re-arranged timetable with multi-period blocks that satises the consecutiveness requirement for any given course. 4.1. First stagethe relaxed integer programming problem The IP model solved in the rst stage of the relaxation procedure carries all constraints of the original model presented in [8] with the exception of the constraints that guarantee consecutiveness for multi-period sessions. The model is a cost minimization problem and uses the 01 variables dened in Section 2. The rst group of equations (1)(6) models a set of standard requirements, which appear in most timetabling problems, while

112

S. Daskalaki, T. Birbas / European Journal of Operational Research 160 (2005) 106120

the rest (7)(11) are more specialized for the requirements of our timetabling problem. ( XX X X XX Minimize ci;j;k;l;m;n xi;j;k;l;m;n yi;pm ;k;hm ;m;n subject to 8i 2 I ; 8j 2 J ; 8l 2 Li ; XX X X X X
k 2K i2I m2Mk n2Nmk hm 2Hm pm 2Pm k 2K l2Lk m2Mkl n2Nmk i2Il j2Jiln

8i 2 I ; 8k 2 K ; 8l 2 Lki ; 8m 2 Mkl ; 8n 2 Nmk ; X X X xi;j;k;l;m;n yi;pm ;k;hm ;m;n hm 0;


j2Jiln hm 2Hm pm 2Pm

7 8k 2 K ; 8m 2 Mk Mlab ; 8hn 2 Hm ; X X yi;pm ;k;hm ;m;n bm;hm ; 8n 2 Nmk ;


i2Iln pm 2Pm

ai;pm ;k;hm ;m;n

X X X
k 2Kl m2Mkl n2Nmk

8k 2 K ; 8m 2 Mk Mlab ; 8hm 2 Hm ; X X yi;pm ;k;hm ;m;n 6 1; 8n 2 Nmk ; 8i 2 I ; xi;j;k;l;m;n 6 1; 1


hm 2Hm pm 2Pm

8k 2 K ; 8m 2 Mlab ; X X X yi;pm ;k;hm ;m;n p maxm ; 8hm 2 Hm ;


n2Nmk i2In pm 2Pm

8k 2 K 1 ; 8i 2 I ; 8j 2 J ; X X X xi;j;k;l;m;n 6 1;
l2Lki m2Mkl n2Nmk

2a 8i; j; k ; l; m; n 2 PRA; xi;j;k;l;m;n 1;

10 11

8k 2 K ; 8i 2 I ; 8j 2 J ; XX X xi;j;k;l;m;n
l2Lki m2Mkl n2Nmk

where
xi;j;ka ;l;m;n 6 1; 2b

com n2N ka ;l;m2Mk mka

8n 2 N ; 8i 2 In ; 8j 2 Jin ; XX X xi;j;k;l;m;n 6 1;
k 2K l2Lki m2Mkln

3 xi;j;k;l;m;n ak ; 4a

8k 2 K 1 ;

X X X X X
l2Lk m2Mkl n2Nmk i2Iln j2Jiln

8k 2 K 2 ;

X X X X X X
l2Lk m2Mkl n2Nmk i2Iln j2Jiln

xi;j;k;l;m;n

X X X

xi;j;ka ;l;m;n ak ; 4b

com n2N ka ;l;m2Mk mka i2Iln j2Jiln

8k 2 K ; 8l 2 Lk ; 8m 2 Mkl ; X X X xi;j;k;l;m;n bm ;
n2Nmk i2Iln j2Jiln

8l 2 L;

X X X X X
k 2K m2Mkl n2Nmk i2Iln j2Jiln

xi;j;k;l;m;n sl ;

{l 2 L: l teacher available on day i}, {l 2 L: l teacher teaching at least one course to the group of students k and is available on day i}, K 1 {k 2 K : k group of students of lowergrade years, usually students from the rst two or three years, following general education within a department}, K 2 {k 2 K : k group of students of highergrade years (registered to a specic division)}. It is apparent that K 1 and K 2 are disjoint sets, while K K 1 [ K 2 , Kl {k 2 K : k group of students (from either K 1 or K 2 ) to which teacher l teaches some course}, Mkl {m 2 M : m course designed for the k th group of students and taught by teacher l}, Mkln {m 2 M : m course designed for the k th group of students, assigned to teacher l and suitable for classroom n}, Mkcom fka ; l; m 2 K 2 L M : m course taught by teacher l and designed for the student group ka 2 K 2 , but additionally oered as elective course for the student group k 2 K 2 },

Li Lki

S. Daskalaki, T. Birbas / European Journal of Operational Research 160 (2005) 106120

113

{n 2 N : n classroom that ts the group of students k for course m}, In {i 2 I : i day on which classroom n is available for use}, Jin {j 2 J : j time period of day i on which classroom n is available for assignments}, Jiln {j 2 J : j time period of day i on which teacher l and classroom n are available for assignments}, ci;j;k;l;m;n cost of scheduling course m, taught by teacher l to the k th group of students, for the jth time period of day i in classroom n, ai;pm ;k;hm ;m;n cost of scheduling repetition #pm 2 N of course m, which is intended for the group of students k and requires a session of hm 2 N consecutive periods, for day i in classroom n, ak total number of teaching periods planned for the k th group of students, bm total number of teaching periods required for course m, sl total number of teaching periods required from teacher l every week according to the departmental assignments, Iln {i 2 I : i day on which teacher l and classroom n are available for assignments}, Pm {pm 2 f1; 2; . . . ; p maxm }, where p maxm is the number of repetitions required for repetitive session of course m 2 M }, Hm {hm 2 N : hm length (number of periods) of a multi-period session requested for course m 2 M }, bm;hm number of hm -period sessions required for course m during a week, Mlab {m 2 M : m course requiring lab work}, and p maxm number of student sub-groups, i.e. the number of repetitions required for the hm period session of course m. PRA {i; j; k ; l; m; n 2 I J K L M N : i; j; k ; l; m; n is an a priori assignment in the timetable, that is, course m taught by teacher l for the student group k , is preassigned to the jth period of day i}. Constraints (1)(3) are called uniqueness constraints and their purpose is to ensure that no conicts have been introduced in the timetable.

Nmk

For every time period of the week, Eq. (1) assigns at most one course to every teacher. Similarly, for every time period of the week, Eq. (2) assigns at most one course, one teaching person and one classroom to every group of students. Eq. (2a) refers to lower-grade students, while Eq. (2b) refers to higher-grade students, who may attend the courses oered by the division of their choice and a number of additionally suggested courses, Mkcom , 8k 2 K 2 , oered by other divisions. These requirements further ensure that for every group of students there will be no conicts between mandatory courses but also between mandatory and elective courses, so that students may choose to attend them. Lastly, for every teaching period of the week Eq. (3) assigns at most one course, one teacher and one group of students to every classroom. Constraints (4)(6) are called completeness constraints and their purpose is to ensure that the timetable is complete. More specically, Eq. (4) secures that all courses in the curriculum of each student group are in the nal timetable and for the right amount of teaching periods. Eq. (5) secures that each course is scheduled for as many teaching periods as the curriculum of each group of students requires. Lastly, Eq. (6) ensures that each person in the teaching sta is assigned as many teaching periods as his/her weekly teaching load requires. Eq. (7) is the set of constraints that secures the assignment of a given course to more than one time periods of a given day, if there is such a request. As has already been discussed, requests for multi-period sessions are quite common for university courses and may concern either part of a course, that is the lectures, recitations, or lab work. In our model it is assumed that the professor in charge of a course provides the desired split for the course. Assuming that course m requires a session of hm 2 Hm consecutive periods, this is achieved in two steps. Satisfaction of Eq. (7) ensures that course m will be assigned to exactly hm periods of a given day. In the original model, a second set of equations arranged the assignments in such a way that these hm periods are also consecutive. However, with the current approach those constraints have been relaxed for

114

S. Daskalaki, T. Birbas / European Journal of Operational Research 160 (2005) 106120

computational purposes, and will be introduced in the next stage. Eqs. (8)(10) are also connected with the courses that require multi-period sessions, in the sense that they secure the existence of the right amount of sessions of a certain length, as well as the right amount of repetitions of a given session during the week. The rst two refer to courses that require non-repetitive sessions, that is lectures or recitations delivered just once to their audience. Eq. (8) requires that during the week the hm -period sessions should be as many as requested, while Eq. (9) requires that there should be at most one session per day. Conversely, constraints expressed by Eq. (10) refers to repetitive parts of courses, for example the lab work for a given course, so the scheduling of the hm -period sessions does not require dierent days for dierent sessions, since each session is delivered to a dierent sub-group of a given group of students. The last set of constraints given by Eq. (11) handles pre-assignments of courses to specic periods of certain days. These are important constraints, because pre-allocation of courses is a very common requirement in timetabling. Moreover, they facilitate computational problems, because in our case they reduce the number of variables. Conversely, IP formulations of university timetabling that group courses into subject groups cannot easily handle such requirements, unless subject groups each with just one course are created [10]. In this case, however, the number of variables is increased and some of the computational benets gained from the formation of the subject groups may be lost. The objective function of the suggested IP model is a cost function that needs to be minimized and consists of two terms. The rst one refers to the cost of assigning course m to the jth period of day i, while the second refers to the cost incurred from the assignment of course m, which requires sessions of more than one consecutive periods, to day i. Given there are sucient time periods for scheduling all courses and sucient capacity of the classrooms to t the students in each student group, the constraints of the IP model return assignments that do not violate any of the hard rules.

However, certain assignments are more preferable than others and reaching for the better solutions becomes the responsibility of the cost coecients in the objective function. Because of this, giving values to the cost coecients is an important task and should be done in a systematic way to reect the quality (soft) rules as much as possible. Our approach of dening the cost coecients is discussed in detail in Section 5 and focuses on satisfying the soft rules outlined in Section 2 as much as possible. Specically, the cost coecients that correspond to those time periods that are preferred for a given course are assigned lower values than those assigned to the coecients that correspond to non-preferred time periods. The value assignment process for the cost coecients is further facilitated by the use of penalty functions, which are lines with positive slopes, one for the preferred time periods and the other(s) for the non-preferred. In any case, the slopes of the penalty functions force the optimisation process to prefer those timetables that are more compact for each student group, thus minimizing idle time for the students. Lastly, minimal changeover between classrooms is also satised by naming one of the classrooms to be the preferred one for a given student group. Then the values of the cost coecients that correspond to this specic pair of the indices k and n are further reduced to guide the optimisation process to solutions that adopt the preferred pair. 4.2. Second stagethe IP model for the daily schedules During the rst stage of the relaxation approach, the requirement for consecutiveness for the multi-period sessions was relaxed and the optimal solution gives the assignment of courses to specic days and periods, not guaranteeing, however, continuity for the multi-period sessions. Taking the assignment of courses to days only as input for the second stage, new IP models are formulated, one for each day, which are then solved to ensure consecutiveness for those courses that require more than one time period for the same group of students. Therefore, for each day i0 , the solution that results from the rst stage gives

S. Daskalaki, T. Birbas / European Journal of Operational Research 160 (2005) 106120

115

the courses m 2 M , along with the teachers l 2 L that teach and the groups of students k 2 K that are taught these courses. This information is summarized in the sets: MKLi0 fm; k ; l 2 M K L : m is a course taught by teacher l for student group k and scheduled for day i0 g; which are constructed after the solution of the IP model in the rst stage. The IP model that re-constructs the schedule of day i0 requires only the set of variables xi0 ;j;k;l;m;n , which take the value of 1 when the triad m; k ; l 2 MKLi0 is assigned to the jth period of day i0 . The model is also a cost minimization problem and carries the following constraints: X X X 8j 2 J ; 8l 2 L0i0 ; xi0 ;j;k;l;m;n 6 1;
k 2K m2Mi0 k n2N

where {l 2 L: l is a teacher scheduled for day i0 based on the results from stage 1}, Mi0 k {m 2 M : m is a course scheduled for day i0 for student group k }, 0 aim number of time periods required from course m for day i0 , JLi0 ln {ja ; jb 2 Ji0 ln Ji0 ln : (ja , jb ) time interval from period ja to jb of day i0 on which teacher l 2 L and classroom n 2 N are available for assignments}, FJi0 ln {ja 2 Ji0 ln : ja the starting period of an interval in JLi0 ln }. Eqs. (12)(14) provide the uniqueness constraints for the time periods of day i0 . These are equivalent to their corresponding ones at the rst stage and ensure that no conicts have been introduced in any of the timetables. Similarly, Eq. (15) provides the completeness constraints, which need only to ensure that all time periods for every course m that is assigned to day i0 are still in the timetable. Eqs. (16a)(16c) are the consecutiveness constraints, which were relaxed during the rst stage and are introduced for the rst time at this stage. With these constraints, if course m requires a session of hm consecutive time periods and is assigned to a given period of day i0 and a classroom n, then it will also be assigned to the following (hm 1) periods for the same classroom. In order to achieve this requirement all possible intervals available for this assignment are provided using set JLi0 ln . If course m is assigned to the rst period of an available interval of day i0 (belonging to the set FJi0 ln ), then Eq. (16a) forces the same course to be assigned to the following (hm 1) periods, while Eq. (16b) does the same if course m is assigned to the second, third, etc. period of an available interval. Moreover, if a course m requires more than one session of consecutive periods in a given day (because it requires repetitive sessions), then an additional constraint should be imposed to ensure consecutiveness for the second, third and so on session. This is expressed with Eq. (16c). L0i0

12 8j 2 J ; 8k 2 K ; X X X
l2L0 i
0

xi0 ;j;k;l;m;n 6 1; 13

m2Mi0 k n2N

8j 2 J ; 8n 2 N ;

XX X
k 2K l2L0 i
0

xi0 ;j;k;l;m;n 6 1; 14

m2Mi0 k

8m; k ; l 2 MKLi0 ;

XX
j 2J n2N

0 xi0 ;j;k;l;m;n aim ;

15

8m; k ; l 2 MKLi0 ; 8n 2 N ; 8ja 2 FJi0 ln ; 8hm 2 Hm ^ hm > 1; 8t 2 f1; . . . ; hm 1g; xi0 ;ja ;k;l;m;n xi0 ;ja t;k;l;m;n 6 0; 16a

8j 2 Ji0 ln ; 8hm 2 Hm ^ hm > 1; 8t 2 f2; . . . ; hm g xi0 ;j;k;l;m;n xi0 ;j1;k;l;m;n xi0 ;jt;k;l;m;n 6 0; 16b

8n 2 N ; 8j 2 f1; . . . ; jJ j 2hm g; 8hm 2 Hm ^ hm > 1


2 hm 1 X s 0

xi0 ;js;k;l;m;n xi0 ;j2hm ;k;l;m;n 6 2hm 1;

16c

116

S. Daskalaki, T. Birbas / European Journal of Operational Research 160 (2005) 106120

The objective functions of the models that provide the nal daily schedules are also cost functions that need to be minimized X X Minimize ci0 ;j;k;l;m;n xi0 ;j;k;l;m;n :
m;k ;l2MKLi0 j2J

The cost coecients ci0 ;j;k;l;m;n are determined in a similar fashion as in the rst stage and in fact they may be assigned the same values. However, if the timetabler considers inuencing assignments in a dierent way, another strategy may also be implemented for the second stage.

5. A case studyperformance of the relaxation approach In order to demonstrate the eectiveness of the relaxation approach in solving the IP model for our timetabling problem, two of the problems presented in Table 1 (problem #1 and #3) were solved again. The resulting timetables from the two-step relaxation approach were compared with the corresponding timetables that resulted from the original IP model solved in one stage. Given that the values achieved by the objective functions are not the only measures for comparing the two solutions, the comparison was performed on the basis of two other criteria, (a) computation time for getting a solution and (b) satisfaction of teachers preferences, measured as the percentage of time periods falling into the corresponding teachers preferred time intervals. Specically, problem #1 refers to the timetabling problem of a department with three student groups and 30 teachers. The department oers 25 courses (mandatory and elective) and eight lab courses, requiring the scheduling of 139 time periods totally during a week. The departTable 2 Computation times for the two solution approaches Problem size Student groups (#) Problem #1 Problem #3 3 11 Teachers (#) 30 73 Courses/labs (#) 25/8 92/27

ment has three dierent classrooms for lectures and six lab rooms available for its needs. Similarly, problem #3 refers to the timetabling problem of a department with 11 student groups and 73 teachers. The department oers 92 courses and 27 lab courses, requiring the scheduling of 319 time periods totally during a week, while there are six dierent classrooms for lectures and 12 lab rooms available. As it is shown in Table 2, when the IP model is solved in one stage, the two problems require 2.5 and 96 minutes (of CPU time), respectively, for an optimal solution. Conversely, when the two-stage relaxation approach was used, the corresponding CPU times were reduced to 16 and 85 seconds, reductions of the order 10 and 70, respectively. In order to compare the resulting timetables using the satisfaction of teachers preferences for certain time periods as a second level measure, it was necessary to calculate the percentage of successes and failures in meeting the declared preferred time intervals. According to our approach of assigning values to the cost coecients in the objective function, teachers provide dierent levels of preferences (usually two or three) for all the time periods that each of them is available for teaching. While these preferences are embodied into the objective function, minimizing the total cost does not take into account the percent of the satised individuals. If the scheduling of a course period meets the corresponding teachers rst preferences, this is named a success, while failing to meet them, is named failure. The percentage of the total # of course periods that fell into the preferred intervals (success) calculated from the timetables that resulted from the two dierent solution approaches, when applied to problems #1 and #3, are tabulated in Table 3. Problem #1 is the small problem with the 139 time periods required for

Computation time Teaching periods 139 319 Single-stage IP model (minutes) 2.5 96 Relaxation approach (seconds) 16 85

S. Daskalaki, T. Birbas / European Journal of Operational Research 160 (2005) 106120 Table 3 Satisfaction levels achieved with the two dierent solution approaches Teachers satisfaction Successes Failures Total # of periods Problem #1 Single-stage IP model 133 (95.68%) 6 (4.32%) 139 Relaxation approach 131 (94.24%) 8 (5.76%) 139 Problem #3 Single-stage IP model 296 (92.79%) 23 (7.21%) 319

117

Relaxation approach 290 (90.91%) 29 (9.09%) 319

scheduling and problem #3 is the large problem with the 319 time periods required for scheduling. Using the two-stage approach (relaxation) for the two problems, the success rates are calculated to be 94.24% and 90.91% respectively. Comparing these rates with the corresponding ones, 95.68% and 92.79% respectively, from the single-stage approach (complete model) we conclude that the quality of the timetables is not reduced signicantly. Given the superior performance of the relaxation approach in computation time, this new fact makes it more preferable than the original one-stage approach. The values of the cost coecients in the objective function are dened using the so-called penalty functions. A possible scenario for such penalty functions is shown in Fig. 2. Given a two-level scheme for the teachers preferences, the cost coecients associated with a given teacher and a course are dened with the help of function f1, if a time period is preferred or with the help of function f2, if the time period is not preferred. Applying the values of functions f1 and f2, a typical assignment of values to the cost coecients ci;j;k;l;m;n that correspond to a given course m at a
200 180 160

given day i is also shown in Fig. 2 (the curve with the solid line). Next, the slopes of the functions f1 and f2 were examined, in order to test how they may inuence the nal solution from the IP model. For demonstration a new scenario for the functions f1 and f2, shown in Fig. 3, was utilized. Using only the relaxation approach for the solution of the IP model the resulting timetables from the two dierent scenarios were compared. Again, the timetables were compared on the basis of satisfying the teachers preferences for certain time periods. Table 4 presents the corresponding percentages for successes and failures, which show that with dierent penalty functions it is possible to inuence slightly the quality of the resulting timetables. Lastly, in a third scenario a three-level preference scheme was used and the three penalty functions for the denition of the ci;j;k;l;m;n cost coecients are shown in Fig. 4. Implementing these three penalty functions for the denition of the ci;j;k;l;m;n coecients, the percentage of successes reduces signicantly compared to the results received when penalty functions of Fig. 3 had been
1000 900

f2

800

Cost values

120 100 80 60 40 20 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14

Cost values

140

700 600 500 400 300 200 100 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14

f1

Time periods

Time periods

Fig. 2. Penalty functions for assigning values to cost coecients and a typical assignment of values to cost coecients that correspond to a given course at a given day.

Fig. 3. A new set of penalty functions for a two-level preference scheme.

118

S. Daskalaki, T. Birbas / European Journal of Operational Research 160 (2005) 106120

Table 4 Measuring the inuence of penalty functions on the quality of the timetables Teachers satisfaction Penalty functions of Fig. 2 (two-level preference scheme) (%) 92.16 7.84 Penalty functions of Fig. 3 (two-level preference scheme) (%) 93.42 6.58 Penalty functions of Fig. 4 (three-level preference scheme) (%) 86.83 13.16

Successes (1st choice only) Failures (2nd or 2nd and 3rd choice)

1000 900 800

Cost values

700 600 500 400 300 200 100 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14

Time periods

Fig. 4. Penalty functions for a three-level preference scheme.

implemented. This happens because many of the second choices are actually chosen for certain teachers. From this point of view it is preferable to use a two-level than a three-level scheme for declaring teachers preferences. 6. Further improvements for the timetabling model Given the good performance of the relaxation approach for the IP model in computational eciency, an eort was made to provide additional quality features for the users of the timetables. Two more features were added for testing again the performance of our model. The rst was to include lunch breaks for all students somewhere between 13:00 and 15:00 every day. This feature

may be implemented starting from the rst stage of the relaxation procedure or at the second stage (after viewing the daily assignments) and is achieved by adding a dummy course for every group of students requiring daily assignment for one time period in the aforementioned time interval. Another improvement to the timetabling model can be the requirement for balanced schedules during the week. This requirement may be achieved by setting an upper limit on the courses that are scheduled in any day for the same group of students. In order to test the model with these two additional requirements, problems #1 and #3 were solved and again teachers preferences were used as a measure for quantifying its performance. Table 5 shows that the addition of the requirement for lunch breaks in the small problem inuences quite signicantly the success and failure rates. The request for balanced schedules during the week also appears to inuence the success rate for the large problem, however the timetabler together with the educational institution may judge what is most important and decide accordingly. Lastly, it is important to note that the small computational times that the relaxation approach achieves and the two-stage procedure oer the possibility for an interactive usage, a feature that is not normally possible with IP formulations. On one side, the user may now use trial-and-error to adjust the values of the cost coecient in the objective function, and on another to add more em-

Table 5 Inuence of other quality features to teachers preferences satisfaction Without lunch breaks Successes Failures 131 (94.24%) 8 (5.76%) With lunch breaks 107 (76.98%) 32 (23.30%) Non-balanced timetables 290 (90.91%) 29 (9.09%) Balanced timetables 267 (83.70%) 52 (16.30%)

S. Daskalaki, T. Birbas / European Journal of Operational Research 160 (2005) 106120

119

bellishments to the timetable after viewing the results of the rst stage. 7. Summary and conclusions In this paper, a new solution approach for the IP model of a university timetabling problem has been presented. The solution is based on a relaxation procedure of certain constraints, which are very heavy computationally. These are the constraints that ensure consecutiveness for the multi-period sessions assigned to a given course. Following the same modeling approach presented in a previous work, it was easy to relax just those constraints that ensure consecutiveness but still maintain the constraints that assign a specic course to multiple periods of a given day. Thus, after the rst stage of the solution procedure, the resulting timetable carries assignments of courses to days with the right amount of time periods for each course. In the second stage, a re-arrangement is performed, so that consecutiveness is secured. This is achieved with the solution of additional IP models, one for each day of the week. The models at either stage of the proposed procedure may be implemented and solved with any commercial software package handling large IP problems. Computation time is reduced significantly compared to the single-stage direct solution of a model that takes care of all constraints at once. Furthermore, if we measure the performance through the satisfaction rate of the teachers preferences for certain time periods, instead of just the total cost, both solution procedures yield very comparable results, so combined with their performance in computation time the relaxation approach appears as the superior one. Moreover, this new performance measure can be used for further improvements in the IP model. Through a case study used for our problem, it is shown that it is possible to adjust the slopes of the penalty functions used for determining the values of the cost coecients in a way that improves the quality of the resulting timetables. Lastly, when computation time is not a burden, new requirements may still be added to the timetable, in order to make them more acceptable to all users involved.

References
[1] M.A. Badri, D.L. Davis, D.F. Davis, J. Hollingsworth, A multi-objective course scheduling model: Combining faculty preferences for courses and times, Computers and Operations Research 25 (4) (1998) 303316. [2] T. Birbas, S. Daskalaki, E. Housos, Timetabling for Greek high schools, Journal of Operational Research Society 48 (1997) 11911200. [3] T. Birbas, S. Daskalaki, E. Housos, Course and teacher scheduling in Hellenic high schools, in: 4th Balkan Conference on Operational Research, Thessaloniki, Greece, October 1997. [4] T. Birbas, S. Daskalaki, E. Housos, Rescheduling process of a school timetable: The case of the Hellenic high schools & lyceums, in: 5th International Conference of the Decision Sciences Institute, Athens, Greece, July 1999. [5] E.K. Burke, D.G. Elliman, R.F. Weare, A genetic algorithm for university timetabling, AISB Workshop on Evolutionary Computing, University of Leeds, UK, 1994, Society for the Study of Articial Intelligence and Simulation of Behaviour. [6] M.P. Carrasco, M.V. Rato, A multiobjective genetic algorithm for the class/teacher timetabling problem, in: E. Burke, W. Erben (Eds.), Practice and Theory of Timetabling III, Lecture Notes in Computer Science, 2079, Springer-Verlag, 2001, pp. 317. [7] D. Costa, A tabu search algorithm for computing an operational timetable, European Journal of Operational Research 76 (1994) 98110. [8] S. Daskalaki, T. Birbas, E. Housos, An integer programming formulation for a case study in university timetabling, European Journal of Operations Research 153 (1) (2004) 117135. [9] S.B. Deris, S. Omatu, H. Ohta, P. Samat, University timetabling by constraint-based reasoning: A case study, Journal of the Operational Research Society 48 (1997) 11781190. [10] M. Dimopoulou, P. Miliotis, Implementation of a university course and examination timetabling system, European Journal of Operational Research 130 (2001) 202213. [11] J.J. Dinkel, J. Mote, M.A. Venkataramanan, An ecient decision support system for academic course scheduling, Operations Research 37 (6) (1989) 853864. [12] A. Drexl, F. Salewski, Distribution requirements and compactness constraints in school timetabling, European Journal of Operational Research 102 (1997) 193214. [13] H.M.M. ten Eikelder, R.J. Willemen, Some complexity aspects of secondary school timetabling problems, in: E. Burke, W. Erben (Eds.), Practice & Theory of Timetabling III, Lecture Notes in Computer Science, 2079, SpringerVerlag, 2001, pp. 1827. [14] A. Hertz, Find a feasible course schedule using tabu search, Discrete Applied Mathematics 35 (1992) 255270. [15] L. Kang, G.M. White, A logic approach to the resolution of constraints in timetabling, European Journal of Operational Research 61 (1992) 306317.

120

S. Daskalaki, T. Birbas / European Journal of Operational Research 160 (2005) 106120 nique for university timetabling, in: E. Burke, W. Erben (Eds.), Practice and Theory of Timetabling III, Lecture Notes in Computer Science, 2079, Springer-Verlag, 2001, pp. 4863. [21] D. de Werra, An introduction to timetabling, European Journal of Operational Research 19 (1985) 151162. [22] D. de Werra, The combinatorics of timetabling, European Journal of Operational Research 96 (1997) 504 513. [23] K. Zervoudakis, P. Stamatopoulos, A generic objectoriented constraint-based model for university course timetabling, in: E. Burke, W. Erben (Eds.), Practice and Theory of Timetabling III, Lecture Notes in Computer Science, 2079, Springer-Verlag, 2001, pp. 28 47.

[16] B. Paechter, A. Cumming, H. Luchian, M. Petriuc, Two solutions to the general timetable problem using evolutionary methods, in: The Proceedings of the IEEE Conference on Evolutionary Computing, 1994. [17] A. Schaerf, Local search techniques for large high-school timetabling problems, IEEE Transactions on Systems, Man, and Cybernetics 29 (4) (1999) 368377. [18] A. Tripathy, School timetablinga case in large binary integer linear programming, Management Science 30 (12) (1984) 14731489. [19] A. Tripathy, Computerized decision aid for timetablinga case analysis, Discrete Applied Mathematics 35 (3) (1992) 313323. [20] H. Ueda, D. Ouchi, K. Takahashi, T. Miyahara, A coevolving timeslot/room assignment genetic algorithm tech-

You might also like