Chapter 3 Previous work on the school timetabling problem
3.1 The tabu search
3.1.1 Tabu search description
The tabu search is a metaheuristic originally introduced by Glover [GLOV89]. Starting from a candidate solution (also known as a potential solution), the tabu search is a local search algorithm that moves from one candidate solution to another candidate solution (referred to as a neighbour) until some problem dependent termination criteria has been met. Moving from a candidate solution to a neighbour is accomplished using a move operator, where a single change is made to the candidate solution resulting in its neighbour. A neighbourhood is defined as a set of neighbours that occur as a result of implementing a single move to a candidate solution.
In order to prevent the search from cycling (returning to a previously encountered area of the search space), a tabu list is kept. This tabu list stores a set of k recent candidate solutions.
Alternatively, previous moves that have been applied to candidate solutions can also be stored in the tabu list [SCHA96]. A move is rejected if it results in a candidate solution that is in the tabu list. Another move must then be made.
As described by Glover [GLOV97], an advantage of the tabu search is its use of the tabu list.
This list resembles a form of memory, preventing the search algorithm from returning to previous candidate solutions. A disadvantage of the tabu search is that the focus is always on a single candidate solution. Thus, the possibility arises that a large area of the search space is not covered [LUKE12], [ZDAN02].
3.1.2 Applications of tabu search to the school timetabling problem
Schaerf [SCHA96] presented a tabu search algorithm to solve an Italian school timetabling problem. The problem has the following hard and soft constraints with each constraint being given a specific weighting:
Timetables must be compact.
Lessons of a particular subject must not be repeated in a day.
Daily teaching limits must be met.
Requirements involving specialized rooms must be met.
Teacher availability requirements must be met.
Movement from one venue to another between consecutive periods should be minimized.
A timetable was represented using a matrix structure (two-dimensional array). In this representation, the rows represented the periods of the week and each column represented a teacher. The cells contained the class that will be taught by the teacher during that period.
The author did not make mention of how a venue is represented. An initial solution was randomly generated. Neighbours were formed by applying one of two types of moves. The first type was a move that randomly chooses a tuple and moves the tuple from one part of the timetable to another. The second type of move, a double move, was composed of a single move and an optional second move if the first move resulted in a constraint violation.
A tabu list was kept which stored a predefined number of unacceptable moves. The tabu search terminated after a set number of iterations or when a feasible solution was found.
The tabu search was applied to three Italian school timetabling problems, with each school differing in the number of teachers and lessons. The tabu search produced feasible timetables for all three of the schools. The timetable structure adopted was appropriate as the matrix structure best represents a timetable (discussed further in section 5.4.1).
Besides using only single moves to swap tuples in the timetable, the authors also introduced the concept of double moves in order to repair any constraint violations caused by the first move. Hill climbing, where moves resulting in constraint violations are rejected, could have been used instead. The tabu search employed, however, did produce acceptable results for all three schools as feasible timetables with only a few soft constraint violations were generated.
Desef et al. [DESE06] used a tabu search to solve the German school timetabling problem that was subject to the following hard constraints:
No class clashes, teacher clashes and venue clashes.
Teacher and room availability constraints must be met.
Co-teaching and subclass requirements must be met.
Double period requirements must be met.
The soft constraints for the problem are the following:
Lessons of a particular subject should be evenly distributed over the week for each class.
There should be no free periods for the first four periods of the day.
In this paper, a tuple was defined as a complex lesson unit (CLU). In the event of a double period requirement, the two tuples involved in the double period were combined into a single CLU with a double period attribute, thus fulfilling the double period requirement.
Furthermore, a set of CLUs were combined to form the lessons of the week (i.e. the class timetable) for a particular class. Each timetable was represented as a set of period vectors.
The period vectors contain the list of CLUs for each class for the week. An initial solution was created where the CLUs with the fewest number of feasible periods on the timetable were allocated first. The selected CLU was then allocated to the earliest possible period that resulted in a minimized hard constraint cost. The tabu search was applied in two ways. The first application allowed the tabu search to move from one neighbour to another using single moves (making a single change to the timetable). The second application of the tabu search only allowed moves that did not violate constraints. Two tabu lists were kept. The first list was a tabu list that stored previous moves (similar to that described in section 3.1.1) and the second was a frequency list that kept track of how often CLUs moved around the timetable.
A move was rejected if it was in the first tabu list or if the frequency of the related CLU exceeded a particular frequency value. The timetables produced using this tabu search was better or equivalent in terms of quality when compared to timetables produced manually by the school staff. Creating an initial solution by first allocating CLUs with the fewest feasible periods was an important factor that contributed towards the good performance of the tabu search as the number of violations would have been fewer than if a random allocation method had been used.