# Design and implementation of a course scheduling system using Tabu Search

Post on 04-Jul-2016

215 views

TRANSCRIPT

Production, Manufacturing and LogisticsDesign and implementation of a course scheduling systemusing Tabu SearchRamon Alvarez-Valdes a,*, Enric Crespo b, Jose M. Tamarit aa 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, SpainReceived 20 January 2000; accepted 12 January 2001AbstractBuilding a course timetable is a dicult and lengthy task which universities devote a large amount of human andmaterial resources to every year. We have developed a computer package to solve this problem. The program runs on aPC and the user may set the objectives and parameters from among a wide range of possibilities. It has a user-friendlyinterface for the user to input the relevant data and obtain the corresponding results. The optimization process is basedon a set of heuristic algorithms. The core is a Tabu Search procedure for which several strategies have been developedand tested in order to get a fast and powerful algorithm. The rst tests of the package have produced satisfactoryresults. 2002 Elsevier Science B.V. All rights reserved.Keywords: Timetabling; University; Heuristics; Tabu Search1. IntroductionThe problem of building a university timetableconsists of assigning both starting and nishingtimes 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 universityadministration every year, or even term, and itinvolves a large amount of human and materialresources.The main diculty is related to the size of theproblem. 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 dierences in theacademic systems. Even within one academic sys-tem there are major dierences among universitiesdepending on the particular ways in which teach-ing is organized.European Journal of Operational Research 137 (2002) 512523www.elsevier.com/locate/dsw*Corresponding author. Tel.: +34-96-3864308; fax: +34-96-3864735.E-mail address: ramon.alvarez@uv.es (R. Alvarez-Valdes).0377-2217/02/$ - see front matter 2002 Elsevier Science B.V. All rights reserved.PII: S0377-2217 (01 )00091-1For 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 therst two subproblems.The solution techniques range from graph col-oring to complex metaheuristic algorithms, in-cluding LP formulations and heuristics tailored tothe specic problem at hand. The more ecientprocedures 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 dierent approach is Constraint LogicProgramming, as in Gueeret [12]. Finally, somecommercial packages have been developed such asACT [16], SAPHIR [8], Neeps and Tatties [18],reecting the special characteristics of each aca-demic system.Carter and Laporte [4] distinguish coursetimetabling problems as being either master time-table or demand driven systems. The main dier-ence between them lies in the sequence in which thesubproblems are solved. In master timetabling theassignment of times to lessons is done rst andthen the students choose courses and sections frompublished timetables. In demand driven systems,the students rst 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 tobuild a master timetable. Nevertheless, we thinkthat information about students individual coursechoices would be helpful in the process of buildingthe timetable. This information may come frompreregistration or can be taken from the studentsregistrations 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 ofthe 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 theproblem, 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 rst real life test.2. Data, objectives and constraintsA course timetabling problem has the followingelements: A set of courses A fA1; . . . ;Aj; . . . ;Asg. Eachcourse has a xed 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, ourR. Alvarez-Valdes et al. / European Journal of Operational Research 137 (2002) 512523 513university is in a bilingual region (Spanish andCatalan) and some courses are oered in bothlanguages. A set of lessons L Sj;k Ljk where j 1; . . . ; sand k 1; . . . ; nj. Lj;k are the lessons of sectionSjk. These lessons may have dierent 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 oered 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 dierent types, including computer roomsand laboratories for specic subjects. Eachroom has a xed 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 specied. 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 constraintsWhen 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 lessonslength.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 rstletter. The University wants a student assigned tosection A in the rst course to be assigned to sec-tion AA or AB or AC in the second one.On the other hand, there are some conditionsthat are considered helpful but not essential in agood timetable. The more these conditions aresatised, 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 ofdierent 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 adened class, but choose their own set ofcourses. Students individual timetables should be asgood as possible. The quality of a timetable514 R. Alvarez-Valdes et al. / European Journal of Operational Research 137 (2002) 512523is 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 specic 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 formulationThe problem can be formulated as follows:Min f x; ys: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 xed,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 y0for the student assignment problem. f f x; y0. Go to Step 2.Step 2: Master timetabling problemGiven 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 maindrawbacks. On the one hand, the students notchoosing the courses dened 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 studentschoices, we can assign these sections to periodswhich minimize simultaneity conicts in studentstimetables.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 theproblem of building a course timetable, consider-ing the student assignment to sections as xed. Inorder to give an integer programming formulation,we dene the variables:TimetablingProblemStudentsAssignmentProblemFig. 1. Relationship between the two subproblems.R. Alvarez-Valdes et al. / European Journal of Operational Research 137 (2002) 512523 515xita 1 if lesson i starts at period t in room a;0 otherwise:Besides the sets dened in Section 2, we need thefollowing elements:The problem is:Min xcfcx xstfstx; y xtftx xrfrx xscfscxsubject to8i 2L;XaXtxita 1; 18t 2 P; 8k 2T;XaXi2LTkXtstdi1xisa6 1;28Sjk 2S; 8l 2 D;XaXt2PlXi2Ljkxita6 1; 38a 2 R; 8t 2 P;XiXtstdi1xisa6 1;48t 2 P; 8r 2 TR;Xa2RrXi2LRrXtstdi1xisa6mrt;58i 2F;Xaxipia 1; 68i 2L;XaXt2UiXtstdi1xisa 0: 7In 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 thespecic objectives of centre. Constraints (1)(7) arethe conditions every feasible timetable must sat-isfy.This formulation cannot be solved by exactmethods. 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 specic objectives,like having the lessons of a course evenly spreadover the week, more complex relationships areneeded.4. Solution methodThe 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 Searchalgorithm of Phase II is the most important part.Phases I and III prepare and marginally improveLTk 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 atperiod tRr Set of rooms of type rLRr Lessons requiring rooms of type rTR Dierent types of roomsF Set of preassigned lessonsUi Set of forbidden periods for lesson i516 R. Alvarez-Valdes et al. / European Journal of Operational Research 137 (2002) 512523the 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 exploredierent feasible solutions.4.1. Phase I: Building an initial timetableThe timetable is built by taking the lessonsone at a time, rst of all those preassigned toperiods, then those of sections belonging to aclass and nally those of sections not belongingto a class.Classes are taken sequentially, according tothe 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 sections 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 timetableIn order to design a powerful algorithm wehave developed and tested several strategies foreach element of Tabu Search [11]. Overall, 52dierent 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 areas 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 withweights given by the user as appears in Section 3.4.2.3. The neighborhood NsWe have dened 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 movesbecause it was very dicult to move in the neigh-borhood dened 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, theFig. 2. Multiswap outline.R. Alvarez-Valdes et al. / European Journal of Operational Research 137 (2002) 512523 517swap is not powerful enough for situations likethese: When we try to interchange lessons of dierentlengths, the periods assigned to the shortestone are not sucient 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 conicts.The multiswap allows major changes in the solu-tion structure, thus producing a greater diversi-cation in the search process.4.2.4. The tabu listThe tabu list keeps, for every iteration, thelesson starting the change and its initial period.We have used lists with a constant length of 24and 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 withobjective 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 tooexpensive to explore its whole neighborhood Ns.We determine which lesson to move by two dif-ferent methods. In the rst 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 conicts of simultaneity among the lessonsof a class, these lessons will constitute the list. Ifthere are no conicts of this type, all lessons suchthat when leaving their assigned periods producean 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 intensicationstrategy 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] ofthe 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 diversication strategywhich leads the search to unexplored regions in thesolution space.4.2.8. Recovering the best current solutionWe have also tested the strategy of recoveringthe best solution found if the process has not im-proved it after a given number of iterations. It isan intensication strategy in which we concentratethe search once again in the neighborhood of goodsolutions.4.3. Phase III: Improving the room assignmentIn 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 aroom for a lesson has two components: a xedcost, 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 diers from other ex-isting approaches [4,10]. Therefore, we need aspecic algorithm for this case. We decided toimplement a simple and fast heuristic procedure518 R. Alvarez-Valdes et al. / European Journal of Operational Research 137 (2002) 512523because 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-dened priority.5. Numerical resultsThe 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 oers a three-yearDegree in Business Administration. Coursescheduling is done on a semester basis. For in-stance, in the rst semester of the academic year1997/98 there were 4300 students registered, 84courses with 724 sections, some of them deninga 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 specic requirements to be ad-ded to the problem. The classes of the rst andsecond year must have two free days dedicated tooptional courses. It is convenient for sections ofpractical subjects linked to a theoretical course notto 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 conicts 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 resultsThe combination of strategies has produced 48dierent implementations of Tabu Search algo-rithm. When we run them on the test problemdescribed above, we obtain the 48 values of Tables24.Table 1Weights of criteriaCriterion ElementinvolvedWeight1 Conicts of simultaneity Class 50002 Compactness oftimetableClass 1003 Moves betweenbuildings without breakClass 2004 Moves betweenbuildings with breakClass 1005 Changes of room Class/room506 Use of the same room Class 1007 Simultaneity conicts Students 18 Forbidden periods Teacher 1009 Non-desired periods Teacher 510 Lessons at the sametime of the daySection 1011 Lessons spread out inthe weekSection 1012 Simultaneity ofpractical lessonsSection 10013 Non-consecutivepractical lessonsSection 1014 Excess of students Room 515 Empty seats Room 1R. Alvarez-Valdes et al. / European Journal of Operational Research 137 (2002) 512523 519We have analyzed these results to determine thebest combination of strategies. We have used ananalysis of variance to evaluate the inuence ofstrategies on the solutions. We consider as signif-icant the factors or interactions with a level ofsignicance (SL) lower than a 0:05.The type of move is the most inuential factorwith 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-nicantly 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 dier-ence in favor of multiswap is not signicant(SL 0:1455. Instead, the strategy used with thecandidate list is the most inuential 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 signicant factorSL 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 signicant SL 0:0361, with anaverage of 61652.7 when we oscillate and 62703:7if we do not. Recovering the best known solutionTable 2Results of simple moveWith candidate list Without candidate listRecover Non-recover Recover Non-recoverStatic tabu list Change weights 77 046 77 387 86 842 87 003Non-change weights 77 046 77 387 86 529 87 003Dynamic tabu list Change weights 77 486 74 845 87 002 86 692Non-change weights 75 783 77 863 86 992 87 003Table 4Results of multiswapWith candidate list Without candidate listRecover Non-recover Recover Non-recoverStatic tabu list Change weights 65 398 64 764 59 717 58 614Non-change weights 66 467 67 036 60 116 61 948Dynamic tabu list Change weights 63 213 65 246 57 150 54 801Non-change weights 64 341 64 695 58 691 56 950Table 3Results of swapWith candidate list Without candidate listRecover Non-recover Recover Non-recoverStatic tabu list Change weights 63 320 62 836 59 579 65 092Non-change weights 64 638 65 232 60 944 66 533Dynamic tabu list Change weights 63 399 63 467 59 791 60 057Non-change weights 63 607 63 242 59 381 59 439520 R. Alvarez-Valdes et al. / European Journal of Operational Research 137 (2002) 512523is not signicantly inuential 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 behaviorof the candidate list is Fig. 4, which shows theevolution of the solutions of both strategies in anexample. Though the implementation with a can-didate list nds better solutions in the rst 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 conicts 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 conicts is obtained in therst 100 iterations while without a candidate list aconict-free solution is not obtained in the rst12 000.Therefore in hard problems, or when theuser does not allow the algorithm to performmany iterations, we could end up without a so-lution free of conicts, despite the fact that theyexist.As that situation would not be acceptable forthe user, we designed a mixed strategy. We use acandidate list until a solution without conicts isfound and from that iteration onwards we do notuse it. We compared these three strategies xingthe multiswap and dynamic tabu list. The resultsappear in Table 5.Doing an analysis of variance once again wefound that the use of a candidate list is a signi-cant factor (SL 0:0079). We then performed aNewmanKeuls test of multiple comparisons tond where the signicant dierences among thethree strategies lie. The results of the test show thatthere is no signicant dierence between the tem-poral use (average value 57460.5) and the non-useof the list (average 56898.0), but there are signi-cant dierences 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, thecomputer program was implemented with the fol-lowing characteristics:66646260580 1Without list With list2 Swap3 MultiswapCost x 10002233Fig. 3. Interaction between type of move and use of candidatelist.Fig. 4. Evolution of the objective function with and withoutcandidate list.R. Alvarez-Valdes et al. / European Journal of Operational Research 137 (2002) 512523 521 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 assignmentimprovementThe 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 toconcentrate 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 conrms the usefulness of this fastimprovement procedure.6. The program HORARIS6.1. CharacteristicsThe 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 toinput and modify the characteristics of the centre(starting and nishing 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 studentsregistration and xed data about courses andteachers are directly read from the correspondingles of the university computing centre.The windows of interaction with the solutionprocedure 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 fromseveral points of view: classes, courses, teachers orrooms. This information can be printed or saved inASCII les to be used with other programs.6.2. A test for academic year 19992000The Business School has tested the program forbuilding the timetables for the academic year19992000 and compared them with their manualtimetables.The main problem when building the timetableis planning the third year in which the studentsTable 5Results of the three strategies for the use of candidate listWith candidate list Without candidate list Temporal use of listRecover Non-recover Recover Non-recover Recover Non-recoverChange weights 63 213 65 246 57 150 54 801 58 551 57 180Non-change weights 64 341 64 695 58 691 56 950 58 829 55 282522 R. Alvarez-Valdes et al. / European Journal of Operational Research 137 (2002) 512523may choose from among several streams of op-tional subjects, each one leading to a dierentprofessional 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 programHORARIS and the results were considered satis-factory by School administrators, specially in theaspects corresponding to the third year, for whicha global solution without simultaneity conicts forclasses was provided.AcknowledgementsWe are very grateful to the anonymous refereesfor their helpful comments and suggestions thathave contributed to clarifying and improving thispaper.References[1] R. Alvarez-Valdees, E. Crespo, J.M. Tamarit, Assigningstudents to course sections using Tabu Search, Annals ofOperations Research 96 (2000) 116.[2] J. Aubin, J.A. Ferland, A large scale timetabling problem,Computers and Operations Research 16 (1) (1989) 6777.[3] E. Burke, J.P. Newall, R.F. Weare, A memetic algorithmfor 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. 241250.[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. 319.[5] D. Corne, P. Ross, Peckish initialisation estrategies forevolutionary timetabling, in: E. Burke, P. Ross (Eds.),Practice and Theory of Automated Timetabling, LectureNotes in Computer Science, vol. 1153, Springer, Berlin,1996, pp. 227240.[6] K.A. Dowsland, A timetabling problem in which clashesare inevitable, JORS 41 (10) (1990) 907918.[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 Theoryof Automated Timetabling II, Lecture Notes in ComputerScience, vol. 1408, Springer, Berlin, 1997, pp. 92112.[8] J.A. Ferland, C. Fleurent, SAPHIR: A decision supportsystem for course scheduling, Interfaces 24 (2) (1994) 105115.[9] J.A. Ferland, S. Roy, Timetabling problem for universityas assignment of activities to resources, Computers andOperations Research 12 (2) (1985) 207218.[10] C.R. Glassey, M. Mizrach, A decision support system forassigning classes to rooms, Interfaces 16 (5) (1986) 92100.[11] F. Glover, M. Laguna, Tabu Search, Kluwer AcademicPublishers, Dordrecht, 1997.[12] C. Gueeret, N. Jussien, P. Boizumault, C. Prins, Buildinguniversity timetables using constraint logic programming,in: E. Burke, P. Ross (Eds.), Practice and Theory ofAutomated Timetabling, Lecture Notes in ComputerScience, vol. 1153, Springer, Berlin, 1995, pp. 130145.[13] A. Hertz, Tabu Search for large scale timetabling prob-lems, EJOR 54 (1991) 3947.[14] A. Hertz, Finding a feasible course schedule using TabuSearch, Discrete Applied Mathematics 35 (1992) 255270.[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) 6984.[16] K. MyounJae, K. TaeChoong, Development of automaticclass timetabler (ACT) for university, in: Proceedings ofSecond International Conference on the Practice andTheory of Automated Timetabling, Toronto, 1997, pp.182186.[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 AutomatedTimetabling, Lecture Notes in Computer Science, vol.1153, Springer, Berlin, 1996, pp. 251265.[18] B. Paechter, R.C. Rankin, A. Cumming, T.C. Fogarty,Timetabling the classes of an entire university with anevolutionary algorithm, Parallel Problem Solving fromNature (PPSN)V, Springer LNCS 1498, 1998.R. Alvarez-Valdes et al. / European Journal of Operational Research 137 (2002) 512523 523