Professional Documents
Culture Documents
net/publication/220887693
CITATIONS READS
19 1,516
3 authors:
Felix Calderon
Universidad Michoacana de San Nicolás de Hidalgo
51 PUBLICATIONS 453 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
Power Forecasting for Photovoltaic, Eolic and Hydroelectric Power Plants Using Novel Techniques View project
All content following this page was uploaded by Juan Flores on 18 September 2014.
1 Introduction
The Academic Timetabling Problem consists of scheduling a sequence of activi-
ties between teachers and students, satisfying a set of constraints. A large number
of variants of the Academic timetabling problem have been studied in the lit-
erature, which differ from each other based on the type of institution involved.
Schaerf et. al. [8] classifies them as: School Timetabling, Course Timetabling,
and Examination Timetabling.
This paper focuses on the School Timetabling Problem (ST) also known as
Class–Teacher Timetabling Problem. This problem consists of scheduling all the
lectures of a week for a school, satisfying a set of constraints. Finding a good
solution is sometimes difficult because this problem is computationally N P–
hard. The complexities and challenges of timetabling problems arise from the
fact that there exists a large variety of constraints. In the timetabling literature,
constraints are usually categorized into two types: hard constraints and soft
constraints.
X11
X5 X
X3 Solution Space
X6 X9
X4
X1 X2 X7 X8
Analogously, a class cannot meet two lectures at the same time. A timetable
assignment which satisfies all of the hard constraints is called a feasible so-
lution.
– Soft Constraints. These constraints are desirable to solve but are not ab-
solutely critical. In practice it is usually impossible to find feasible solutions
that satisfy all of the soft constraints. The most common soft constraint in
the school timetabling is to avoid empty time slots between class’ activities.
Figure 1 illustrates that the search space X can be explored by using atomic
moves. For example: X2 is found by applying a single atomic move to X1 , X3
is found from X2 , etc. Some instances (e.g. X3 , X6 , . . .) do not violate hard
constraints, and they are in the feasible–solution space F. In ST as in many other
combinatorial problems, we are looking for instances in the feasible–solution
space. This paper proposes to use a Bee Algorithm (BA) to solve the ST problem,
on which scout–bees find feasible solutions while collector–bees search in the
neighborhood of these feasible solutions to find better solutions, keeping them
feasible. The implemented algorithm iterates two basic stages:
1. Exploration. This stage performs a random search to find feasible solutions.
2. Recollection. This stage performs a local search in the neighborhood of
a feasible solution to find another feasible solution. An example is shown
in Figure 1: given F1 , the recollection stage tries to find another feasible
solution– F2 . This stage finds another solution, which may or may not be
better than the original one.
The rest of the paper is organized as follows: Section 2 describes the re-
lated work in this area. Problem statement is presented in Section 3. Then the
representation used is introduced in Section 4. The implemented algorithm is
presented in Section 5. Section 6 shows the results of computational tests that
were conducted using real data. Finally, Section 7 presents our conclusions and
proposes extensions to the work presented in this article.
2 Related Work
The timetabling problem is one of the scheduling problems that have been exten-
sively studied. The solution approaches range from graph coloring to heuristic
algorithms, including mathematical programming models and metaheuristics as
well.
There are two different strategies used to explore the search space:
– those that search in the search space; in this strategy the unfeasible timeta-
bles are also included in the search space [9]. Unfeasibilities are usually highly
penalized and the problem is seen as an optimization one, and
– those that search in the space of feasible solutions [2]; in this strategy
unfeasible–solutions are not considered in the problem.
The implemented algorithm is one that searches in the space of feasible so-
lutions. An example of this strategy is used in [2] to solve a slightly different
problem –the University Course Timetabling Problem. Their approach consists
of finding an initial population of feasible solutions, and then performing a lo-
cal search by using a combination of neighborhood structures [1]. The reason for
considering a combination of diverse neighborhood criteria is related to the diver-
sification of search needed to escape from local optima [4]. We use a Neighborhood
Composition, on which the neighborhood is composed by chains of atomic moves
of variable length; although the chain length is limited to a maximum.
Our work is also related with memethic algorithms (MA); Memethic algo-
rithms have provided very good results for a variety of scheduling problems [7].
MA are combinations of evolutionary based approaches with local search [7].
3 Problem Statement
The Scholar Timetabling problem is defined as follows. Given the following pre-
liminary definitions:
The problem is to assign meetings between teachers and classes in such a way
that no teacher has two meetings at the same time and no class has two meetings
at the same time. More precisely, let us define xi,j,k to be 1 if teacher i meets
class j at period k and 0 otherwise. Also, let us define the following functions,
representing Soft Constraints:
– Teacher Holes Ht(·). Number of idle periods between lectures in the teach-
ers assignment of a day.
– Class Holes Hc(·). Number of idle periods between lectures in the class
assignment of a day.
– Splits S(·). Number of periods that divide two or more lectures of the same
class.
Subject to
nS
X
∀i ∈ {1 . . . nT } , ∀j ∈ {1 . . . nC } xi,j,k = ri,j (2)
k=1
nC
X
∀i ∈ {1 . . . nT } , ∀k ∈ {1 . . . nS } xi,j,k ≤ 1 (3)
j=1
nT
X
∀j ∈ {1 . . . nC } , ∀k ∈ {1 . . . nS } xi,j,k ≤ 1 (4)
i=1
xijk ∈ {0, 1} (5)
– Used slots. Used slots are slots on which teacher (or class) has one or more
activities assigned. Teacher ti ’s used slots are determined by
nC
_
uti = (xi,1 ∨ . . . ∨ xi,nC ) = xi,j (6)
j=1
– Free timeslots. Free timeslots of teacher i (or a class j), are slots on which
teacher i (or class j) is available according to vi (or vcj ) but has no activ-
ity assigned yet. Free slots are found by applying the XOR operation. For
example, to find teacher i’s free timeslots
Finally, for a given assignment X the total numberP of teacher holes is Ht(X) =
P nt nc
i=1 Ht i , the number of class holes is Hc(X) = j=1 Hcj and the number
Pnt Pnc
of splits is S(X) = i=i j=1 Si,j .
5 Bee Algorithm
The necessary and sufficient conditions for the existence of feasible solutions are
discused in [5]. Next description considers that feasible solutions exist.
The goal of the algorithm is to find a feasible and optimal solution. In other
words, it must solve hard constraints (feasible solution) and satisfy as many
soft constraints as possible (optimal solution). We propose the use of the Bee
Algorithm (BA) [6].
Algorithm 1 Bee Algorithm to solve STP
1: Initialize a population of m scout bees (algorithm 2).
2: repeat
3: Evaluate the fitness of the population by using Eq. 1.
4: Determine the size of the neighborhood (patch size).
5: Recruit bees for selected sites and collect.
6: In each site replace the scout–bee for the local fittest bee
7: Create n new scout bees from random sites
8: Select the best m scouts according to Eq. 15
9: until converge
The BA mimics the food foraging behavior of swarms of honey bees. The BA
performs a kind of neighborhood search combined with a random search. BA
can be used for both combinatorial optimization and functional optimization. Its
first step, initialization, consists on creating a population of n scout–bees. Every
scout–bee finds a random feasible solution. In each iteration the BA evaluates
the n sites using a fitness function, selects the best m sites, searches in the
neighborhood of the m sites, and add a determined number of new random
sites.
The algorithm we implemented is shown in Algorithm 1. To select the num-
ber of collector bees to each patch, we implemented a simple roulette wheel
algorithm. The algorithm has a slightly but important difference with the basic
algorithm, while the basic version uses only the fitness of the bees to keep m
scouts, we suggest the use of a new measurement that considers the evolutionary
history of the bees as well as their fitness:
′
g(X) = f (X) + β1 ea /ζ1 (15)
where: the relative–age a′ is the number of iterations since the fitness of the
bee was improved. The new measurement lets the older bees grow, while allows
newer bees to be competitive. If only a fitness–based evaluation is used, then
newer scouts usually are not competitive against well explored neighborhoods.
It implies that new scout–bees are rarely selected for recollection. Parameters
β1 , and ζ1 must be sintonized. If β1 = 0 then g(X) = f (X) and the algorithm
acts as the basic bee algorithm.
6 Experimental Results
This section presents the experimental results. All code has been implemented
in Java and runs on an Acer Aspire 3680–2125 with a 1.86 GHz processor. Two
different schools A and B were used for the test, in those schools the timetabling
problem takes several days of manual work. School–A managers are interested on
keeping the same timetabling all days, while school–B managers are interested
on an optimal timetable, and they allow different timetable for each day during
the week. Both schools have enough room spaces because every class has an
assigned room in their corresponding periods.
We have carried out experiments using the presented algorithm, the values
for the parameters were: α1 = 7, α2 = 3, α3 = 5, β1 = 1, and ζ1 = 10. The
values of α1 , α2 and α3 reflect the scholar administrator preferences. The initial
number of scout-bees where m = 20, the maximum number of collector bees
associated to each patch was 50.
6.1 School A
The first timetabling data was provided by ITSUR1 and consists of 42 teachers,
23 classes, and 160 events per day. A typical evolutionary history for the best
bee is shown in Figure 2. The number of iterations where 1000. We perform the
experiment 100 times, the average results are shown in Table 1. Total class holes,
total teacher holes and total splits are calculated for a day.
6.2 School B
The second data was provided by the Michoacana University. The school data
consists of 86 teachers and 25 classes. School–B managers are interested on an
optimal timetable, and they allow different timetable for each day during the
week. To evaluate holes and splits we feed the algorithm with a list of day
patterns. To evaluate Ht(·), Hc(·) and S(·) we simply apply the bitwise–and
operation over each assignment and day pattern. This makes sure that we do
not consider the bit string representing a week as a long day. That kind of
misinterpretation would change the semantics of the representation, thus yielding
different measures for holes and splits.
1
South Guanajuato Institute of Technology
450
400
350
300
f (X) 250
200
150
100
50
0 100 200 300 400 500 600 700 800 900 1000
ITERATION
(a) School A, 1000 generations
6000
5000
4000
f (X) 3000
2000
1000
0
0 500 1000 1500 2000 2500
ITERATION
(b) School B, 10000 generations
A typical evolutionary history for the best bee is shown in Figure 2. The
number of iterations where 10000. We perform the experiment 100 times, the
average results are shown in Table 2.
Local search techniques give the possibility to start the search from any
timetable, easily allowing for interactive construction and maintenance of timeta-
bles. In fact, once a timetable has been generated, it can be used as the starting
point for a new search, after some constraints or the timetable have been man-
ually modified. In the near future we want to test the technique presented for
interactive construction of the timetable and to apply the bee algorithm in other
contexts.
References
1. S. Abdullah, E. Burke, and B. McCollum, editors. Computer Science Interfaces
Book series, chapter Using a Randomised Iterative Improvement Algorithm with
Composite Neighbourhood Structures for the University Course Timetabling Prob-
lem. Springer Operations Research, 2006.
2. S. Abdullah, E. K. Burke, and B. McCollum. A hybrid evolutionary approach to
the university course timetabling problem. In CEC, 2007.
3. D. de Werra. An introduction to timetabling. European Journal of Operational
Research, 19(2):151–162, February 1985.
4. L. Di Gaspero and A. Schaerf. Multi-neighbourhood local search with application
to course timetabling. In E. Burke and P. D. Causmaecker, editors, Practice and
Theory of Automated Timetabling IV, number 2740 in Lecture Notes in Computer
Science, pages 263–278. Springer-Verlag, Berlin-Heidlberg, Germany, 2003.
5. G. A. Neufeld and J. Tartar. Graph coloring conditions for the existence of solutions
to the timetable problem. Commun. ACM, 17(8):450–453, 1974.
6. D. Pham, A. Ghanbarzadeh, E. Koç, S. Otri, S. Rahim, and M. Zaidi. The bees
algorithm a novel tool for complex optimisation problems. In IPROMS 2006.
7. O. Rossi-Doria and B. Paechter. A memetic algorithm for university course
timetabling. In Combinatorial Optimisation 2004 Book of Abstracts, Lancaster,
UK, Lancaster University, 2004.
8. A. Schaerf. A survey of automated timetabling. In 115, page 33. Centrum voor
Wiskunde en Informatica (CWI), ISSN 0169-118X, 30 1995.
9. A. Schaerf. Tabu search techniques for large high-school timetabling problems. In
88, page 17. Centrum voor Wiskunde en Informatica (CWI), ISSN 0169-118X, 1996.