0% found this document useful (0 votes)
1 views

Reading paper 1

This document presents a hybrid Cat Swarm Optimization (CSO) algorithm designed to solve the high school timetabling problem, demonstrating its efficiency with real-world data from Greek high schools. The proposed algorithm outperforms many existing methods in terms of computational time and quality of results. The manuscript is accepted for publication in the Applied Soft Computing journal and outlines the algorithm's structure, performance comparison, and problem formulation.

Uploaded by

warda.tariq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

Reading paper 1

This document presents a hybrid Cat Swarm Optimization (CSO) algorithm designed to solve the high school timetabling problem, demonstrating its efficiency with real-world data from Greek high schools. The proposed algorithm outperforms many existing methods in terms of computational time and quality of results. The manuscript is accepted for publication in the Applied Soft Computing journal and outlines the algorithm's structure, performance comparison, and problem formulation.

Uploaded by

warda.tariq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

Accepted Manuscript

Title: Solving the high school timetabling problem using a


hybrid cat swarm optimization based algorithm

Author: Vassilios I. Skoullis Ioannis X. Tassopoulos


Grigorios N. Beligiannis

PII: S1568-4946(16)30562-2
DOI: http://dx.doi.org/doi:10.1016/j.asoc.2016.10.038
Reference: ASOC 3888

To appear in: Applied Soft Computing

Received date: 20-4-2016


Revised date: 23-9-2016
Accepted date: 31-10-2016

Please cite this article as: Vassilios I.Skoullis, Ioannis X.Tassopoulos, Grigorios
N.Beligiannis, Solving the high school timetabling problem using a hybrid
cat swarm optimization based algorithm, Applied Soft Computing Journal
http://dx.doi.org/10.1016/j.asoc.2016.10.038

This is a PDF file of an unedited manuscript that has been accepted for publication.
As a service to our customers we are providing this early version of the manuscript.
The manuscript will undergo copyediting, typesetting, and review of the resulting proof
before it is published in its final form. Please note that during the production process
errors may be discovered which could affect the content, and all legal disclaimers that
apply to the journal pertain.
Solving the high school timetabling problem using a hybrid cat
swarm optimization based algorithm
Vassilios I. Skoullisa, Ioannis X. Tassopoulosb and Grigorios N. Beligiannisb*
a
School of Science and Technology, Hellenic Open University,

Parodos Aristotelous 18, 26335 Patra, Greece


b
Department of Business Administration of Food and Agricultural
Enterprises, University of Patras, G. Seferi 2, GR-30100 Agrinio, Greece
*
Corresponding author

G. Seferi 2, GR-30100 Agrinio, Greece

Tel: 0030-2641074194, Fax: 0030-2641074179, E-mail: [email protected]

1
Graphical abstract

Execute initialization procedure to


Main process
initialize 30 cats

Set global_best_fitness to worst possible

Set iteration_counter equal to 1

Set current_cat equal to first cat

Calculate fitness value of current_cat

NO
Is current_cat’s fitness smaller or equal to
global_fitness_fitness?

YES

Set global_best_fitness equal to current_cat’s fitness


and
global_best_cat equal to current_cat

Choose a random value between 0 and 1

YES NO
Is random number > MR

Set current cat to Set current cat to


Seeking Mode Tracing Mode

YES Set current_cat


Are there any other cats?
equal to next cat

NO

Set iteration_counter equal YES Is iteration_counter


to iteration_counter +1 smaller than 5000?

NO

Execute local search refining procedure in


order to improve the quality of the resulted
timetable concerning the third performance
criterion, that is, teachers’ gaps.

Resulted timetable

General overview of the proposed hybrid CSO based algorithm

2
Highlights
 A hybrid Cat Swarm Optimization (CSO) based algorithm has been designed and applied to the
school timetabling problem.
 The algorithm has been tested with real-world input data coming from many different Greek high
schools.
 Computational results showed that the proposed algorithm achieves better results compared to the
majority of other algorithms published in the literature applied to the same input instances.

3
Abstract
In this contribution we present the application of a hybrid cat swarm optimization (CSO) based algorithm
for solving the school timetabling problem. This easy to use, efficient and fast algorithm is a hybrid
variation of the classic CSO algorithm. Its efficiency and performance is demonstrated by conducting
experiments with real-world input data. This data, collected from various high schools in Greece, has also
been used as test instances by many other researchers in their publications. Results reveal that this hybrid
CSO based algorithm, applied to the same school timetabling test instances using the same evaluation
criteria, exhibits better performance in less computational time compared to the majority of other existing
approaches, such as Genetic Algorithms (GAs), Evolutionary Algorithms (EAs), Simulated Annealing
(SA), Particle Swarm Optimization (PSO) and Artificial Fish Swarm (AFS). The algorithm’s main
process constitutes a variation of the classic CSO algorithm, properly altered so as to be applied for
solving the school timetabling problem. This process contains the main algorithmic differences of the
proposed approach compared to other algorithms presented in the respective literature.

Keywords: Cat Swarm Optimization, Hybrid Algorithm, School Timetabling Problem, Educational
Organization

4
1. Introduction

In this contribution, we tackle the problem of creating efficient and effective timetables for real world
high schools, which is commonly known as the “school timetabling problem”. This problem, which is the
main research interest of many scientists [1], involves the weekly scheduling of all courses of a high
school [2]. More precisely, we are required to schedule a given set of meetings between students and
teachers so that the resulting timetables are feasible and acceptable to all parties involved. The constraints
that must be satisfied belong to two categories: a) hard constraints and b) soft constraints. The first
category of constraints includes all constraints that must be satisfied so that the resulting timetable can be
implemented immediately. A solution timetable satisfying all hard constraints is called feasible. The
second category of constraints refers to specific preferences of the respective parties (teachers, courses,
etc.) and their satisfaction determines the timetable’s quality [2].

The school timetabling problem constitutes one of the three parts of educational timetabling problems
[3], the other two being: the course timetabling problem [4] and the examination timetabling problem [5].
The primary objective behind course timetabling is to place each course at a time (or set of times) which
does not conflict with the time(s) assigned to any other required course attended by its students.
Examination timetabling involves, on one hand, scheduling the examinations of a set of university
courses avoiding overlapping examinations for the same students and, on the other hand, spreading out
these examinations as much as possible. All three parts are proved to be Nondeterministic Polynomial
time (NP)–complete in their general form as explained in detail in respective references [6-8]. This means
that, even with the use of a supercomputer, finding a single, simple answer could be hard with a non-
heuristic method to truly large input instances.

Many variants of the high school timetabling problem and their attempts to solve them can be found
in respective references [1,9-11]. Their fundamental differences are attributed to the uniqueness of each
country’s educational system. For example, Boland et al. deal with solving the course blocking and
population problem in the Australian case by creating two integer linear programming models [12].
Moura and Scaraficci solve the high school timetabling problem for three Brazilian high schools using a
basic Greedy Randomized Adaptive Search Procedure (GRASP) heuristic followed by a path-relinking
improvement [13]. Santos et al. presented a column generation approach for establishing bounds for a set
of datasets originating also from Brazil [14]. Sørensen and Stidsen suggested an Adaptive Large
Neighborhood Search (ALNS) algorithm for solving the high school timetabling problem in Denmark
[15]. Avella et al. used a hybrid algorithm, consisting of a Simulated Annealing (SA) for the initial
solution and a Large Neighborhood Search (LNS) for improvements that was tested on two real life
instances from Italy [16]. Finally, Post et al. presented a cyclic transfer algorithm for the high school
timetabling problem and tested it on four Dutch high schools and one English high school [17].

5
Lately, many papers have been published on specific techniques dealing with the high school
timetabling problem [18,19,21,23-28]. Raghavjee and Pillay compared the performance of Genetic
Algorithms (GAs) as opposed to Genetic Programming (GP) in solving a set of hard high school
timetabling problems [18]. Sørensen et al. described an algorithm based on adaptive large neighborhood
search for solving the generalized high school timetabling problem [19], as presented in the International
Timetabling Competition 2011 (ITC 2011) [20]. Domrös and Homberger presented an evolutionary
algorithm for high school timetabling problems [21] where an indirect representation of timetables is
used while the evolutionary search is controlled by the population concept of the (1+1) – Evolution
Strategy [22]. Kalender et al. described a curriculum-based course timetabling problem at Yeditepe
University and presented an iterative selection hyper-heuristic as a solution method [23]. The Hyper-
heuristic Search Strategies and Timetabling (HySST) team presents a fairly standard stochastic search
method significantly enhanced by a selection hyper-heuristic with an adaptive acceptance mechanism
[24]. Da Fonseca et al. presented a local search approach to the high school timetabling problem [25].
Ahmed et al. evaluated the performance of a range of selection hyper-heuristics combining different
reusable components for high school timetabling [26]. Al-Yakoob and Sherali investigated two
decomposition approaches to solve a high school timetabling problem in a case study related to Kuwait’s
public educational system [27]. Finally, Dorneles et al. used three different types of decompositions –
class, teacher and day – in order to solve the high school timetabling problem [28].

Cat Swarm Optimization (CSO) based algorithms belong in the wide family of algorithms that,
inspired by the mechanisms of nature, imitate the collective behavior of non-distributed, self-organized
physical systems [29-32]. CSO algorithms were firstly introduced by Chu et al. [30]. The key motivation
for proposing this new category of population-based algorithms was their observation of cat behavior and
especially the way cats seek their environment and hunt. Although all cats are born with the hunter’s
instinct, when young they are still trained by their mother to hunt. In addition, cats inherently possess a
resilient curiosity for anything that is moving around them. However, they spend most of their time lying
on the ground even when they are not sleeping. While cats give the impression of being lazy, in fact they
are always watchful and ready for action. As a result, even when they rest, they are still scrutinizing their
environment with their eyes constantly ready to interfere when needed.

CSO based algorithms have been applied lately, with very satisfactory results, in many constrained
optimization problems [33-38]. Panda et al. formulated the Infinite Impulse Response (IIR) system
identification task as an optimization problem and used CSO to develop a new population-based learning
rule for the model [33]. Wang et al. adopted a CSO strategy to obtain the optimal or near optimal solution
of the stego-image quality problem [34]. Pradhan and Panda extended CSO in order to design a new
multi-objective evolutionary algorithm [35]. Tsai et al. presented an enhanced parallel CSO method for
solving numerical optimization problems [36]. Kumar et al. proposed an optimal placement and sizing of
multiple distributed generators for achieving higher overall system reliability in large-scale primary

6
distribution networks using CSO [37]. Finally, Hadil and Sabah presented an improved CSO algorithm
for solving numerical optimization problems [38].

In this paper we investigate whether a CSO based algorithm can effectively solve the high school
timetabling problem. The proposition in this contribution is twofold:

 We introduce the concept of applying an easy to use and not time exhausting CSO based
algorithm in order to solve the high school timetabling problem.
 The hybrid CSO based algorithm manages to achieve very satisfactory and in less
computational time results comparable to the best ever, so far, reported for a well-established
school timetabling benchmark [1,10,39-45].

More precisely, this soft computing algorithm is applied to real-world data collected from various
high schools in Greece. The specific input data set, used to evaluate the performance of the hybrid CSO
based approach, consists of ten school timetabling instances that have been widely used in respective
references [39-45] while six (6) of these instances constitute the well-established Beligiannis benchmark
[1,10,44]. Results reported in section 4 are used in comparing the performance of the hybrid CSO based
approach with other soft computing approaches [39-45] applied to the same school timetabling instances.

For a fair comparison of the hybrid CSO based algorithm to other approaches, we model the high
school timetabling problem using the same formalism and making an effort to minimize the same fitness
function while using the same evaluation criteria which are the following [41,44]:

1. teachers’ teaching hours’ distribution i.e. how uniform is the distribution of each
teacher’s hours in the days he/she is available
2. lessons’ hours’ distribution i.e. how uniform is the distribution of the hours of the
same lesson for each class in the days it’s taught
3. teachers’ gaps i.e. the number of idle hours individual teachers have available
between their teaching hours

As presented in Section 3.4, the hybrid CSO based algorithm attempts to minimize the
aforementioned first two criteria using a basic CSO based algorithm while also attempting to minimize
the third one using a local search procedure that has been originally introduced by Tassopoulos and
Beligiannis [2,3]. The fact that the proposed CSO based algorithm consists of two different parts justifies
its characterization as a hybrid one.

This contribution is organized as follows: in Section 2 the mathematical model of the problem to be
solved is presented while in Section 3 the structure and the operation of the hybrid CSO based algorithm
are presented. In Section 4 its performance is compared to that of existing approaches while in Section 5
the conclusions are summarized along with a discussion of future work.

7
2. Formulation of the problem

2.1. Hard Constraints

There are three types of hard constraints involved in the proposed formulation: a) constraints
referring to classes, b) constraints referring to teachers, and c) constraints referring to co-teaching.

Regarding classes, the hard constraints that are employed in the proposed formulation are as follows:

1. Classes’ clash: in each class there cannot be taught more than one lesson at a given time period.
Also, a class should be assigned, only one teacher at any time period with the exception of Co-
teaching restrictions (see below).
2. Classes’ idle time periods: each class is permitted to have an idle time period only at the last hour
of any given day.

Regarding teachers, the hard constraints used in the current formulation are the following:

1. Teachers’ clash: each teacher cannot teach more than one class at any given time period.
2. Teachers’ availability: each teacher cannot teach in periods he/she is not available.
3. Teachers-classes-lessons assignment: the number of hours and lessons each teacher can teach to
any class is fixed and predefined by input data.

Regarding co-teaching, the hard constraints incorporated in proposed formulation are as follows:

1. Co-teaching restrictions: if two teachers should both teach the same class simultaneously, then
they are both assigned the same class for the same time period(s). In addition, if two teachers,
teaching to two different classes, are meant to teach simultaneously then they have to teach their
classes at the same time period(s) [41,42].

2.2. Soft Constraints

Employed in the proposed formulation are soft constraints that constitute the three applied criteria in
measuring the quality of each resulting timetable as follows:

1. Distribution of teaching hours of each lesson: measures how uniform is the distribution of the
hours of the same lesson for each class in the days it’s taught
2. Distribution of teaching hours of each teacher: a measure of how uniform is the distribution of
each teacher’s hours in the days he/she is available.
3. The number of gaps of each teacher: counts the number of idle hours each teacher has available
between his/her teaching hours.

2.3. Mathematical Model

The data sets used in the formulation of the problem’s model are the following:

8
 { } is the set of teaching days per week.

 { } is the set of teaching hours per day.

 { } is the set of different lessons taught at a school.

 { } is the set of different classes of a school.

 { } is the set of teachers working at a school.

 is the set of unavailable time periods of teacher t.


 is the set of the last hours of all days.
 is a set of events (meetings) such that to each event a teacher-class pair and a given
number of lessons that must be scheduled is preassigned [46].
 is a set of events that are assigned to teacher t.
 is a set of tuples for .

All variables and functions used in the problem’s formulation model are as follows:

 {

 {

 {

 is the number of different subjects that teacher t teaches to class c, which is


predefined by input data.
 is the total number of teaching hours that class c can be taught in a
week, which is predefined by input data.
 is the total number of teaching hours that teacher t can teach in
a week, which is predefined by input data.
 is the minimum number of teaching hours that should be assigned to
teacher t at day d so as the distribution of his/her teaching hours are uniform.
 is the maximum number of teaching hours that should be assigned to
teacher t at day d so as the distribution of his/her teaching hours are uniform.
 is the idle times of teacher t between time slots m and n on day d [46].

 {

The soft constraints costs defined in the formulation of the problem’s model are as follows [45]:

 ∑ (1)

where { (2)

9
and is the weight of the respective soft constraint as presented by Tassopoulos and Beligiannis
[41]. If ∑ , this means that teacher t teaches at least one subject at class c at day d
more than one hour (twice or more).
 ∑ ∑ (3)
∑ ∑
where { (4)

and is the weight of the respective soft constraint as presented by Tassopoulos and Beligiannis
[41].
 ∑ ∑ ` (5)

where and

( ∑ ( ∑ )) (6)

According to inequality (6), if variables are activated and there are no teaching periods between them,
the value of equals which is the number of idle periods between m and n. This
formulation of teachers’ gaps cost was introduced by Dorneles at al. in 2012 [46]. Also, is the
weight of the respective soft constraint as presented by Tassopoulos and Beligiannis [41].

Concluding, given the above described mathematical model, the aim of the high school timetabling
problem can be expressed as follows:

(7)

under the following constraint conditions:

 ∑ (( ) ( )) (8)

(Classes’ clash constraint, section 2.1)


 ∑ ( ) (9)
(Classes’ idle time periods constraint, section 2.1)

 ∑ (( ) ( )) (10)

(Teachers’ clash constraint, section 2.1)


 ∑ ( ) (11)
(Teachers’ availability constraint, section 2.1)
 ∑ ∑ ∑ (12)
(Teachers’ teaching hours assignment constraint, section 2.1)
 ∑ ∑ ∑ (13)
(Classes’ teaching hours assignment constraint, section 2.1)

 ∑ (( ) ( ) )

10
(14)
(Co-teaching constraints, section 2.1)

3. The hybrid CSO based algorithm

3.1. The original CSO algorithm

The optimization process of the original CSO algorithm matches the food seeking process of cats.
The global optimum corresponds to food while the solution space corresponds to the area where the food
is located [29,30]. Every single solution is represented by a cat investigating the search area. Initialization
of the algorithm is accomplished by initializing a number (swarm) of cats. Every cat has its own position
in the solution space composed of M dimensions, distinct velocities for each dimension and an individual
fitness value calculated by using the relevant fitness function [29,30]. Each cat investigates the search
area for food i.e. tries to find a solution having a better fitness value. At any iteration, the CSO algorithm
calculates the fitness value of each cat, compares it to the best value up to that point – best cat – and if it
is better – lower, in a minimization process – then this cat becomes the best cat.

According to the classic CSO approach [29,30], here are two different states in which a cat can be
during the optimization process: a) Seeking Mode and b) Tracing Mode. In Seeking Mode, each cat rests
while examining its environment in order to decide which move should be its next one. In Tracing Mode,
each cat moves rapidly hunting for food. The value of a Boolean variable determines whether a cat is in
Seeking Mode or Tracing Mode.

The way a cat is acting in Seeking Mode is affected by four parameters: i) Seeking Memory Pool
(SMP), ii) seeking Range of the Selected Dimension (RSD), iii) Count of Dimensions to Change (CDC)
and iv) Self-Position Consideration (SPC) [29,30]. The steps (in pseudocode) that each cat k (catk) is
going to execute while being in Seeking Mode are presented below:

Step 1: create j copies of the current position of catk, Note: j = SMP


If (the value of parameter SPC is true)
j = (SMP − 1)
add the current position into the pool of candidate position to be moved to
Step 2: For (each copy)
change the value of CDC dimensions at random, Note: these changes cannot
exceed a percent ± RSD
Step 3: calculate the fitness value for all candidate positions
Step 4: If (the calculated finesses are not equal with each other)
calculate the probability Pi of selecting each candidate position
else
Pi = 1.0, Note: for all i

11
Step 5: pick at random, among candidate positions, the position to which catk will be moved
place catk to this position

Probability Pi, which is the probability of each candidate position to be selected for moving catk
there, is computed using equation (15):

, where 0 < i < j (15)

where FSi is the fitness value of position i, FSmax is the biggest fitness value found, FSmin is the smallest
fitness value found and FSb is equal to FSmax for maximization problems and equal to FSmin for
minimization problems, respectively.

Table 1. Parameters incorporated in the original CSO algorithm


TYPICAL
PARAMETER DESCRIPTION
VALUE
Number of cats 5 to 100 Its value depends on the nature and complexity of the
problem to be solved. Obviously, a bigger value leads to
better coverage of the search space, requiring however longer
execution time.
Number of iterations 500 to 2000 Its value depends on the nature and complexity of the
problem to be solved. Obviously, a bigger value leads to
better exploration of the search space, requiring however
longer execution time.
Seeking Memory Pool 2 to 10 The number of positions examined by each cat. The bigger
(SMP) the value the more positions each cat will examine.
Self-Position True A Boolean parameter that dictates whether the cat’s current
Consideration (SPC) position will be included in the pool of candidate positions to
move to. If its value is true, the cat may remain in its current
position. If its value is false, the next position of the cat will
be certainly a different one.
Number of dimensions 30 Its value depends solely on the nature of the problem at hand.
of the search space (Μ) (see [29])
Count of Dimensions to 80% Expresses the percentage of dimensions that alter their values
Change (CDC) at each iteration of the algorithm. The bigger its value the
more dimensions have their values altered. Obviously, a
bigger value leads to better exploration of the search space,
requiring however longer execution time.
Selected Range 20% Expresses the maximum percentage each dimension can vary,
Dimensions (SRD) thus defining the maximum number of changes occurring to
the dimension. A big value in this parameter leads to bigger
variations of each dimension’s value.
Mixing Ratio (MR) 2% Defines the percentage of cats being in Tracing Mode.

The steps (in pseudocode) that each cat k (catk) is going to execute while being in Tracing Mode are
presented below:

Step 1: update the velocity of each dimension of catk


Step 2: If (the value of a velocity is outside allowed range)
set it equal to the maximum allowed value
Step 3: update the position of catk

12
The velocity of each dimension of catk is updated according to equation (16):
( ) d = 1, 2, ..., M (16)
where is the position of the cat having the best fitness value up to that moment, is the position
of catk, is a constant affecting the change in the velocity of each dimension (most of the times set equal
to 2.0 [47-49]) and is a random value belonging to [0 1].
The position of catk is updated according to equation (17):
(17)

These two modes (Seeking Mode and Tracing Mode) are combined in the original CSO algorithm
using a ratio determined by the parameter Mixture Ratio (MR) [29,30]. This parameter is usually set to a
very small value favoring the Seeking Mode and thus reflecting the true behavior of cats, which spend
most of their time – when awake – monitoring their environment instead of hunting for food. A more
detailed description concerning the structure and operation of both modes is referenced in [29,30].
Moreover, some recent variations of the basic CSO algorithm are presented in [36,50-53].

The original CSO algorithm, as introduced by Chu and Tsai [29] and Chu et al. [30], incorporates a
number of user defined parameters that affect significantly both its operation and its performance. These
parameters are described in detail in Table 1.

3.2. The CSO based solution approach

3.2.1. Representation of cats

The weekly schedule of a typical Greek high school is comprised of five teaching days per week with
seven teaching hours per day for a total of 35 teaching hours per week. Therefore, for each cat that
represents the weekly schedule, a two-dimensional array having Number_of_classes as rows
(Number_of_classes equals the total number of classes taught at a school) and Number_of_time_slots as
columns (Number_of_time_slots equals the total teaching hours per week) can be used [2].

Table 2. Cat’s representation (example)

Time period 1 Time period 2 … Time period 35


Class 1 12 2 … 15
Class 2 7 10 … -1
… … … … …
… … … … …
Class Ν 4 9 … -1

Let xi be the i-th cat. Each cell xi[r][c] (r=1… Number_of_classes, c=1…Number_of_time_slots)
represents a teaching hour (i.e. time period) and contains a number ranging from 1 to
Number_of_teachers (Number_of_teachers is the total number of teachers at each high school) or the

13
value “-1”. An example of the proposed cat’s representation is presented in Table 2. If the cell at the 2nd
row and the 2nd column of xi (i.e. xi[2][2]) contains “10”, it means that the teacher who is assigned
number “10” teaches one of his/her lessons at a class assigned number “2” at time period “2” (i.e.
Monday, 2nd hour). If xi[2][35] contains “-1”, it means that the class assigned number “2” has an empty
time period at the teaching hour assigned number “35” (i.e. Friday, 7th hour). The main advantages of this
encoding are reported by Tassopoulos and Beligiannis in [41].

3.2.2. Representation of co-teaching cases

There are two types of co-teaching cases encountered in high schools. The first type occurs when a
class has to be assigned two teachers at the same time periods. The second type occurs when two classes
must have their assigned teachers teaching at the same time periods. In both cases, the situation transpires
temporarily, for educational and operational reasons, and lasts for a limited number of lessons/teaching
hours. In the second type of co-teaching, the involved classes are called co-classes. Each class is the co-
class of the other one. Furthermore, at both types of co-teaching, the involved teachers are called co-
teachers. Each one is the co-teacher of the other teacher.

The representation of co-teaching cases is treated as follows: Regarding the first type, we assign
teaching hours only to the first co-teacher. The presence of the second co-teacher in the cat (timetable) is
tacitly implied by the presence of the first one. Nevertheless, the second co-teacher is taken into account
in order to evaluate any constraint’s violation. Regarding the second type of co-teaching, both teachers
are explicitly present in the cat (timetable), each one teaching at his/her own time period(s).

3.2.3. Evaluation function

In the proposed hybrid CSO based approach we decided not to dismiss cats violating hard constraints,
but to deal with them in the following way: for each violated hard constraint we add a significantly higher
sub-cost compared to the sub-costs added for soft constraint violations. As demonstrated by experimental
results in Section 4, this approach succeeds in finding very effective timetables that meet all the hard
constraints. The hard and soft constraints involved in the utilized evaluation function are described in
Section 2.

Table 3. Weights used by the evaluation function for the calculation of sub-costs
WEIGHT VALUE PURPOSE
Hard Constraints’ Weight (HCW) 10 Penalize infeasible timetables
Ideal Classes’ Dispersion Weight (ICDW) 0.95 Penalize the violation of the distribution of
teaching hours of each lesson constraint
Ideal Teachers’ Dispersion Weight (ITDW) 0.6 Penalize the violation of the distribution of
teaching hours of each teacher constraint
Teachers’ Empty Periods Weight (TEPW) 0.06 Penalize the violation of the number of
gaps of each teacher constraint

14
The cost calculation is performed applying the same method developed by researchers in [40-45], so
as to be able to have a fair comparison of our CSO based approach with the corresponding soft
computing algorithms. In Table 3 the weights and their respective values used by the evaluation function
for the calculation of each sub-cost are presented. These weights have been introduced by Beligiannis et
al. [43] and their respective values have been slightly modified by Tassopoulos and Beligiannis [41].

An additionally implemented user-defined parameter that affects the behavior of the evaluation
function is the exponential growth base (BASE). This parameter is used as a base for the exponential
growth of the sub-costs corresponding to violations of certain constraints. For all experiments conducted,
its value was set to 1.3.

The mathematical formula of the utilized evaluation function is the one presented by Tassopoulos and
Beligiannis [41] and Beligiannis et al. [43]. It incorporates all hard and soft constraints listed in Section 2
and has the form presented in equation (18):

(18)

For an exact description of all the procedures used to evaluate the sub-cost of each hard and/or soft
constraint violation refer to [41].

3.4. General overview of the hybrid CSO based algorithm

The general overview of the hybrid CSO based algorithm is presented using a flowchart in Fig. 1. It
is indeed a hybrid algorithm, as it consists of two separate basic parts, which are executed sequentially:

1) The main process, which is the basic CSO based algorithm of the proposed approach.

2) A local search refining procedure, applied right after the main process, in an attempt to improve
the quality of the resulted timetable in regards to the third performance criterion i.e. teachers’
gaps.

The main process of the hybrid CSO based algorithm is a discrete-space constraint-optimization
version of the basic CSO algorithm [29,30]. It uses a population of 30 cats, is executed for 5,000
iterations and has its MR value set to 4%. These values were selected as a result of exhaustive
experiments of a trial and error method. The initialization procedure, which is used to initialize the

15
population of 30 cats, and the local search refining procedure, which is used to reduce the number of
teachers’ empty periods, are identical to the ones proposed by Tassopoulos and Beligiannis [41] (where
you may find more detailed information).

Execute initialization procedure to


Main process
initialize 30 cats

Set global_best_fitness to worst possible

Set iteration_counter equal to 1

Set current_cat equal to first cat

Calculate fitness value of current_cat

NO
Is current_cat’s fitness smaller or equal to
global_fitness_fitness?

YES

Set global_best_fitness equal to current_cat’s fitness


and
global_best_cat equal to current_cat

Choose a random value between 0 and 1

YES NO
Is random number > MR

Set current cat to Set current cat to


Seeking Mode Tracing Mode

YES Set current_cat


Are there any other cats?
equal to next cat

NO

Set iteration_counter equal YES Is iteration_counter


to iteration_counter +1 smaller than 5000?

NO

Execute local search refining procedure in order


to improve the quality of the resulted timetable
concerning the third performance criterion,
that is, teachers’ gaps.

Resulted timetable

Fig. 1. General overview of the hybrid CSO based algorithm

16
Our hybrid CSO based algorithm, as described in Fig.1, has two basic variances as opposed to the
original CSO:

1) The first difference regards the comparison of the current cat’s fitness to the global_best_fitness
and the respective update of the global_best_cat. In order to increase the diversity of the cats, the
global_best_cat is updated even when the current_cat’s fitness is equal to the global_best_fitness
computed up to that point.

2) The second difference regards the way each cat is set to either Seeking or Tracing Mode. More
specifically, for all the cats, setting current_cat to either Seeking or Tracing Mode is not
performed at the end of each iteration. It is rather done independently for each cat in a random
way based on the value of variable MR. All the adjustments made to the basic procedures of the
CSO algorithm in order to make it applicable to the high school timetabling problem are
described in Sections 3.4.1, 3.4.2 and 3.4.3.

3.4.1. Modified Seeking Mode procedure

The pseudocode of the modified Seeking Mode procedure adjusted for use by our hybrid CSO
algorithm is presented in Table 4.

Table 4. Pseudocode of the modified Seeking Mode procedure


1. For (each cat c in seeking mode)
2. best_fitness = fitness of current cat c
3. If (SPC is true)
4. j = SMP−1
5. keep the current cat c as a candidate position to be moved to
6. Else
7. j = SMP
8. make j copies (cat_copy) of the current position of cat c
9. tc = CDC Number_of_time_slots, Note: total number of timeslots to be replaced

10. sm = SRD Number_of_classes Number_of_time_slots, Note: total number of swaps to be made

11. For (each cat_copy)


12. execute procedure Change_random(), Note: insert tc random timeslots from global_best cat to
cat_copy
13. For (sm times)
14. execute procedure Single_swap(), Note: make a random cell swap in cat_copy
15. If (swap is valid)
16. calculate the new fitness value of mutated cat_copy
17. If (new fitness value < = best_fitness)
18. best_fitness = new fitness value
19. set this mutated cat_copy as candidate position

17
20. calculate the fitness values of all candidate positions
21. If (the fitness values of all candidate positions are not equal) , Note: a cat having better fitness than initial
best_fitness has been found
22. calculate the selection probability of each candidate position, Note: based on its difference from global
best cat
23. Else
24. set selecting probability of each candidate equal to 1
25. pick randomly from the candidate positions the one to move to
26. update the position of current cat c

The user-defined parameters used in the Seeking Mode procedure are set as follows: SMP=2,
SPC=true, CDC=10% and SRD=10%. These specific values were selected after exhaustive experiments
of a trial and error method. This modified Seeking Mode procedure, which is applied to every cat of the
current population, is presented in the following paragraphs.

Initially, the fitness value of the current cat is calculated and stored in the variable best_fitness (line
2). Next, if the value of the parameter SPC is true, the current position is selected as a candidate position
to be moved to (lines 3-5) and j=SMP-1=1 copy of the current cat is created (called cat_copy) (line 8). In
the proposed approach, since parameter SPC is set to true, one of the two candidate positions for moving
the current cat to is its current position. This means that if the position of the current cat is “close” to the
position of the global best cat (called global_best), the current cat may keep its position since its fitness
value is “good” enough (line 21-26). The selecting probability of the current cat is calculated using
equation (15) presented in Section 3.2 (line 22).

In lines 11-19 the main part of the Seeking Mode procedure is listed. The copy of the current cat
(cat_copy) undertakes a series of changes based on the values of the CDC and SRD parameters. In the
proposed approach the dimensions of the search space are 35, since 35 is the number of time slots of the
school timetable.

The logic of the procedure is as follows:

• At first, the seek mode procedure replaces CDC Number_of_time_slots from cat_copy
using time slots from global best cat so as to enrich its fitness (line 12). The selection and
replacement of these time slots is performed by procedure Change_random(), which is
explained in detail in Section 3.4.3.
• Next, on this enriched cat, SRD Number_of_classes Number_of_time_slots swaps are
performed using procedure Single_swap() (line 14). This procedure is also explained in
Section 3.4.3. A swap is accepted, only if it is valid, i.e. not violating hard constraints (line
15). When a valid swap is performed, the fitness value of the mutated cat_copy is calculated
(line 16) and if it is smaller or equal to the best_fitness value up to that point, the best_fitness

18
value is updated and the position of this mutated cat_copy is selected as the second candidate
position for the current cat to move to (lines 17-19). This way, the second candidate position
is always the one of the best mutated cat_copy as opposed to the one resulting after all swaps
are executed cumulatively in the original CSO algorithm.

3.4.2. Modified Tracing Mode procedure

The pseudocode of the modified Tracing Mode procedure adjusted for use by our hybrid CSO
algorithm is presented in Table 5.

In the original CSO algorithm, the value of the velocity depends on the difference between the
position of the global best cat and that of the current cat (see equation (16) in Section 2.2). In our
approach:

• Firstly, we estimate the similarity between the global best cat and the current cat by comparing
their respective cells one by one (line 2). For each similar cell (i.e. having the same fitness value)
the similarity variable is incremented by one. The maximum value that similarity can have is
Number_of_classes * Number_of_time_slots (this occurs when two cats are alike). Respectively,
the minimum value that similarity can have is zero (this occurs when all the cells of the two cats
vary)
• Next, the distance between the current cat and that of the global best cat is calculated (line 3).
The bigger the distance the more intense the movement of the current cat is going to be (i.e. a
larger number of its cells will be modified).
• Then, the value of the parameter cs, which is the number of cells to be swapped, is calculated
(line 5). This number is actually implemented as the equivalent of the original CSO algorithm’s
“velocity”. This approach comprises just another difference between the two algorithms.
• Finally, cs pairs of cells are selected at random and their values are swapped executing the
Single_swap() procedure (line 6).

Table 5. Pseudocode of the modified Tracing Mode procedure


1. For (each cat in tracing mode)
2. calculate similarity of current cat with global best cat
3. distance = (Number_of_classes Number_of_time_slots) – similarity, Note: calculate distance
4. rand_number = rand(0,1), Note: calculate a random number belonging to [0 1]
5. cs = rand_number c1 distance, Note: calculate number of cells to be swapped
6. execute procedure Single_swap(), Note: perform cs cell swaps between pairs of cells selected at
random

19
3.4.3. Auxiliary procedures

3.4.3.1. The Change_Random() procedure

This procedure adheres to the idea of random successive cell replacements, which was firstly
introduced by Chu et al. [54]. Tassopoulos and Beligiannis applied a variation of this approach resulting
in replacement of whole columns [3]. The proposed procedure adheres to this particular variation. More
precisely, a column (i.e. time period) of cat_copy (i.e. copy of current cat) is selected at random and is
replaced by the respective column of global_best cat. This leads to a significant enrichment of cat_copy.

For example, assume that: i) the cat_copy has the form presented in Table 6a, ii) the global_best cat
has the form presented in Table 6b and iii) the randomly selected column to be replaced are in time
period 1. This means that all teachers teaching at time period 1 of cat_copy should be replaced by the
corresponding ones in the same time period of global best cat. It is certain that, due to the initialization
procedure [3] all of these teachers already appear in other time periods of each class constituting the
timetable temporarily infeasible. In order to have a feasible solution the following must be implemented:

a) Each class (i.e. row) of cat_copy is scanned in order to find its time period that has the same
value (i.e. teacher No) as the selected column of global_best cat (i.e. time period 1 in this
example).
b) Then, the values of these cells are exchanged. For example, teacher No.6 who teaches at class 1 is
exchanged with teacher No.4 (see Table 6c). If there are more than one cell having the same
value (i.e. teacher No) as the selected column of global_best cat, the cell to be exchanged is
selected at random (see Table 6c, class 3).
Table 6a. Example of global_best cat
Time Time Time Time Time

period 1 period 2 period 3 period 4 period 35
Class 1 4 …
Class 2 3 …
Class 3 8 …
Class 4 7 …
… … … … … …
Class n 5 …
Table 6b. Example of cat_copy
Time Time Time Time Time

period 1 period 2 period 3 period 4 period 35
Class 1 6 2 4 … 4
Class 2 2 3 …
Class 3 7 7 … 8
Class 4 1 7 7 …
… … … … … …
Class n 3 5 3 …

20
Table 6c. Example of copy_cat after the application of Change_random()
Time Time Time Time Time

period 1 period 2 period 3 period 4 period 35
Class 1 4 2 6 … 4
Class 2 3 2 …
Class 3 8 7 … 7
Class 4 7 7 1 …
… … … … … …
Class n 5 3 3 …

3.4.3.2. The Single_Swap() procedure

This procedure is implemented in order to exchange the values of two cells of the same class (i.e.
row) in a timetable. Its input consists of: a) the current cat, b) the randomly selected two cells to be
exchanged and c) the respective class. At first, we check whether the exchange can be performed.

The exchange is not performed in the following cases:

• If the cells have the same value (i.e. same teacher No)
• If one of the cells has value “-1” (i.e. empty cell – no teaching)
• If it results in placing one teacher to teach at an hour that he/she already teaches at another class.
This is a violation of hard constraint Teachers’ clash (see Section 2.1)

Exchanges violating all other constraints are permitted, thus assisting our hybrid CSO algorithm to
avoid being trapped in local optima at the early stages of its execution, as suggested by Tassopoulos and
Beligiannis [41].

4. Computational results

The CSO based algorithm presented in this contribution is coded in ANSI C and was run on a
machine featuring an Intel i7-2600 CPU running at 3.40 GHz, 8GB RAM and Windows 8.1 Pro 64-bit
OS. All the results exhibited in this section have been produced by retaining the same set of CSO
parameter values throughout, so as to achieve a fair comparison of this algorithm’s efficiency and
performance to those of other algorithms applied to the same input instances. The implemented cat’s
representation is the one presented in Section 3.2.1. The size of the population of cats was set to 30 (see
Fig. 1). The implemented fitness function is the one described in Section 3.2.3.

The hybrid CSO based algorithm is compared to seven very effective soft computing algorithms that
were previously adapted to solve the high school timetabling problem:

 a Genetic Algorithm (GA) [42]


 an Evolutionary Algorithm (EA) [43]
 a Simulated Annealing (SA) algorithm [40]

21
 two (2) Hybrid Particle Swarm Optimization (PSO) algorithms [41, 45]
 an Artificial Fish Swarm (AFS) based algorithm [45]
 a Genetic Algorithm Selection Perturbative Hyper-Heuristic (GASPHH) [44]

The input data set that was used to evaluate each algorithm’s performance consists of ten widely used
school timetabling instances [1,10,39-45]. Six of these instances constitute the well-established
Beligiannis benchmark [10,44]. Since all the algorithms implemented identical input instances we
achieve a fair comparison of them. The most important characteristics of the aforementioned input
instances are presented in Table 7. It should be noted that the input instance enumerated as 6 is missing
due to its absence in the corresponding publications. A detailed description of the aforementioned
instances can be found in [41-43].

Table 7. Major characteristics of the input instances used


Number of Number of Number of Number of Teachers involved Number of
Instance
Classes Teachers Teaching Hours in Co-teaching Co-teachings
1 11 34 385 9 36
2 11 35 385 17 67
3 6 19 210 0 0
4 7 19 245 6 31
5 6 18 184 0 0
7 13 35 455 17 70
8 5 11 150 0 0
9 6 15 202 0 0
10 7 17 210 0 0
11 9 21 306 0 0

All eight algorithms model the high school timetabling problem employing the same formalism and
assess the quality of each resulted timetable applying the same three evaluation criteria: a) distribution of
teaching hours of each lesson, b) distribution of teaching hours of each teacher and c) number of gaps of
each teacher (see Section 2.2). Therefore, it is justifiable to make a straightforward comparison of their
respective experimental results.

The performance and efficiency of our CSO based algorithm is demonstrated in Table 8 by
comparing the best timetables it constructed to the corresponding ones created by the other seven soft
computing algorithms [40-45]. Since all these approaches exhibit their best created timetables we present
and compare them with the best timetables constructed by our approach. It should be noted that in Table
8 we add one unit cost for every soft constraint violation among the three aforementioned quality criteria.
More precisely, the fitness function value (i.e. total cost) of each timetable is calculated as presented in
equation (19):

(19)

22
Table 8 illustrates that the hybrid CSO based algorithm manages to produce the best results reported,
so far, in eight out of ten input instances while having the same performance with the best algorithm
presented by Katsaragakis et al. [45]. Therefore, one can easily conclude that the hybrid CSO based
algorithm is very efficient and that applying CSO based techniques to timetabling problems is very
promising. The results demonstrated in Table 8 also suggest that our algorithm can definitely replace
other existing soft computing approaches since it constructs, in most cases, more efficient school
timetables.

Table 8. Total costs of the hybrid CSO approach and the algorithms presented in [40-45] (best ever found
timetables are in bold)
Hybrid Hybrid Hybrid
Instance AFS [45] GA [42] EA [43] SA [40] GASPHH [44]
CSO PSO [45] PSO [41]
1 11 11 16 75 70 29 15 60
2 18 18 21 86 76 37 17 66
3 5 5 7 20 20 8 7 17
4 5 5 9 41 41 28 8 43
5 0 0 0 10 10 3 0 15
7 24 23 32 109 109 40 32 83
8 11 11 11 23 21 22 11 Not mentioned
9 2 2 2 35 35 28 2 Not mentioned
10 10 10 10 28 26 23 10 Not mentioned
11 18 19 19 43 42 32 18 Not mentioned

Table 9 displays an execution time comparison between our approach and the algorithm presented by
Katsaragakis et al. [45], which is the best performing algorithm amongst all the other approaches reported
in Table 8. The hybrid CSO based algorithm manages to find comparable results to the best ever reported,
so far, achieving less execution time while implementing well-established school timetabling input
instances. In fact, the average improvement in execution time is 24.97%; a definitely strong advantage of
the hybrid CSO based approach.

Table 9. Average execution time comparison between the hybrid CSO approach and the Hybrid PSO
algorithm presented in [45]
Average execution time Improvement
Instance
Hybrid CSO Hybrid PSO [45] (less execution time)
1 28 mins 21secs 36 mins 36 secs 22.54%
2 35 mins 9 secs 47 mins 48 secs 26.46%
3 3 mins 42 secs 3 mins 54 secs 5.13%
4 8 mins 43 secs 13 mins 16 secs 34.30%
5 2 mins 13 secs 3 mins 26.11%
7 45 mins 44 secs 57 mins 54 secs 21.01%
8 1 min 17 secs 1 mins 48 secs 28.70%
9 3 mins 6 secs 4 mins 24 secs 29.55%

23
10 2 mins 31 secs 3 mins 42 secs 31.98%
11 5 mins 38 secs 7 mins 24 secs 23.87%

Due to the fact that the nature of the hybrid CSO based algorithm is stochastic, varied computational
results may be obtained in separate runs for each input instance. Therefore, in order to demonstrate the
algorithm’s efficiency and have a measure of the variability of its results, in Table 10 we present for each
input instance not only the best but also the worst and the average total cost values along with the
respective standard deviation (StD) and the coefficient of variation (CV). Furthermore, we also present
the respective best, average and worst execution time values. Moreover, in Fig. 2 and Fig. 3 we present
the box plots of the total cost values and execution times for each input instance respectively. All the
results in Table 10, Fig. 2 and Fig. 3 regarding the ten available input instances reflect execution of 100
Monte Carlo runs.

Box plots of total cost values for each input instance


50
48
46
44
42
40
38
36
34
32
30
Total cost

28
26
24
22
20
18
16
14
12
10
8
6
4
2
0
1 2 3 4 5 7 8 9 10 11
Instances

Fig. 2. Box plots of total cost values for each input instance (100 Monte Carlo runs)

Table 10. Computational experiments demonstrating the stability of the hybrid CSO based algorithm
(best ever found timetables are in bold)
Input Fitness function value (Total cost) Execution time (mins)
instance Best Worst Average StD CV Best Worst Average StD CV
1 11 23 16.24 2.49 0.15 25’ 16’’ 30’ 11’’ 28’ 21’’ 1’ 11’’ 0.04
2 18 30 22.83 2.65 0.12 32’ 30’’ 37’ 3’’ 35’ 09’’ 1’ 06’’ 0.03
3 5 10 7.50 0.96 0.13 2’ 51’’ 4’ 27’’ 3’ 42’’ 0’ 25’’ 0.11
4 5 14 9.67 1.87 0.19 7’ 35’’ 9’ 43’’ 8’ 43’’ 0’ 35’’ 0.06
5 0 1 0.13 0.34 -* 1’ 57’’ 2’ 50’’ 2’ 13’’ 0’ 13’’ 0.10
7 24 47 34.70 5.98 0.17 42’ 13’’ 49’ 20’’ 45’ 44’’ 2’ 18’’ 0.05

24
8 11 12 11.03 0.18 0.02 1’ 09’’ 1’ 25’’ 1’ 17’’ 0’ 04’’ 0.05
9 2 2 2.00 0.00 0.00 2’ 51’’ 3’ 24’’ 3’ 06’’ 0’ 07’’ 0.04
10 10 12 10.60 0.55 0.05 2’ 20’’ 2’ 51’’ 2’ 31’’ 0’ 08’’ 0.05
11 18 20 18.67 0.60 0.03 4’ 52’’ 7’ 11’’ 5’ 38’’ 0’ 39’’ 0.11
*Calculation of CV is omitted for this instance since the StD value is very close to average value. In such cases the
CV value is close to 100% thus being misleading.

The experimental results in Table 10 and Fig. 2 indicate that the average timetables constructed by
the hybrid CSO based algorithm are very near to the best ones. This demonstrates the algorithm’s
stability and efficiency. In addition to that, results presented in Table 10 and Fig. 3 show that its
execution time depends mainly on the presence of co-teaching cases. More precisely, input instances
involving co-teaching require a much longer execution time compared to input instances that do not
involve co-teaching. Among instances incorporating co-teaching, i.e. 1, 2, 4 and 7, it is obvious that the
average runtime of our approach is linearly correlated to the quantity of co-teachings more co-teachings
lead to bigger execution time. Moreover, among input instances without co-teaching it can be statistically
proven that the average execution time is linearly correlated to the quantity of teaching hours.

25
Box plots of execution times for each input instance
3000
2940
2880
2820
2760
2700
2640
2580
2520
2460
2400
2340
2280
2220
2160
2100
2040
1980
1920
1860
Execution time (secs)

1800
1740
1680
1620
1560
1500
1440
1380
1320
1260
1200
1140
1080
1020
960
900
840
780
720
660
600
540
480
420
360
300
240
180
120
60
0
1 2 3 4 5 7 8 9 10 11
Instances

Fig. 3. Box plots of execution times for each input instance (100 Monte Carlo runs)

As far as the CV of total cost values is concerned, its value ranges from 0.0% to 19% with most
values being below or near 10%. In addition to that, a similar situation occurs for execution time where
CV ranges from 0.3% to 11%. These observations lead to the conclusion that the behavior of the
algorithm, as far as the resulting fitness function values and execution times are concerned, is quite
consistent.

Another significant aspect of the hybrid CSO based algorithm is the application of the local search
refining procedure that reduces the number of each teacher’s empty periods. This procedure is identical to
the one proposed by Tassopoulos and Beligiannis in [41], where more information about its structure can
be found. To justify its importance and demonstrate the improvement of the CSO algorithm achieved by
the application of the aforementioned local search refining procedure, in Table 11 we present the

26
performance of the hybrid CSO algorithm both with and without implementation of the local search
refining procedure. The experimental results presented in Table 11 confirm that the hybrid CSO based
approach performs far better than the non-hybrid one since it achieves an improvement on the average
total cost ranging from 24.88% to 96.84%.

Table 11. Computational experiments justifying the use of the local search procedure
CSO without local
Hybrid CSO
Input instance procedure Improvement
Average StD Average StD
1 33.21 4.67 16.24 2.49 51.10%
2 47.84 4.43 22.83 2.65 52.28%
3 13.35 1.73 7.50 0.96 43.82%
4 31.85 4.10 9.67 1.87 69.64%
5 4.12 2.53 0,13 0.34 96.84%
7 48.03 4.12 34.70 5.98 27.75%
8 15.27 1.36 11.03 0.18 27.77%
9 8.72 2.14 2.00 0.00 77.06%
10 14.11 1.43 10.60 0.55 24.88%
11 27.64 3.13 18.67 0.60 32.45%

The results presented in Tables 8, 9, 10 and 11 can be easily reproduced and verified. All the
necessary files and documents (executable file, execution instructions, input files and output files) are
available online at [55].

5. Conclusions and future work

In this contribution we present the application of an improved and easy to use hybrid CSO based
algorithm in order to solve the high school timetabling problem. Experimental results of implementing
this algorithm are comparable to the best ever reported, so far, results for a well-established school
timetabling benchmark, and are achieved in less computational time. Indeed this hybrid CSO based
algorithm achieves the best ever reported results for 80% of the implemented instances – eight out of ten
instances. These results demonstrate that CSO based algorithms comprise a very powerful tool in an
effort to cope with discrete-space constraint optimization problems. However, their application to other
timetabling or scheduling problems is still an open issue.

As future work, we intend to design and apply experimental tools in order to fine tune the parameters
of the presented CSO based algorithm thus enhancing its performance. In addition, we intent to design
and implement a more sophisticated and efficient refining phase that will further improve the
performance of the algorithm. Also, under consideration is the design and application of hybrid CSO
based algorithms to other problems that fit in the timetabling and/or scheduling domain. More
specifically, we intend to test the performance and effectiveness of CSO based algorithms to the course
timetabling problem, the nurse rostering problem and the urban transit routing problem.

27
Acknowledgements

We would like to thank the anonymous reviewers for helping us improve our work and Mr Nick
Lambropoulos, B.Sc. EECS, for his corrections in the general presentation of the text.

References

[1] N. Pillay, A survey of school timetabling research, Ann. Oper. Res. 218 (2014) 261–293.
[2] I.X. Tassopoulos, G.N. Beligiannis, Using particle swarm optimization to solve effectively the school
timetabling problem, Soft Comput. 16 (2012) 1229–1252.
[3] I.X. Tassopoulos, G.N. Beligiannis, Solving effectively the school timetabling problem using particle
swarm optimization, Expert Syst. Appl. 39 (2012) 6029–6040.
[4] R.-M. Chen, H.-F. Shih, Solving University Course Timetabling Problems Using Constriction Particle
Swarm Optimization with Local Search, Algorithms 6 (2013) 227–244.
[5] P. Demeester, B. Bilgin, P. De Causmaecker, G. Vanden Berghe, A hyperheuristic approach to
examination timetabling problems: benchmarks and a new problem from practice, J. Sched., 15 (2012)
83–103.
[6] D. De Werra, The combinatorics of timetabling, Eur. J. Oper. Res. 96 (1997) 504–513.
[7] T.B. Cooper, J.H. Kingston, The complexity of timetable construction problems, Lect. Notes Comput.
Sc. 1153 (1996) 281–295.
[8] S. Even, A. Itai, A. Shamir, On the complexity of timetable and multicommodity flow problems,
SIAM J. Comput. 5 (1976) 691–703.
[9] N. Pillay, Hyper-heuristics for educational timetabling in: proceedings of the 9th international
conference on the practice and theory of automated timetabling (PATAT); 2012. p. 316–340.
[10] S. Kristiansen, T.R. Stidsen, A Comprehensive Study of Educational Timetabling-A Survey, DTU
Report Number 8, Department of Management Engineering, Technical University of Denmark, 2013.
[11] J. Johnes, Operational research in education, Eur. J. Oper. Res. 243 (2015) 683–696.
[12] N. Boland, B.D. Hughes, L.T.G. Merlot, P.J. Stuckey, New integer linear programming approaches
for course timetabling, Comput. Oper. Res. 35 (2008) 2209–2233.
[13] A.V. Moura, R.A. Scaraficci, A grasp strategy for a more constrained school timetabling problem,
Int. J. Oper. Res. 7 (2010) 152–170.
[14] H. Santos, E. Uchoa, L. Ochi, N. Maculan, Strong bounds with cut and column generation for class-
teacher timetabling, Ann. Oper. Res. 194 (2012) 399–412.
[15] M. Sørensen, T.R. Stidsen, High school timetabling: modelling and solving a large number of cases
in Denmark, in: proceedings of the 9th international conference on the practice and theory of automated
timetabling (PATAT); 2012 p. 359–364.
[16] P. Avella, B. D'Auria, S. Salerno, I. Vasilâev, A computational study of local search algorithms for
Italian high-school timetabling, J. of Heuristics. 13 (2007) 543–556.

28
[17] G. Post, S. Ahmadi, F. Geertsema, Cyclic transfers in school timetabling, OR Spectrum, 34 (2012)
133–154.
[18] R. Raghavjee, N. Pillay, A comparison of genetic algorithms and genetic programming in solving
the school timetabling problem, in: proceedings of the 4th world congress on nature and biologically
inspired computing (NaBIC); 2012. p. 98–103.
[19] M. Sørensen, S. Kristiansen, T.R. Stidsen, International timetabling competition 2011: An adaptive
large neighborhood search algorithm, in: proceedings of the 9th international conference on the practice
and theory of automated timetabling (PATAT); 2012 p. 489–492.
[20] G. Post, L.D. Gaspero, J.H. Kingston, B. McCollum, A. Schaerf, The third international timetabling
competition, in: proceedings of the 9th international conference on the practice and theory of automated
timetabling (PATAT); 2012 p. 479–484.
[21] J. Domrös, J. Homberger, An evolutionary algorithm for high school timetabling, in: proceedings of
the 9th international conference on the practice and theory of automated timetabling (PATAT); 2012 p.
485–488.
[22] H.G. Beyer, H.P. Schwefel, Evolution strategies: a comprehensive introduction, J. Nat. Comput. 1
(2002), 3–52.
[23] M. Kalender, A. Kheiri, E. Özcan, E.K. Burke, A greedy gradient-simulated annealing selection
hyper-heuristic, Soft Comput. 17 (2013) 2279–2292.
[24] A. Kheiri, E. Özcan, A.J. Parkes, A stochastic local search algorithm with adaptive acceptance for
high-school timetabling, Ann. Oper. Res. 239 (2014) 135–151.
[25] G.H.G. Da Fonseca, H.G. Santos, T.A.M. Toffolo, S.S. Brito, M.J.F. Souza, GOAL solver: A hybrid
local search based solver for high school timetabling, Ann. Oper. Res. 239 (2014) 77–97.
[26] L.N. Ahmed, E. Özcan, A. Kheiri, Solving high school timetabling problems worldwide using
selection hyper-heuristics, Expert Syst. Appl. 42 (2015) 5463–5471.
[27] M.S. Al-Yakoob, H.D. Sherali, Mathematical models and algorithms for a high school timetabling
problem, Comput. Oper. Res. 61 (2015) 56–68.
[28] Á.P. Dorneles, O.C.B. de Araújo, L.S. Buriol, A fix-and-optimize heuristic for the high school
timetabling problem, Comput. Oper. Res. 52 (2014) 29–38.
[29] S.-C. Chu, P.-W. Tsai, Computational intelligence based on the behavior of cats, Int. J. Innov.
Comput. Inform. Control 3 (2007) 163–173.
[30] S.-C. Chu, P.-W Tsai, J.-S. Pan, Cat Swarm Optimization, in: proccedings of the 9th pacific rim
international conference on artificial intelligence (PRICAI); 2006 p. 854–858.
[31] E. Bonabeau, M. Dorigo, G.Theraulaz, Swarm Intelligence: From Natural to Artificial Systems, first
wd., Oxford University Press, 1999.
[32] I. Fister, Jr., X.-S. Yang, I. Fister, J. Brest, D. Fister, A brief review of nature-inspired algorithms for
Optimization, ELEKTROTEHNIŠKI VESTNIK 80 (2013) 1–7.
[33] G. Panda, P.M. Pradhan, B. Majhi, IIR system identification using cat swarm optimization, Expert

29
Syst. Appl. 38 (2011) 12671–12683.
[34] Z.-H. Wang, C.-C. Chang, M.-C. Li, Optimizing least-significant-bit substitution using cat swarm
optimization strategy, Inform. Sciences 192 (2012) 98–108.
[35] P.M. Pradhan, G. Panda, Solving multiobjective problems using cat swarm optimization, Expert
Syst. Appl. 39 (2012) 2956–2964.
[36] P.-W. Tsai, J.-S. Pan, S.-M. Chen, B.-Y. Liao, Enhanced parallel cat swarm optimization based on
the Taguchi method, Expert Syst. Appl. 39 (2012) 6309–6319.
[37] D. Kumar, S.R. Samantaray, I. Kamwa, N.C. Sahoo, Reliability-constrained based optimal
placement and sizing of multiple distributed generators in power distribution network using cat swarm
optimization, Electr. Pow. Compo. Sys. 42 (2014) 149–164.
[38] I. Hadi1, M. Sabah, Improvement cat swarm optimization for efficient motion estimation, Int. J.
Hybr. Inform. Tech. 8 (2015) 279–294.
[39] R. Raghavjee, N. Pillay, A study of genetic algorithms to solve the school timetabling problem, Lect.
Notes Comput. Sc. 8266 (2013) 64–80.
[40] D. Zhang, Y. Liu, R. M’Hallah, C.H.S. Leung, A simulated annealing with a new neighborhood
structure based algorithm for high school timetabling problems, Eur. J. Oper. Res. 203 (2010) 550–558.
[41] I.X. Tassopoulos, G.N. Beligiannis, A hybrid particle swarm optimization based algorithm for high
school timetabling problems, Appl. Soft Comput. 12 (2012) 3472–3489.
[42] G. N. Beligiannis, C. N. Moschopoulos, S. D. Likothanassis, A genetic algorithm approach to school
Timetabling, J. Oper. Res. Soc. 60 (2009), 23–42.
[43] G.N. Beligiannis, C.N. Moschopoulos, G.P. Kaperonis, S.D. Likothanassis, Applying evolutionary
computation to the school timetabling problem: The Greek case, Comput. Oper. Res. 35 (2008) 1265–
1280.
[44] R. Raghavjee, N. Pillay, A genetic algorithm selection perturbative hyper-heuristic for solving the
school timetabling problem, ORiON 31 (2015) 39–60.
[45] I.V. Katsaragakis, I.X. Tassopoulos, G.N. Beligiannis, A comparative study of modern heuristics on
the school timetabling problem, Algorithms 8 (2015) 723–742.
[46] Á.P. Dorneles, O.C.B de Araújo, L.S. Buriol, The impact of compactness requirements on the
resolution of high school timetabling problem, XLIV Simpósio Brasileiro de Pesquisa Operacional
(SBPO); 2012, p. 3336–3347.
[47] A. Bouzidi, M.E. Riffi, Discrete at swarm optimization to resolve the traveling salesman problem,
Int. J. Adv. Res. Comp. Sci. Softw. Eng. 3 (2013) 13–18.
[48] J.P. Yusiong, Optimizing artificial neural networks using cat swarm optimization algorithm, Int. J.
Intell. Syst. Appl. 5 (2013) 69–80.
[49] L. Pappula, D. Ghosh, Linear antenna array synthesis using cat swarm optimization, Int. J. Electron.
Comm. 68 (2014) 540–549.
[50] M. Orouskhani, Y. Orouskhani, M. Mansouri, M. Teshnehlab, A novel cat swarm optimization

30
algorithm for unconstrained optimization problems, Int. J. Inf. Technol. Comp. Sci. 5 (2013) 32–41.
[51] P.-W. Tsai, J.-S. Pan, S.-M. Chen, B.-Y. Liao, S.-P. Hao, Parallel cat swarm optimization, in:
proceedings of the 7th international conference on machine learning and cybernetics (ICMLC); 2008 p.
3328–3333.
[52] Y. Sharafi, M.A. Khanesar, M. Teshnehlab, Discrete binary cat swarm optimization algorithm, in:
proceedings of the 3rd international conference on computer, control & communication (CCCT); 2013 p.
1–6.
[53] M. Orouskhani, M. Mansouri, M. Teshnehlab, Average-inertia weighted cat swarm optimization,
Lect. Notes Comput. Sc. 6728 (2011) 321–328.
[54] S.-C.Chu, Y.-T. Chen, J.-H. Ho, Timetable scheduling using particle swarm optimization, in:
proceedings of the 1st international conference on innovative computing, information and control
(IJICIC); 2006, p. 324–327.
[55] http://www.deapt.upatras.gr/cso_timetabling/school-timetabling.html (accessed 15.09.16).

31
List of Figures

Fig. 1. General overview of the hybrid CSO based algorithm

Fig. 2. Box plots of total cost values for each input instance (after 100 Monte Carlo runs)

Fig. 3. Box plots of execution times for each input instance (after 100 Monte Carlo runs)

32
List of Tables

Table 1: Parameters incorporated in the original CSO algorithm

Table 2. Cat’s representation (example)

Table 3: Weights used by the evaluation function for the calculation of sub-costs

Table 4. Pseudocode of the modified Seeking Mode procedure

Table 5. Pseudocode of the modified Tracing Mode procedure

Table 6a. Example of global_best cat

Table 6b. Example of cat_copy

Table 6c. Example of copy_cat after the application of Change_random()

Table 7. Major characteristics of the input instances used

Table 8. Total costs of the hybrid CSO approach and the algorithms presented in [40-45] (best ever found
timetables are in bold)

Table 9. Average execution time comparison between the hybrid CSO approach and the Hybrid PSO
algorithm presented in [45]

Table 10. Computational experiments demonstrating the stability of the hybrid CSO based algorithm
(best ever found timetables are in bold)

Table 11. Computational experiments justifying the use of the local search procedure

33
Table 1. Parameters incorporated in the original CSO algorithm
TYPICAL
PARAMETER DESCRIPTION
VALUE
Number of cats 5 to 100 Its value depends on the nature and complexity of the
problem to be solved. Obviously, a bigger value leads to
better coverage of the search space, requiring however longer
execution time.
Number of iterations 500 to 2000 Its value depends on the nature and complexity of the
problem to be solved. Obviously, a bigger value leads to
better exploration of the search space, requiring however
longer execution time.
Seeking Memory Pool 2 to 10 The number of positions examined by each cat. The bigger
(SMP) the value the more positions each cat will examine.
Self-Position True A Boolean parameter that dictates whether the cat’s current
Consideration (SPC) position will be included in the pool of candidate positions to
move to. If its value is true, the cat may remain in its current
position. If its value is false, the next position of the cat will
be certainly a different one.
Number of dimensions 30 Its value depends solely on the nature of the problem at hand.
of the search space (Μ) (see [29])
Count of Dimensions to 80% Expresses the percentage of dimensions that alter their values
Change (CDC) at each iteration of the algorithm. The bigger its value the
more dimensions have their values altered. Obviously, a
bigger value leads to better exploration of the search space,
requiring however longer execution time.
Selected Range 20% Expresses the maximum percentage each dimension can vary,
Dimensions (SRD) thus defining the maximum number of changes occurring to
the dimension. A big value in this parameter leads to bigger
variations of each dimension’s value.
Mixing Ratio (MR) 2% Defines the percentage of cats being in Tracing Mode.

34
Table 2. Cat’s representation (example)

Time period 1 Time period 2 … Time period 35


Class 1 12 2 … 15
Class 2 7 10 … -1
… … … … …
… … … … …
Class Ν 4 9 … -1

35
Table 3. Weights used by the evaluation function for the calculation of sub-costs
WEIGHT VALUE PURPOSE
Hard Constraints’ Weight (HCW) 10 Penalize infeasible timetables
Ideal Classes’ Dispersion Weight (ICDW) 0.95 Penalize the violation of the distribution of
teaching hours of each lesson constraint
Ideal Teachers’ Dispersion Weight (ITDW) 0.6 Penalize the violation of the distribution of
teaching hours of each teacher constraint
Teachers’ Empty Periods Weight (TEPW) 0.06 Penalize the violation of the number of
gaps of each teacher constraint

36
Table 4. Pseudocode of the modified Seeking Mode procedure
1. For (each cat c in seeking mode)
2. best_fitness = fitness of current cat c
3. If (SPC is true)
4. j = SMP−1
5. keep the current cat c as a candidate position to be moved to
6. Else
7. j = SMP
8. make j copies (cat_copy) of the current position of cat c
9. tc = CDC Number_of_time_slots, Note: total number of timeslots to be replaced

10. sm = SRD Number_of_classes Number_of_time_slots, Note: total number of swaps to be made

11. For (each cat_copy)


12. execute procedure Change_random(), Note: insert tc random timeslots from global_best cat to
cat_copy
13. For (sm times)
14. execute procedure Single_swap(), Note: make a random cell swap in cat_copy
15. If (swap is valid)
16. calculate the new fitness value of mutated cat_copy
17. If (new fitness value < = best_fitness)
18. best_fitness = new fitness value
19. set this mutated cat_copy as candidate position
20. calculate the fitness values of all candidate positions
21. If (the fitness values of all candidate positions are not equal) , Note: a cat having better fitness than initial
best_fitness has been found
22. calculate the selection probability of each candidate position, Note: based on its difference from global
best cat
23. Else
24. set selecting probability of each candidate equal to 1
25. pick randomly from the candidate positions the one to move to
26. update the position of current cat c

37
Table 5. Pseudocode of the modified Tracing Mode procedure
1. For (each cat in tracing mode)
2. calculate similarity of current cat with global best cat
3. distance = (Number_of_classes Number_of_time_slots) – similarity, Note: calculate distance
rand_number = rand(0,1), Note: calculate a random number belonging to [0 1]
4. cs = rand_number c1 distance, Note: calculate number of cells to be swapped
5. execute procedure Single_swap(), Note: perform cs cell swaps between pairs of cells selected at
random
6.

38
Table 6a. Example of global_best cat
Time Time Time Time Time

period 1 period 2 period 3 period 4 period 35
Class 1 4 …
Class 2 3 …
Class 3 8 …
Class 4 7 …
… … … … … …
Class n 5 …
Table 6b. Example of cat_copy
Time Time Time Time Time

period 1 period 2 period 3 period 4 period 35
Class 1 6 2 4 … 4
Class 2 2 3 …
Class 3 7 7 … 8
Class 4 1 7 7 …
… … … … … …
Class n 3 5 3 …
Table 6c. Example of copy_cat after the application of Change_random()
Time Time Time Time Time

period 1 period 2 period 3 period 4 period 35
Class 1 4 2 6 … 4
Class 2 3 2 …
Class 3 8 7 … 7
Class 4 7 7 1 …
… … … … … …
Class n 5 3 3 …

39
Table 7. Major characteristics of the input instances used
Number of Number of Number of Number of Teachers involved Number of
Instance
Classes Teachers Teaching Hours in Co-teaching Co-teachings
1 11 34 385 9 36
2 11 35 385 17 67
3 6 19 210 0 0
4 7 19 245 6 31
5 6 18 184 0 0
7 13 35 455 17 70
8 5 11 150 0 0
9 6 15 202 0 0
10 7 17 210 0 0
11 9 21 306 0 0

40
Table 8. Total costs of the hybrid CSO approach and the algorithms presented in [40-45] (best ever found
timetables are in bold)
Hybrid Hybrid AFS Hybrid
Instance GA [42] EA [43] SA [40] GASPHH [44]
CSO PSO [45] [45] PSO [41]
1 11 11 16 75 70 29 15 60
2 18 18 21 86 76 37 17 66
3 5 5 7 20 20 8 7 17
4 5 5 9 41 41 28 8 43
5 0 0 0 10 10 3 0 15
7 24 23 32 109 109 40 32 83
8 11 11 11 23 21 22 11 Not mentioned
9 2 2 2 35 35 28 2 Not mentioned
10 10 10 10 28 26 23 10 Not mentioned
11 18 19 19 43 42 32 18 Not mentioned

41
Table 9. Average execution time comparison between the hybrid CSO approach and the Hybrid PSO
algorithm presented in [45]
Average execution time Improvement
Instance
Hybrid CSO Hybrid PSO [45] (less execution time)
1 28 mins 21secs 36 mins 36 secs 22.54%
2 35 mins 9 secs 47 mins 48 secs 26.46%
3 3 mins 42 secs 3 mins 54 secs 5.13%
4 8 mins 43 secs 13 mins 16 secs 34.30%
5 2 mins 13 secs 3 mins 26.11%
7 45 mins 44 secs 57 mins 54 secs 21.01%
8 1 min 17 secs 1 mins 48 secs 28.70%
9 3 mins 6 secs 4 mins 24 secs 29.55%
10 2 mins 31 secs 3 mins 42 secs 31.98%
11 5 mins 38 secs 7 mins 24 secs 23.87%

42
Table 10. Computational experiments demonstrating the stability of the hybrid CSO based algorithm
(best ever found timetables are in bold)
Input Fitness function value (Total cost) Execution time (mins)
instance Best Worst Average StD CV Best Worst Average StD CV
1 11 23 16.24 2.49 0.15 25’ 16’’ 30’ 11’’ 28’ 21’’ 1’ 11’’ 0.04
2 18 30 22.83 2.65 0.12 32’ 30’’ 37’ 3’’ 35’ 09’’ 1’ 06’’ 0.03
3 5 10 7.50 0.96 0.13 2’ 51’’ 4’ 27’’ 3’ 42’’ 0’ 25’’ 0.11
4 5 14 9.67 1.87 0.19 7’ 35’’ 9’ 43’’ 8’ 43’’ 0’ 35’’ 0.06
5 0 1 0.13 0.34 -* 1’ 57’’ 2’ 50’’ 2’ 13’’ 0’ 13’’ 0.10
7 24 47 34.70 5.98 0.17 42’ 13’’ 49’ 20’’ 45’ 44’’ 2’ 18’’ 0.05
8 11 12 11.03 0.18 0.02 1’ 09’’ 1’ 25’’ 1’ 17’’ 0’ 04’’ 0.05
9 2 2 2.00 0.00 0.00 2’ 51’’ 3’ 24’’ 3’ 06’’ 0’ 07’’ 0.04
10 10 12 10.60 0.55 0.05 2’ 20’’ 2’ 51’’ 2’ 31’’ 0’ 08’’ 0.05
11 18 20 18.67 0.60 0.03 4’ 52’’ 7’ 11’’ 5’ 38’’ 0’ 39’’ 0.11
*Calculation of CV is omitted for this instance since the StD value is very close to average value. In such cases the
CV value is close to 100% thus being misleading.

43
Table 11. Computational experiments justifying the use of the local search procedure
CSO without local
Hybrid CSO
Input instance procedure Improvement
Average StD Average StD
1 33.21 4.67 16.24 2.49 51.10%
2 47.84 4.43 22.83 2.65 52.28%
3 13.35 1.73 7.50 0.96 43.82%
4 31.85 4.10 9.67 1.87 69.64%
5 4.12 2.53 0,13 0.34 96.84%
7 48.03 4.12 34.70 5.98 27.75%
8 15.27 1.36 11.03 0.18 27.77%
9 8.72 2.14 2.00 0.00 77.06%
10 14.11 1.43 10.60 0.55 24.88%
11 27.64 3.13 18.67 0.60 32.45%

44
Box plots of total cost values for each input instance
50
48
46
44
42
40
38
36
34
32
30
Total cost

28
26
24
22
20
18
16
14
12
10
8
6
4
2
0
1 2 3 4 5 7 8 9 10 11
Instances

Fig. 2a. Box plots of total cost values for each input instance (100 Monte Carlo runs)

You might also like