Вы находитесь на странице: 1из 8

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/232627738

Generating University Course Timetable Using Genetic Algorithms and Local


Search

Article · November 2008


DOI: 10.1109/ICCIT.2008.379

CITATIONS READS
79 569

2 authors:

Salwani Abdullah Hamza Turabieh


Universiti Kebangsaan Malaysia Taif University
98 PUBLICATIONS   1,870 CITATIONS    28 PUBLICATIONS   495 CITATIONS   

SEE PROFILE SEE PROFILE

Some of the authors of this publication are also working on these related projects:

T-way test suit generation View project

Data Science View project

All content following this page was uploaded by Hamza Turabieh on 25 January 2019.

The user has requested enhancement of the downloaded file.


Third 2008 International Conference on Convergence and Hybrid Information Technology

Generating University Course Timetable Using


Genetic Algorithms and Local Search
Salwani Abdullah, Hamza Turabieh
Center for Artificial Intelligence Technology
Univesiti Kebangsaan Malaysia
43600 UKM Bangi, Selangor D.E, Malaysia
salwani,hamza@ftsm.ukm.my

ABSTRACT heuristics and then assign the events


sequentially into valid time slots in such a
In this paper we establish a new algorithm based way that no constraints are violated for each
on Genetic Algorithms (GA) and sequential local timeslot [7].
search to solve course timetabling problem. 2) Constraint Based Methods, according to
Universities are challenged to arise in number of which a timetabling problem is modeled as a
complexity, their resources and events are becoming set of variables (events) to which values
harder to schedule. Timetabling is a kind of problem (resources such as teachers and rooms) have
in which events (classes, exams, courses, etc) have to to be assigned in order to satisfy a number of
be arranged into a number of timeslots such that hard and soft constraints [8].
conflicts in using a given set of resources are avoided. 3) Cluster Methods, in which the problem is
We perform preliminary experiments on standard divided into a number of events sets. Each set
benchmark course timetable problems and able to is defined so that it satisfies all hard
produce promising results. constraints. Then, the sets are assigned to real
time slots to satisfy the soft constraints as well
I. INTRODUCTION [9].
4) Meta-heuristic methods, such as genetic
University Course Timetabling Problems (UCTPs) is algorithms (GAs), simulated annealing, tabu
an NPhard problem, which is very difficult to solve by search, and other heuristic approaches, that
conventional methods and the amount of computation are mostly inspired from nature, and apply
required to find optimal solution increases nature-like processes to solutions or
exponentially with problem size. The main idea of this populations of solutions, in order to evolve
problem is to assign a set of lectures to rooms and time them towards optimality [1], [10], [11], [3],
periods satisfying a number of constraints. The set of [4]. GAs have been used for solving
constraints are usually divided in two sets: hard timetabling problems since 1990 [11].
constraints and soft constraints. Hard constraints have
a higher priority than soft. The objective of this Since then, the literature has hosted a large number
problem is to satisfy the hard constraints and to of papers presenting evolutionary methods and
minimise the violation of the soft constraints. It is applications on such problems with significant success
therefore necessary to use efficient search methods to [12].
produce optimal or near optimal timetable that satisfy The paper is organised as follows, the next section
the constraints. A large number of diverse methods introduces the university course timetable problem
have been already proposed in the literature for solving with a set of all hard and soft constraints. In section III
timetabling problems. These methods come from a we represent the main concepts about genetic
number of scientific disciplines like Operations algorithms and the basic operation of GA. Section IV
Research, Artificial Intelligence, and Computational introduces the sequential local search algorithm.
Intelligence [1], [2], [3], [4], [5], [6] and can be divided Section V presents the proposed algorithm and repair
into four categories: function. The simulation results are represented in
1) Sequential Methods, that deals timetabling section VI, and finally conclusion and future work are
problems as graph problems. Generally, they represented in section VII.
order the events using domain-specific

978-0-7695-3407-7/08 $25.00 © 2008 IEEE 246


254
DOI 10.1109/ICCIT.2008.379
II. PROBLEM DESCRIPTION
The evolution process starts from a population of
The general timetable problem can be expressed in random individuals. It is known as a generation. In
the following way: a number of events must be each generation, the fitness of the whole population is
timetabled by associating them with timeslots. In evaluated, multiple individuals are stochastically
university course timetable, a set of events (courses) is selected from the current population based on their
scheduled into a fixed number of rooms and timeslots (fitness), modified (mutated or recombined) to form a
within a week. In this paper, we test our method on the new population, which becomes current in the next
problem instances introduced by Socha et al [13]. The iteration of the algorithm. GA is consider one of the
problem presents a set of N courses to be scheduled in most powerful techniques in evolutionary algorithms,
5 days of 9 periods each, which time T = 45 timeslots, so GA has been employed as a tool that can handle a
a set R rooms (each room have a set of F features and very complex search space with a high probability of
capacity), a set of M students and a set of features success in finding the optimal solutions [19].
required by courses. Each student attends a subset of
courses. Solutions in which all courses are assigned to B. Representation
periods and rooms and satisfy all hard constraints are
called feasible solutions. The hard constraints In all evolutionary algorithm techniques, it is
considered for this problem are: required to transfer the problem from its real domain to
1) No student can be assigned to more than one the domain of EA. GAs offer different kinds of
course at the same time. representations. In [19] Holland introduced the binary
2) The room should satisfy the features required string representation. In [20] Michalewicz showed that
by the course. for real-valued numerical optimization problems,
3) The number of students attending the course floating-point representations are more efficient and
should be less than or equal to the capacity of can lead to faster convergence to the optimal solution
the room. domain [20]. This representation scheme is closer to
4) No more than one course is allowed at a the real problem domain and can achieve higher
timeslot in each room. performance and accuracy. To summarize how genetic
The soft constraints considered for this problem are: algorithms work, assume that Pop(k) and Offspring(k)
1) A student has to attend only one course in a are the parents and offspring in current generation t;
day. the general structure of a genetic algorithm procedure
2) A student has to attend more than two courses can be described by the simple pseudo code as in
consecutively. Figure 1.
3) A student has to attend a course in last period
in any day.
Fig. 1. Pseudo code for genetic algorithm
The objective of this problem is to satisfy the hard
IV. LOCAL SEARCH
constraints and to minimise the violation of the soft
constraints.
Inserting local search within genetic algorithm is
considered an effective way to produce high quality
III. GENETIC ALGORITHMS solution than using genetic algorithms alone [21], [22],
[23]. We applied a sequential search algorithm to
A Genetic Algorithm (GAs) is a parallel and
improve the timetable by reducing the number of soft
evolutionary search algorithm based on the Darwinian
constraint violations. The pseudo code for the local
evolution theory [14]. It is used to search large,
nonlinear solution space where expert knowledge is
lacking or difficult to encode. Moreover it requires no
gradient information, evolves from one population to
another and produces multiple optima rather than
single local one. These characteristics make GA a well-
suited tool for university course timetable problem,
also GAs have been successfully used to solve system
identification, signal processing and path planning
problems [15], [16], [17], [18], which attracts more and
more attentions of researchers and practitioners. search as depicted in Figure 2.

A. Evolutionary Process

255
247
Fig. 2. Pseudo code for local search

V. APPLYING GENETIC ALGORITHMS

The algorithm used in this paper is shown in a


schematic diagram as in Figure 3. At the beginning of
the algorithm, a conflict matrix [21] is created. The
matrix has dimensions N by N which is used to enable
efficient conflict checking and eliminates the number
of students as a factor in the complexity of the
problem.

Initial population (Chromosomes) and Representation:


• Initial population is formed using a constructive
heuristic for each timetable, which starts from blank
timetable. The construction of feasible timetable that
satisfy all hard constraints is achieved by adding or Fig. 3. Schematic diagram of GA and local search algorithm
removing appropriate events (courses) from the table
based on room availability [24], [25], without
considering any of the soft constraints violation
through this step, until the hard constraints are met.
This approach produces chromosomes as shown in
Figure 4, each of which represent a timetable.
Encoding the timetables, where N is the number of
population size. The length of each chromosome
equals to the number of events to be held, and each
gene represents the timeslot for corresponding event. Fig. 4. Genetic representation of timetable
• Genetic Operation: The genetic operator for our
approach is defined as follows: – Crossover: The main genetic operator,
– Selection: This process guides the single point crossover has been applied. This
evolutionary algorithm to the optimal solution operation performs single point recombination
by preferring chromosomes with high fitness. between pairs of chromosomes and returns the
The chromosomes evolve through successive parent chromosomes after mating. Crossover
uses tournament selection method, which point is chosen randomly from the domain (1,
select K individuals (timetables). This process 2, 3, …, L) where L is the number of
is repeated as often as individuals must be chromosome length (events). After that, keep
chosen. The parameter of tournament the gene before the crossover point unchanged
selection is the tournament size K. K can take and swap the gene after the crossover position
values ranging from 2 to P, where P is the between parents.
number of individuals in population. – Mutation: This is a background operator
which allowing a large search space to be
explored and produces some random changes

256
248
in various chromosomes. Mutation points are
randomly selected in our implementations.
• Repair Function: After crossover and mutation
operations, the resulting chromosome may become
infeasible or outside the search space [26]. There are
three ways to deal with infeasible solutions [27]:
1) Remove infeasible timetables.
2) Apply a high penalty in the fitness function,
so that they are unlikely to survive.
3) Repair infeasible timetable.
Performing (1) and (2) are only accepted when a huge
proportion of the population is feasible. Several
researchers have applied repair process for rectifying
infeasible chromosomes that were generated during
evolution process [28], [29], [30], [31]. The GA in our
experiments has repair processes that ensure all
infeasible chromosomes are repaired. The repair
function of our algorithm is divided into four steps as
follows:
--- Step 1: Find free timeslots for each room, the input
matrix is Infeasible Course Timetable, called (ICT),
and the output of the pseudo code (see Figure 5) is
called (Free_Time_Room) matrix for each room.

Fig. 6. Repair function – Step (2) pseudo code

Fig. 7. Repair function – Step (3) pseudo code

Fig. 5. Repair function – Step (1) pseudo code

– Step 2: Find free timeslots for each event. The


input matrix is the Event Student, and the output of the
pseudo code (see Figure 6) is called (Free- Time
Event) matrix for each event.
– Step 3: Find feasible timeslots for rooms and events
without conflict. The input matrixes are Freetime
Room from Step (1) and FreeTime Event from Step
(2). The output of the pseudo code (see Figure 7) is a
Feasible Time matrix which satisfies all the hard Fig. 8. Repair function – Step (4) pseudo code
constraints for each event.

257
249
– Step 4: Repair ICT (Infeasible Course Timetable). local search on the small 4 and large datasets
The input is a Feasible Time matrix from Step (3), and respectively.
the output of the pseudo code (see Figure 8) is a
Feasible Course Timetable (FCT). TABLE I
PARAMETER SETTING FOR GENETIC ALGORITHMS
• Fitness Function: The algorithm assigns fitness value
Parameter Value
for each timetable. The fitness indicates how much Generation Number 10000
the timetable violates the soft constraints given in the Population size 100
definition of the timetable problem. The fitness Crossover Rate 0.8
function used is as follows: Mutation Rate 0.04
m Selection Mechanism Tournament selection
Min f (T ) = ∑∑ p j B j (t ) Crossover Type Single point

i =1 j∈C
The performance of our algorithm is quite promising
Where:
and reaches to stable state after several iterations, so
T: Given timetable.
we stop the algorithm if there is no improvement on
C: A set soft of constraints.
the timetable.
p: Penalty of violating soft constraint j.
B: A boolean function that returns 1 if tuple ti TABLE II
violates constraint j, otherwise return 0. COMPARISON BETWEEN VARIOUS VERSION METHODS AND OUR
METHOD
The proposed method must minimises the value of
this fitness function. So the lower f(T) values means Data Our Our Randomised VNS Graph
a better solution. Set Method Method Iterative With Tabu hyper-
Best Average Improvement list heuristi
Algorithm c
• Local Search: Before moving to the next (Best)
generation, we applied local search algorithm to s1 2 2.4 0 0 6
s2 4 4 0 0 7
improve the timetable. This process makes the s3 2 2.3 0 0 3
convergence of GA faster. We then reinsert the s4 0 2 0 0 3
result of the local search back to GA for the next s5 4 6.4 0 0 4
generation. m1 254 275.2 242 317 372
m2 258 268 161 313 419
m3 251 262.8 265 357 359
VI. SIMULATION RESULTS m4 321 353 181 247 348
m5 276 284.4 151 292 171
The proposed algorithm was programmed using l 1027 1032.2 - 100% inf 1068
Matlab and simulations were performed on the Intel
Pentium 4 2.33 GHz computer and tested on a standard
benchmark course timetable problem as presented in
SectionII. Table I shows the parameter for the genetic
algorithm chosen after some preliminary experiments,
and almost similar with the papers in the literature
[32], [30].
Our algorithm is capable to find a feasible timetable
for all eleven cases. We performed our method 5 times
for each case. Table II shows the results obtained and
the comparison with other approaches in the literature
such as a the Randomised Iterative Improvement
Algorithm by Abdullah et al. (2005), a graph
hyperheuristic by Burke et al. (2005) and the variable
neighbourhood search (VNS) by Abdullah et al.
(2005). From Table II, it is clear that the result of our
proposed algorithm produces acceptable timetables. Fig. 9. The convergence of GA and local search on the s4 dataset
We believe that modifying the parameters of GA and
local search can leads to better solution. In Figures 9
and 10, we show the best so far curves of the GAs and

258
250
[10] P. Adamidis and P. Arapakis, “Evolutionary algorithms in
lecture timetabling,” in Proceedings of the 1999 IEEE
Congress on Evolutionary Computation (CEC 99), pp. 1145–
1151, IEEE, 1999.
[11] A. Colorni, M. Dorigo, and V. Maniezzo, “Genetic algorithms
- a new approach to the timetable problem,” in Lecture Notes
in Computer Science - NATO ASI Series, vol. F 82, pp. 235–
239, Combinatorial Optimization, (Akgul et al eds), Springer-
Verlag, 1990.
[12] M. W. Carter and G. Laporte, “Recent developments in
practical course timetabling,” in In: Burke, E., Carter, M.
(Eds.), The Practice and Theory of Automated Timetabling II:
Selected Papers from the 2nd Int’l Conf. on the Practice and
Theory of Automated Timetabling, Springer Lecture Notes in
Computer Science Series, vol. 1408, pp. 3–19, 1990.
[13] M. Chiarandini, K. Socha, and O. R. Doria, “An effective
hybrid approach for the university course timetabling
problem,” 2002.
Fig. 10. The convergence of GA and local search on the large dataset
[14] D. Goldberg, Genetic Algorithms in Search, Optimization,
and Machine Learning. New York: Addison-Wesley, 1989.
[15] K. Kristinsson and G. Dumont, “System identification and
VII. CONCLUSION control using genetic algorithms,” IEEE Transaction on
Systems, Man, and Cybernetics, vol. 22, no. 5, pp. 1022–
1046, 1992.
This paper has introduced a genetic algorithm and local [16] C. Fonseca, E. Mendes, Fleming, and S. A. Billings,
search. A new repair function is also presented that is “Nonlinear model term selection with genetic algorithms,” in
totally able to change infeasible timetable to feasible Proceedings of the IEE/IEEE Workshop on Natural
Algorithms in Signal Processing, pp. 27/1–27/8, 1993.
one. Future work will be aimed to enhance the local
[17] A. Schultz and J. Grefenstette, “Evolving robot behavior,” in
search algorithm and applying more genetic operators Proceedings of Artificial Life Conference, MIT Press, 1994.
e.g., selection mechanism and crossover type, and [18] A. J. Chipperfield and P. J. Fleming, “Genetic algorithms in
tested on real world course and examination control systems engineering,” IASTED Journal of Computers
and Control, vol. 24, no. 1, 1996.
timetabling datasets.
[19] J. Holland, Adaptation in Natural and Artificial Systems. Ann
Arbor, MI: University of Michigan Press, 1975.
REFERENCES [20] Z. Michalewicz, Genetic Algorithms + Data Structures=
Evolution Programs. Springer-Verlag, New York, 1994.
[21] E. K. Burke and J. P. Newall, “A multistage evolutionary
[1] D. Abramson, “Constructing school timetables using algorithm for the timetable problem,” IEEE Transactions on
simulated annealing: sequential and parallel algorithms” Evolutionary Computation, vol. 3, no. 1, pp. 63–74, 1999.
Management Science, vol. 37, pp. 98–113, 1991. [22] L. Di Gaspero and A. Schaerf, “Tabu search techniques for
[2] E. K. Burke and J. P. Newall, “A new adaptive heuristic examination timetabling,” in Proceedings of the 3rd
framework for examination timetabling problems,” in International Conference on the Practice and Theory of
Technical Report NOTTCSTR- 2001-5 (submitted to Annals of Automated Timetabling, PATAT 2000, E.K. Burke and W.
Operations Research), University of Nottingham, UK, School Erben, Eds. Konstanz, Germany: Lecture Notes in Computer
of Computer Science & IT, 2002. Science,Springer-Verlag, vol. 2079, p. 104 117, 2001.
[3] A. Hertz, “Tabu search for large scale timetabling problems,” [23] T. A. Gani, T. A. Khader, and R. Budiarto, “Optimizing
European journal of operations research, vol. 54, pp. 39–47, examination timetabling using a hybrid evolution strategies,”
1991. in in Proceedings of the 2nd International Conference on
[4] B. Paechter, M. G. Norman, and H. Luchian, “Extensions to a Autonomous Robots and Agents, Palmerston North, New
memetic timetabling system,,” in E.K. Burke and P.M. Ross, Zealand, pp. 345 – 349, 2004.
eds., Proceedings of the 1st International Conference on the [24] S. Abdullah, E. K. Burke, and B. McCollum, “An
Practice and Theory of Automated Timetabling, Lawrence investigation of variable neighbourhood search for university
Erlbaum Associates, 1995. course timetabling,” in The 2nd Multidisciplinary
[5] A. Schaerf, “A survey of automated timetabling,” Artificial International Conference on Scheduling: Theory and
Intelligence Review, vol. 13 (2), pp. 87–127, 1993. Applications (MISTA), New York, USA, July 18th-21st, pp.
[6] A. Tripathy, “A lagrangian relaxation approach to course 413–427, 2005.
timetabling,” Journal of the Operational Research Society, [25] S. Abdullah, E. K. Burke, and B. McCollum, Using a
vol. 31, pp. 599 603, 1980. Randomised Iterative Improvement Algorithm with
[7] M. W. Carter, “A survey of practical applications of Composite Neighbourhood Structures for University Course
examination timetabling algorithms,” Operations Research, Timetabling. In Metaheuristics: Progress in complex systems
vol. 34, pp. 193–202, 1986. optimization (Operations Research / Computer Science
[8] S. C. Brailsford, C. N. Potts, and B. M. Smith, “Constraint Interfaces Series), chapter 8. published by Springer,
satisfaction problems: Algorithms and applications,” ISBN:978-0-387-71919-1, 2007.
European Journal of Operational Research, vol. 119, pp. [26] O. Mahdi, R. N. Ainon, and R. Zainuddin, “Using a genetic
557–581, 1999. algorithm optimizer tool to generate good quality timetable,”
[9] G. M. White and P. W. Chan, “Towards the construction of in Proc. of the 10th IEEE International Conference, vol. 3, pp.
optimal examination timetables,” INFOR 17, pp. 219–229, 1300–1303, 2003.
1979.

259
251
[27] C. Blum and A. Roli, “Metaheuristics in combinatorial
optimisation: Overview and conceptual comparison,” ACM
Computing Surveys, vol. 35 (3), pp. 268–308, 2003.
[28] P. Pongcharoen, C. Hicks, and P. Braiden, “The development
of genetic algorithms for the finite capacity scheduling of
complex products, with multiple levels of products
structure.,” European Journal of Operational Research, vol.
152(1), pp. 215–225, 2004.
[29] A. Colorni, M. Dorigo, and V. Maniezzo, “Metaheuristics for
high school timetabling,” computational Optimisation and
Application Journal, vol. 9, pp. 277–298, 1998.
[30] J. Caldeira and C. Agostinho, “School timetabling using
genetic search,” In: Proceedings of the Practice and Theory
of Automated Timetabling, University of Toronto, Toronto,
pp. 115–122, 1997.
[31] P. Pongcharoen, C. Hicks, P. Braiden, and D. Stewardson,
“Determining optimum genetic algorithm parameters for
scheduling the manufacturing and assembly of complex
products,” International Journal of Production Economics,
vol. 78(3), pp. 311–322, 2002.
[32] C. Cheong, K. Tan, and B. Veeravalli, “Solving the exam
timetabling problem via a multi-objective evolutionary
algorithm - a more general approach,” Computational
Intelligence in Scheduling, 2007. SCIS ’07. IEEE Symposium
on, pp. 165–172, 2007.

260
252

View publication stats

Вам также может понравиться