Transcript
Page 1: Design and implementation of a course scheduling system using Tabu Search

Production, Manufacturing and Logistics

Design and implementation of a course scheduling systemusing Tabu Search

Ramon Alvarez-Valdes a,*, Enric Crespo b, Jose M. Tamarit a

a Department of Statistics and Operations Research, Faculty of Mathematics, University of Valencia, Doctor Moliner 50,

46100 Burjassot, Valencia, Spainb Department of Financial and Mathematical Economy, University of Valencia, Valencia, Spain

Received 20 January 2000; accepted 12 January 2001

Abstract

Building a course timetable is a difficult and lengthy task which universities devote a large amount of human and

material resources to every year. We have developed a computer package to solve this problem. The program runs on a

PC and the user may set the objectives and parameters from among a wide range of possibilities. It has a user-friendly

interface for the user to input the relevant data and obtain the corresponding results. The optimization process is based

on a set of heuristic algorithms. The core is a Tabu Search procedure for which several strategies have been developed

and tested in order to get a fast and powerful algorithm. The first tests of the package have produced satisfactory

results. � 2002 Elsevier Science B.V. All rights reserved.

Keywords: Timetabling; University; Heuristics; Tabu Search

1. Introduction

The problem of building a university timetableconsists of assigning both starting and finishingtimes and an adequate room to each of the lessonsin the planned courses. This assignment has tosatisfy existing material constraints as well as otherconditions related to the way in which each uni-versity wants to organize its teaching. This prob-lem must be solved by the university

administration every year, or even term, and itinvolves a large amount of human and materialresources.The main difficulty is related to the size of the

problem. It involves a large number of students,teachers, courses and rooms, linked in many waysby objectives and conditions, and therefore eachsolution procedure must take into account verylarge numbers of variables and constraints.Moreover, the structure of the timetables variesfrom country to country, due to differences in theacademic systems. Even within one academic sys-tem there are major differences among universitiesdepending on the particular ways in which teach-ing is organized.

European Journal of Operational Research 137 (2002) 512–523www.elsevier.com/locate/dsw

*Corresponding author. Tel.: +34-96-3864308; fax: +34-96-

3864735.

E-mail address: [email protected] (R. Alvarez-Valdes).

0377-2217/02/$ - see front matter � 2002 Elsevier Science B.V. All rights reserved.

PII: S0377-2217 (01 )00091-1

Page 2: Design and implementation of a course scheduling system using Tabu Search

For these reasons, the problem of buildinguniversity timetables has been extensively studiedin Operations Research literature over the last 25years. The solution techniques have been evolvingalongside the developments in mathematics andcomputer sciences. The survey by Carter and La-porte [4] describes several subproblems which ap-pear in university timetabling: Course Timetabling,Class-Teacher Timetabling, Student Scheduling,Teacher Assignment and Classroom Assignment.Each real life problem contains a combination ofseveral of them, but will always include one of thefirst two subproblems.The solution techniques range from graph col-

oring to complex metaheuristic algorithms, in-cluding LP formulations and heuristics tailored tothe specific problem at hand. The more efficientprocedures which have appeared in recent yearsare based on metaheuristics. Hertz [13,14] hasapplied Tabu Search techniques, Dowsland [6] andElmohamed et al. [7] use simulated annealing andseveral authors like Burke et al. [3], Corne, Ross etal. [5] and Paetcher et al. [17] have developedprocedures based on variants of genetic algo-rithms. A different approach is Constraint LogicProgramming, as in Gu�eeret [12]. Finally, somecommercial packages have been developed such asACT [16], SAPHIR [8], Neeps and Tatties [18],reflecting the special characteristics of each aca-demic system.Carter and Laporte [4] distinguish course

timetabling problems as being either master time-table or demand driven systems. The main differ-ence between them lies in the sequence in which thesubproblems are solved. In master timetabling theassignment of times to lessons is done first andthen the students choose courses and sections frompublished timetables. In demand driven systems,the students first choose from a list of courses andfrom this information the number of sections ofeach course is determined and times are assignedto the lessons of these sections. A section is eachgroup into which a course is divided according tosize or language considerations.In the Spanish university system we have to

build a master timetable. Nevertheless, we thinkthat information about students’ individual coursechoices would be helpful in the process of building

the timetable. This information may come frompreregistration or can be taken from the students’registrations of previous years. With this infor-mation we solve two subproblems: assigning timesto lessons and assigning students to sections. Wedo it in an iterative way, where the solution of oneproblem is the starting point for the other one,until no further improvement is obtained. Theproblem of assigning students to sections is anauxiliary problem because that assignment is notgoing to be used in practice, but it helps to im-prove the results of the timetable being built.In this paper, we describe the development of

the program HORARIS. This program builds atimetable which is suitable for the characteristicsof the Spanish university system, though it takesparticular account of the special features of theUniversity of Valencia.In Section 2, we present the elements of the

problem, data, objectives and constraints. Thecomplete model appears in Section 3, where wedescribe its two subproblems and the relationshipbetween them. We focus our attention on theproblem of building the timetable, because thestudents’ assignment problem has been solvedelsewhere [1]. Section 4 develops the solutionprocedure, specially the Tabu Search algorithmwhich is its core. In Section 5, we describe thecharacteristics of the school in which we havetested our procedures, the numerical results ob-tained and the conclusions about the best strate-gies to be implemented in the computer program.Finally, in Section 6, we explain the features of theHORARIS program and its first real life test.

2. Data, objectives and constraints

A course timetabling problem has the followingelements:• A set of courses A ¼ fA1; . . . ;Aj; . . . ;Asg. Eachcourse has a fixed number of hours per weekwhich can be taught in one session or in severalsessions during the week.

• According to the number of students and otherconsiderations, each course Aj can be dividedinto a set of sections Sj ¼ fSj1; Sj2; . . . ; Sjnjgto be taught separately. For instance, our

R. Alvarez-Valdes et al. / European Journal of Operational Research 137 (2002) 512–523 513

Page 3: Design and implementation of a course scheduling system using Tabu Search

university is in a bilingual region (Spanish andCatalan) and some courses are offered in bothlanguages.

• A set of lessons L ¼S

j;k Ljk where j ¼ 1; . . . ; sand k ¼ 1; . . . ; nj. Lj;k are the lessons of sectionSjk. These lessons may have different lengths,even in the same course or section.

• A set of classes C ¼ fC1;C2; . . . ;Cng. A class is aset of courses taken, basically, by the samegroup of students. These classes are designedby the planners, in line with the academic struc-ture of the degrees offered and their past experi-ence of students’ choices. Each class will havequite a stable set of students and it is thereforevery important that their lessons will not betaught simultaneously.

• A set of teachers T ¼ fT1; T2; . . . ; Ttg. Each sec-tion of each course will have a teacher previ-ously assigned to it.

• A set of rooms R ¼ fR1;R2; . . . ;Rrg, which canbe of different types, including computer roomsand laboratories for specific subjects. Eachroom has a fixed capacity.

• A week, made up of a set of periods P ¼fP1; P2; . . . ; Ppg, and divided into days. Eachday has the same number of periods of equallength. The breaks and the non-teaching periodsmust be specified. The lessons lasting for morethan one period cannot be interrupted by abreak.

• It is also possible to have some preassignmentsor some forbidden periods for classes, sections,teachers or rooms.

2.1. Objectives and constraints

When we think of a good timetable we considerseveral types of conditions to be met though theseconditions are not all of the same importance. Wedistinguish, on the one hand, hard constraints, thatis, conditions that every acceptable timetable mustsatisfy. These constraints are:1. Every lesson has to be assigned to a period or anumber of periods, depending on the lesson’slength.

2. No teacher can give two simultaneous lessons.3. Two lessons of the same course cannot be as-signed to the same day.

4. No room can be assigned to two simultaneouslessons.

5. The room assigned to a given lesson must be ofthe required type.

6. All the preassignments and forbidden periodsfor classes, sections, teachers and rooms mustbe respected.

Our university has one more type of constraints. Inmany cases there are theoretical and practicalcourses in which the student must register simul-taneously. Their sections are organized in such away that sections of the practical course are con-sidered as subsets of sections of the theoretical one.For instance, if there are three sections A, B, C of atheoretical course, it is quite common to have ninesections of the practical course, AA, AB, AC, BA,BB, BC, CA, CB, CC, linked according to the firstletter. The University wants a student assigned tosection A in the first course to be assigned to sec-tion AA or AB or AC in the second one.On the other hand, there are some conditions

that are considered helpful but not essential in agood timetable. The more these conditions aresatisfied, the better the timetable will be. We callthem soft constraints and therefore they will have aweight in the objective function. We group theseobjectives according to the elements they involve.1. For classes:

• Simultaneity of lessons of one class should beavoided, because a group of students haveregistered for all the courses of the class. Thisis usually the most important objective for us-ers.

• Class timetables should be as compact as pos-sible, eliminating idle times for students.

• The number of moves from one room to an-other of students belonging to one classshould be minimized. Each class should haveits lessons assigned to a minimum number ofdifferent rooms.

2. For students, taken individually:• Simultaneity of lessons of the sections inwhich he/she is enrolled should be avoided.Note that many students do not belong to adefined class, but choose their own set ofcourses.

• Students’ individual timetables should be asgood as possible. The quality of a timetable

514 R. Alvarez-Valdes et al. / European Journal of Operational Research 137 (2002) 512–523

Page 4: Design and implementation of a course scheduling system using Tabu Search

is measured according to criteria such as thenumber of lessons per day, the idle times be-tween lessons, the moves between rooms,buildings and campuses and the respect fortheir language preferences.

3. For teachers, their non-desired periods shouldbe avoided.

4. For rooms, the objective is adjusting their ca-pacity to the number of students enrolled in sec-tions assigned to them.

5. The sections of a course should be balancedwith regard to the number of students assignedto them.

6. Each university also has its own specific objec-tives. We have tried to include in our programthose which are more important and thosewhich are usual. The objectives explicitly usedin our tests are described in Section 5.

3. Problem formulation

The problem can be formulated as follows:

Min f ðx; yÞs:t: x 2 Sx; y 2 Sy :

Variables x represent the array of assignments oflessons to starting periods and rooms and vari-ables y the vector of assignments of students tosections. The function f ðx; yÞ is the value of eachtimetable for x and y given. The sets Sx and Sy arethe feasible sets according to the hard constraintsdescribed above.The solution procedure decomposes the prob-

lem into two components which are solved insuccessive steps. These components, though solvedseparately, interact in a global process. For a givencourse timetable, the problem is that of assigningstudents to sections which maximize the quality ofindividual timetables while keeping sections bal-anced. When the students’ assignments are fixed,the problem is building the best course timetable.This strategy follows that of Aubin and Ferland[2].The steps to follow in the process of Fig. 1 are:Step 0: Initialization� Let x� be a course timetabling feasible solu-tion.

Step 1: Student assignment problem� Given x ¼ x�, determine the best solution y0

for the student assignment problem.� f � ¼ f ðx�; y0Þ. Go to Step 2.Step 2: Master timetabling problem�Given y ¼ y0, determine the best solution x0 forthe course timetabling problem� If f �

6 f ðx0; y0Þ, stop. Otherwise, f � ¼ f ðx0; y0Þ,x� ¼ x0. Go to Step 1.

When using our program HORARIS, it is possibleto build a master timetable without solving thesubproblem of the students’ assignment to sec-tions, that is, without taking into account the in-formation about the students’ choices. This is thestrategy usually followed by the planners whenbuilding manual timetables.However, this strategy presents two main

drawbacks. On the one hand, the students notchoosing the courses defined for a class are nottaken into account. On the other hand, for thesections not belonging to a class we do not haveany assignment criterion. If we know the students’choices, we can assign these sections to periodswhich minimize simultaneity conflicts in students’timetables.For solving the subproblem of students’ as-

signment to sections, we use a procedure devel-oped in 1996 [1] which combines two procedures.First, an algorithm based on the construction ofmaximal independent sets obtains a set of goodtimetables for each student. Then, a Tabu Searchprocess looks for a balance in the number of stu-dents assigned to the sections of every course, withminimum deterioration of the quality of individualtimetables.Therefore, we focus our attention here on the

problem of building a course timetable, consider-ing the student assignment to sections as fixed. Inorder to give an integer programming formulation,we define the variables:

TimetablingProblem

StudentsAssignment

Problem

Fig. 1. Relationship between the two subproblems.

R. Alvarez-Valdes et al. / European Journal of Operational Research 137 (2002) 512–523 515

Page 5: Design and implementation of a course scheduling system using Tabu Search

xita ¼1 if lesson i starts at period t in room a;0 otherwise:

Besides the sets defined in Section 2, we need thefollowing elements:

The problem is:

Min xcfcðxÞ þ xstfstðx; y�Þþ xtftðxÞ þ xrfrðxÞ þ xscfscðxÞ

subject to

8i 2 L;Xa

Xt

xita ¼ 1; ð1Þ

8t 2 P; 8k 2 T;

Xa

Xi2LTk

Xt

s¼t�diþ1xisa 6 1;

ð2Þ

8Sjk 2 S; 8l 2 D;Xa

Xt2Pl

Xi2Ljk

xita 6 1;ð3Þ

8a 2 R; 8t 2 P;

Xi

Xt

s¼t�diþ1xisa 6 1;

ð4Þ

8t 2 P; 8r 2 TR;

Xa2Rr

Xi2LRr

Xt

s¼t�diþ1xisa 6mrt;

ð5Þ

8i 2 F;Xa

xipia ¼ 1; ð6Þ

8i 2 L;Xa

Xt2Ui

Xt

s¼t�diþ1xisa ¼ 0: ð7Þ

In the objective function x is the array of variablesxita and y� is the assignment of students to sections.Each objective appears with its correspondingweight x: xc corresponds to classes, xst to stu-dents, xt to teachers, xr to rooms and xsc to thespecific objectives of centre. Constraints (1)–(7) arethe conditions every feasible timetable must sat-isfy.This formulation cannot be solved by exact

methods. Firstly, the number of variables wouldbe too large. Secondly, some parts of the objectivefunction are non-linear, because they involve theassignment of more than one lesson to periods.That is the case of the simultaneity of lessons ofone class or the moves between rooms. If weconsider only the relation between pairs of lessons,the problem has a quadratic formulation, as inFerland and Roy [9]. For some specific objectives,like having the lessons of a course evenly spreadover the week, more complex relationships areneeded.

4. Solution method

The algorithm for building a course timetablehas three phases:1. Phase I: Constructing an initial timetable.2. Phase II: Improving the timetable built in PhaseI.

3. Phase III: Improving the room assignment.Building the timetable involves the assignment oflessons to rooms. Nevertheless, it is quite frequent,for reasons of simplicity, for rooms to be assignedas a last step after the assignment of lessons toperiods. In HORARIS we have adopted a mixedstrategy. In Phases I and II rooms are taken intoaccount and are assigned to lessons, but they donot have a large weight in the objective function.Phase III improves room assignment withoutchanging the assignment of lessons to periods.In our algorithmic scheme, the Tabu Search

algorithm of Phase II is the most important part.Phases I and III prepare and marginally improve

LTk Set of lessons of teacher TkD Set of daysdi Duration of lesson iPl Periods of day lpi Preassigned period for lesson imrt Number of rooms of type r avalaible at

period tRr Set of rooms of type rLRr Lessons requiring rooms of type rTR Different types of roomsF Set of preassigned lessonsUi Set of forbidden periods for lesson i

516 R. Alvarez-Valdes et al. / European Journal of Operational Research 137 (2002) 512–523

Page 6: Design and implementation of a course scheduling system using Tabu Search

the results of Phase II. When solving a timetablingproblem, Phase I is used only once at the begin-ning of the solution process to produce an initialsolution. Phases II and III can be called severaltimes, changing the search parameters and/or theobjective function weights, in order to exploredifferent feasible solutions.

4.1. Phase I: Building an initial timetable

The timetable is built by taking the lessonsone at a time, first of all those preassigned toperiods, then those of sections belonging to aclass and finally those of sections not belongingto a class.Classes are taken sequentially, according to

the priority given by the user. Before assigningperiods to lessons, we assign to the class a roomwhere the teaching of the class will wheneverpossible take place, thus trying to minimize thenumber of moves. Then, we take one section at atime and assign its lessons. The order in whichthe sections are taken depends on the numberand length of a section’s lessons. Each lesson isassigned to the period of minimum value of theobjective function.Sections not belonging to a class are taken se-

quentially, prioritized by the ratio of the totallength of lessons to the number of possible peri-ods. The lessons are assigned to the best periodaccording to the objective function and the roomsare chosen trying to adjust their capacities to thenumber of students of the section.

4.2. Phase II: Improving the initial timetable

In order to design a powerful algorithm wehave developed and tested several strategies foreach element of Tabu Search [11]. Overall, 52different combinations of elements have been triedin order to determine the best characteristics of thealgorithm to be implemented in the program.The elements of the Tabu Search procedure are

as follows.

4.2.1. The solution space XThe set of solutions satisfying constraints (1)–

(7).

4.2.2. The objective functionThis is the combination of objectives with

weights given by the user as appears in Section 3.

4.2.3. The neighborhood NðsÞWe have defined three alternative neighbor-

hoods created by the following moves:• The simple move in which a solution s0 2 X isa neighbor of solution s 2 X if it can be ob-tained from s by changing the assignment ofone lesson l from one period t to anotherperiod t0.

• The swap or interchange of lessons, in which asolution s0 2 X is a neighbor of solution s 2 Xif it can be obtained by interchanging the peri-ods assigned to two lessons l and l0.

• The multiswap or multiple change of lessons (seeFig. 2). We take a lesson l, assigned to periodst; t þ 1; . . . ; and change its assignment to periodst0; t0 þ 1; . . . Then, the lessons l1; l2; . . . ; ln whichwere assigned to these periods t0; t0 þ 1; . . . arenow assigned to t; t þ 1; . . .

In all the cases a lesson l with d periods of durationcan be assigned to period t only if there is anavailable room in periods t; t þ 1; . . . ; t þ d � 1.Hence, the move can modify the previous roomassignment.We decided to try increasingly complex moves

because it was very difficult to move in the neigh-borhood defined by the simple move. Quite oftengood assignments for a lesson, according to theobjective function, were impossible due to roomshortages. The second type of move, swap, allowedus to overcome this problem, because the lessonscan interchange their rooms. Nevertheless, the

Fig. 2. Multiswap outline.

R. Alvarez-Valdes et al. / European Journal of Operational Research 137 (2002) 512–523 517

Page 7: Design and implementation of a course scheduling system using Tabu Search

swap is not powerful enough for situations likethese:• When we try to interchange lessons of differentlengths, the periods assigned to the shortestone are not sufficient to accommodate the long-est, and therefore some other lessons should beinvolved in the move.

• When we want to move a theoretical lesson of asection (section A) to the periods assigned to aset of practical lessons (sections AA, AB andAC), we should move all these three lessons inorder to avoid conflicts.

The multiswap allows major changes in the solu-tion structure, thus producing a greater diversifi-cation in the search process.

4.2.4. The tabu listThe tabu list keeps, for every iteration, the

lesson starting the change and its initial period.We have used lists with a constant length of 24

and dynamically changing lists in which lengthvaries between 6 and 48. The value 24 has beenchosen taking as reference the square root of thenumber of lessons in the problem, as is usual inmany implementations of Tabu Search. Never-theless, additional testing shows that the perfor-mance of the algorithm is quite robust to changesin the list length. For dynamically changing listlengths, the value is randomly chosen in the in-terval ð0:25l; 2lÞ, where l is the length of the staticlist.

4.2.5. The aspiration criterionIf an explored move produces a solution s0 with

objective function lower than the best current so-lution, the move is made in spite of its tabu status.

4.2.6. Selection of movesFor a given solution s, it is computationally too

expensive to explore its whole neighborhood NðsÞ.We determine which lesson to move by two dif-ferent methods. In the first one, we choose it ran-domly from among all the lessons. In the second,we make a list of candidates. If the solution s hassome conflicts of simultaneity among the lessonsof a class, these lessons will constitute the list. Ifthere are no conflicts of this type, all lessons suchthat when leaving their assigned periods produce

an improvement of the objective function makepart of the list. Once the lesson has been chosen,all its possible periods are explored.The use of a candidate list is an intensification

strategy that tries to reduce the search to themoves which are more likely to improve the ob-jective function.

4.2.7. Strategic oscillationWe have developed a strategic oscillation [15] of

the search consisting of temporal changes of theobjective function. More precisely, for a givennumber of iterations some of the weights of thecomponents of the objective function are set tozero. Therefore, for some iterations the corre-sponding objectives are not considered whenlooking for better solutions.This oscillation is a diversification strategy

which leads the search to unexplored regions in thesolution space.

4.2.8. Recovering the best current solutionWe have also tested the strategy of recovering

the best solution found if the process has not im-proved it after a given number of iterations. It isan intensification strategy in which we concentratethe search once again in the neighborhood of goodsolutions.

4.3. Phase III: Improving the room assignment

In previous phases, the assignment of a lessonto a period always involves a feasible room as-signment. In the last phase of the procedure weimprove the room assignment without changingthe assignment of lessons to periods. The objectiveis to reduce to a minimum the number of roomchanges for classes.In our objective function the cost of assigning a

room for a lesson has two components: a fixedcost, related to room capacity and the number ofstudents attending the lesson, and a variable costthat accounts for the changes of rooms and de-pends on the rooms of previous and posteriorlessons. This second aspect differs from other ex-isting approaches [4,10]. Therefore, we need aspecific algorithm for this case. We decided toimplement a simple and fast heuristic procedure

518 R. Alvarez-Valdes et al. / European Journal of Operational Research 137 (2002) 512–523

Page 8: Design and implementation of a course scheduling system using Tabu Search

because this last phase only aims to obtain mar-ginal improvements.The heuristic algorithm has two linked proce-

dures. First, given a lesson with its correspondingroom we try to propagate this room to adjacentlessons, that is, we try to use this room in lessonsgiven consecutively to the same class, avoidingmoves between rooms. The move we exploreconsists of changing the room of one of these ad-jacent lessons, if it improves the objective function.Second, we identify the room used more often by aclass and try to assign it to the lessons of that classwhich have been assigned to other rooms. Again,the move consists of changing the assignment of aroom for one of these lessons. The algorithmworks sequentially, taking the classes according toa user-defined priority.

5. Numerical results

The University of Valencia, Spain, has 65 000students divided into four main areas: SocialSciences, Health Sciences, Humanities and Basicand Technical Sciences. Each area has severalFaculties or Schools that are responsible for theacademic organization, including the coursetimetables. The area of Social Sciences containsthe largest number of students and the Facultiesand Schools of this area face the most complexscheduling problems. From among them, theBusiness School was selected for the compu-tational tests. This School offers a three-yearDegree in Business Administration. Coursescheduling is done on a semester basis. For in-stance, in the first semester of the academic year1997/98 there were 4300 students registered, 84courses with 724 sections, some of them defininga total of 93 classes. More than 200 teachers gave993 lessons per week. The school week had 13periods per day, Monday to Friday, with a lunchbreak. The School has 24 rooms with an averageuse of 83%.There are some specific requirements to be ad-

ded to the problem. The classes of the first andsecond year must have two free days dedicated tooptional courses. It is convenient for sections ofpractical subjects linked to a theoretical course not

to be simultaneous, in order to allow the sameteacher for all of them. The solution would be evenbetter if these sections were consecutive. Finally,for courses with more than one lesson per week, itwould be convenient for these lessons to be as-signed to the same time every day and to be spreadout evenly throughout the week.The weights of the objective function compo-

nents appear in Table 1, where we note thatavoiding simultaneity conflicts for a class is themost important criterion for the users. In this case,the School is located in one building and so thereare no moves between buildings. Also, informationabout teacher preferences was not available andwas therefore not included.

5.1. Analysis of Phase II results

The combination of strategies has produced 48different implementations of Tabu Search algo-rithm. When we run them on the test problemdescribed above, we obtain the 48 values of Tables2–4.

Table 1

Weights of criteria

Criterion Element

involved

Weight

1 Conflicts of simultaneity Class 5000

2 Compactness of

timetable

Class 100

3 Moves between

buildings without break

Class 200

4 Moves between

buildings with break

Class 100

5 Changes of room Class/

room

50

6 Use of the same room Class 100

7 Simultaneity conflicts Students 1

8 Forbidden periods Teacher 100

9 Non-desired periods Teacher 5

10 Lessons at the same

time of the day

Section 10

11 Lessons spread out in

the week

Section 10

12 Simultaneity of

practical lessons

Section 100

13 Non-consecutive

practical lessons

Section 10

14 Excess of students Room 5

15 Empty seats Room 1

R. Alvarez-Valdes et al. / European Journal of Operational Research 137 (2002) 512–523 519

Page 9: Design and implementation of a course scheduling system using Tabu Search

We have analyzed these results to determine thebest combination of strategies. We have used ananalysis of variance to evaluate the influence ofstrategies on the solutions. We consider as signif-icant the factors or interactions with a level ofsignificance (SL) lower than a ¼ 0:05.The type of move is the most influential factor

with a SL < 0:0001. The average values of the so-lutions for the simple move, swap and multiswapwere 81935.7, 62534.8 and 61821.7, respectively. Itis clear that a simple move produces results sig-nificantly worse than the other two moves. Wetherefore decided to eliminate the simple move andstudy the remaining 32 cases in Tables 3 and 4, inorder to avoid possible interferences of those lowquality results.

We repeated the analysis of variance for the 32values and the results show that the small differ-ence in favor of multiswap is not significant(SL ¼ 0:1455Þ. Instead, the strategy used with thecandidate list is the most influential factor(SL < 0:0001Þ). The average result with a candi-date list (64431:3) is clearly worse than that ob-tained without a candidate list (59925:2).The type of tabu list is also a significant factor

ðSL ¼ 0:0003Þ. If we use a dynamically changingtabu list length we obtain a better average(61091.9) than by using a static list length(63264.6). The strategic oscillation of the weightvector is also significant ðSL ¼ 0:0361Þ, with anaverage of 61652.7 when we oscillate and 62703:7if we do not. Recovering the best known solution

Table 2

Results of simple move

With candidate list Without candidate list

Recover Non-recover Recover Non-recover

Static tabu list Change weights 77 046 77 387 86 842 87 003

Non-change weights 77 046 77 387 86 529 87 003

Dynamic tabu list Change weights 77 486 74 845 87 002 86 692

Non-change weights 75 783 77 863 86 992 87 003

Table 4

Results of multiswap

With candidate list Without candidate list

Recover Non-recover Recover Non-recover

Static tabu list Change weights 65 398 64 764 59 717 58 614

Non-change weights 66 467 67 036 60 116 61 948

Dynamic tabu list Change weights 63 213 65 246 57 150 54 801

Non-change weights 64 341 64 695 58 691 56 950

Table 3

Results of swap

With candidate list Without candidate list

Recover Non-recover Recover Non-recover

Static tabu list Change weights 63 320 62 836 59 579 65 092

Non-change weights 64 638 65 232 60 944 66 533

Dynamic tabu list Change weights 63 399 63 467 59 791 60 057

Non-change weights 63 607 63 242 59 381 59 439

520 R. Alvarez-Valdes et al. / European Journal of Operational Research 137 (2002) 512–523

Page 10: Design and implementation of a course scheduling system using Tabu Search

is not significantly influential ðSL ¼ 0:1902Þ, butthe results are slightly better when we do recover(61859.5 vs 62497.0).If we look at the interactions between factors,

the only interaction that can be considered signif-icant is that between the type of move and the useof a candidate list (SL ¼ 0:0003). The combinationof multiswap with the strategy of not using acandidate list produces very good results, as can beseen in Fig. 3.An illustration of the counterintuitive behavior

of the candidate list is Fig. 4, which shows the

evolution of the solutions of both strategies in anexample. Though the implementation with a can-didate list finds better solutions in the first itera-tions, in the long run it is overtaken by theimplementation without a candidate list. The rea-son may be that when working with an aggressivemove, as is multiswap, the random choice of themove allows the search to explore the solutionspace better if a large number of iterations is per-formed. However, the strategy without a candidatelist may take many iterations to obtain solutionswithout simultaneity conflicts for classes, whichare the largest component of the objective func-tion. In the example of Fig. 4, if we use a candidatelist, a solution without conflicts is obtained in thefirst 100 iterations while without a candidate list aconflict-free solution is not obtained in the first12 000.Therefore in hard problems, or when the

user does not allow the algorithm to performmany iterations, we could end up without a so-lution free of conflicts, despite the fact that theyexist.As that situation would not be acceptable for

the user, we designed a mixed strategy. We use acandidate list until a solution without conflicts isfound and from that iteration onwards we do notuse it. We compared these three strategies fixingthe multiswap and dynamic tabu list. The resultsappear in Table 5.Doing an analysis of variance once again we

found that the use of a candidate list is a signifi-cant factor (SL ¼ 0:0079). We then performed aNewman–Keuls test of multiple comparisons tofind where the significant differences among thethree strategies lie. The results of the test show thatthere is no significant difference between the tem-poral use (average value 57460.5) and the non-useof the list (average 56898.0), but there are signifi-cant differences between these two cases with thecontinuous use of a candidate list (average64373.7).

5.1.1. Conclusions for implementing the computerprogram HORARISTaking into account the above results, the

computer program was implemented with the fol-lowing characteristics:

66

64

62

60

58

0 1Without list With list

2 Swap

3 Multiswap

Cos

t x 1

000

2

2

3

3

Fig. 3. Interaction between type of move and use of candidate

list.

Fig. 4. Evolution of the objective function with and without

candidate list.

R. Alvarez-Valdes et al. / European Journal of Operational Research 137 (2002) 512–523 521

Page 11: Design and implementation of a course scheduling system using Tabu Search

• The move is multiswap.• Temporal use of candidate list.• Tabu list with dynamically changing length.• Strategic oscillation of weights.• Recovering the best known solution after a gi-ven number of iterations without improving.

5.2. Results of Phase III of room assignmentimprovement

The average number of room changes beforeimproving the room assignment was 389, slightlymore than four changes per class. The improve-ment process reduces the changes by 4.5%.The other objective involving the rooms is to

concentrate all the theoretical lessons of a class inone room and all its practical lessons in anotherroom. At the end of Phase II, only three lessonsper class, on average, did not satisfy this condition.The improvement process reduces this situation by7%.The joint improvement in these two objectives,

according to their weights in the objective func-tion, is 4.64% in the global value of the solution.This result confirms the usefulness of this fastimprovement procedure.

6. The program HORARIS

6.1. Characteristics

The algorithms described above have been im-plemented in the program HORARIS, coded inC++. The program is designed to run on a PC witha Pentium processor, because this is the usualequipment of School and Faculty administrations.

The interface has been designed on Windows,with three types of screens for inputting data, in-teracting with the solution procedure and obtain-ing the results.The data editing windows allow the user to

input and modify the characteristics of the centre(starting and finishing times every day, breaks,length of period), the courses (number and lengthof their lessons), the sections (forbidden periods),the classes (composition, priority, forbidden peri-ods) and the teachers (forbidden and non-desiredperiods). Other information involving students’registration and fixed data about courses andteachers are directly read from the correspondingfiles of the university computing centre.The windows of interaction with the solution

procedure allow the user to modify the weights ofthe objective function criteria, start the solutionprocess and stop it when it is considered conve-nient. The program is continuously giving infor-mation about the quality of the best currentsolution. Besides the possibility of building atimetable from scratch, it is also possible to im-prove a given timetable. In this case, the programskips Phase I and proceeds to Phases II and III.The output windows show the timetable from

several points of view: classes, courses, teachers orrooms. This information can be printed or saved inASCII files to be used with other programs.

6.2. A test for academic year 1999–2000

The Business School has tested the program forbuilding the timetables for the academic year1999–2000 and compared them with their manualtimetables.The main problem when building the timetable

is planning the third year in which the students

Table 5

Results of the three strategies for the use of candidate list

With candidate list Without candidate list Temporal use of list

Recover Non-recover Recover Non-recover Recover Non-recover

Change weights 63 213 65 246 57 150 54 801 58 551 57 180

Non-change weights 64 341 64 695 58 691 56 950 58 829 55 282

522 R. Alvarez-Valdes et al. / European Journal of Operational Research 137 (2002) 512–523

Page 12: Design and implementation of a course scheduling system using Tabu Search

may choose from among several streams of op-tional subjects, each one leading to a differentprofessional orientation (Business Management,Foreign Commerce, Financial Management, Ac-counting and Auditing). Some courses may beshared by several streams and students of thesecond year may also choose them as a comple-ment to their compulsory subjects. Due to thecomplexity of this problem, the manual timetablesdo not address it as a whole, but consider eachcourse separately.The problem was solved by the program

HORARIS and the results were considered satis-factory by School administrators, specially in theaspects corresponding to the third year, for whicha global solution without simultaneity conflicts forclasses was provided.

Acknowledgements

We are very grateful to the anonymous refereesfor their helpful comments and suggestions thathave contributed to clarifying and improving thispaper.

References

[1] R. Alvarez-Vald�ees, E. Crespo, J.M. Tamarit, Assigningstudents to course sections using Tabu Search, Annals of

Operations Research 96 (2000) 1–16.

[2] J. Aubin, J.A. Ferland, A large scale timetabling problem,

Computers and Operations Research 16 (1) (1989) 67–77.

[3] E. Burke, J.P. Newall, R.F. Weare, A memetic algorithm

for university exam timetabling, in: E. Burke, P. Ross

(Eds.), Practice and Theory of Automated Timetabling,

Lecture Notes in Computer Science, vol. 1153, Springer,

Berlin, 1996, pp. 241–250.

[4] M.W. Carter, G. Laporte, Recent developments in prac-

tical course timetabling, in: E. Burke, M. Carter (Eds.),

Practice and Theory of Automated Timetabling II,

Lecture Notes in Computer Science, vol. 1408, Springer,

Berlin, 1997, pp. 3–19.

[5] D. Corne, P. Ross, Peckish initialisation estrategies for

evolutionary timetabling, in: E. Burke, P. Ross (Eds.),

Practice and Theory of Automated Timetabling, Lecture

Notes in Computer Science, vol. 1153, Springer, Berlin,

1996, pp. 227–240.

[6] K.A. Dowsland, A timetabling problem in which clashes

are inevitable, JORS 41 (10) (1990) 907–918.

[7] M.A.S. Elmohamed, P. Coddington, G. Fox, A compar-

ison of annealing techniques for academic course sched-

uling, in: E. Burke, M. Carter (Eds.), Practice and Theory

of Automated Timetabling II, Lecture Notes in Computer

Science, vol. 1408, Springer, Berlin, 1997, pp. 92–112.

[8] J.A. Ferland, C. Fleurent, SAPHIR: A decision support

system for course scheduling, Interfaces 24 (2) (1994) 105–

115.

[9] J.A. Ferland, S. Roy, Timetabling problem for university

as assignment of activities to resources, Computers and

Operations Research 12 (2) (1985) 207–218.

[10] C.R. Glassey, M. Mizrach, A decision support system for

assigning classes to rooms, Interfaces 16 (5) (1986) 92–

100.

[11] F. Glover, M. Laguna, Tabu Search, Kluwer Academic

Publishers, Dordrecht, 1997.

[12] C. Gu�eeret, N. Jussien, P. Boizumault, C. Prins, Buildinguniversity timetables using constraint logic programming,

in: E. Burke, P. Ross (Eds.), Practice and Theory of

Automated Timetabling, Lecture Notes in Computer

Science, vol. 1153, Springer, Berlin, 1995, pp. 130–145.

[13] A. Hertz, Tabu Search for large scale timetabling prob-

lems, EJOR 54 (1991) 39–47.

[14] A. Hertz, Finding a feasible course schedule using Tabu

Search, Discrete Applied Mathematics 35 (1992) 255–

270.

[15] J.P. Kelly, B.L. Golden, A.A. Assad, Large-scale con-

trolled rounding using Tabu Search with strategic oscil-

lation, Annals of Operations Research 41 (1993) 69–84.

[16] K. MyounJae, K. TaeChoong, Development of automatic

class timetabler (ACT) for university, in: Proceedings of

Second International Conference on the Practice and

Theory of Automated Timetabling, Toronto, 1997, pp.

182–186.

[17] B. Paechter, A. Cumming, M.G. Norman, H. Luchian,

Extensions to a memetic timetabling system, in: E. Burke,

P. Ross (Eds.), Practice and Theory of Automated

Timetabling, Lecture Notes in Computer Science, vol.

1153, Springer, Berlin, 1996, pp. 251–265.

[18] B. Paechter, R.C. Rankin, A. Cumming, T.C. Fogarty,

Timetabling the classes of an entire university with an

evolutionary algorithm, Parallel Problem Solving from

Nature (PPSN)V, Springer LNCS 1498, 1998.

R. Alvarez-Valdes et al. / European Journal of Operational Research 137 (2002) 512–523 523


Top Related