A Heuristic Room Matching Algorithm in Generating Enhanced Initial Seed for the University Course Timetabling Problem

: The University Course Timetabling Problem (UCTP) such as the curriculum-based course timetabling problem is both an NP-hard and NP-complete scheduling problem. The nature of the problem concerns with the assignment of lecturers-courses to available teaching space in an academic institution. The Curriculum-Based University Course Timetabling Problem (CB-UCTP) has a high conflict-density and searching for an improved solution is not trivial. In this study, the authors propose a heuristic room matching algorithm which improves the seed of the CB-UCTP. The objective is to provide a reasonable search point to carry out any improvement phase and the results obtained indicate that the matching algorithm is able to provide very promising results as the fitness score of the solution is significantly enhanced in a very short period of time


INTRODUCTION
The University Course Timetabling Problem (UCTP) is an NP-hard and NP-complete problem where there is no known polynomial time algorithm which guarantees in identifying the best solution (Bardadym, 1996;Ismayilova et al., 2007).Inherently, the objective of the UCTP is to assign a set of resources which often comprises entities such as lecturers, courses and rooms to available timeslots whilst respecting the stipulated constraints of the institution.Generally, there are two types of constraints to adhere by which are hard constraints and soft constraints.The former constraints are vital and mandatory constraints in which they cannot be violated under any circumstances at all, lest the timetable is rendered infeasible.On the other hand, the latter constraints, usually specified preferences such as the unavailability of lecturers are secondary constraints which can be violated, but preferably not since the satisfaction of these constraints enhance the quality of the timetable.Since the problem is typically large-sized in nature and due to its large amount of variables and numerous constraints, it is also sometimes referred to as a constraint satisfaction problem (Teoh et al., 2015).
The UCTP comprises several forms such as the Curriculum-Based University Course Timetabling Problem (CB-UCTP) and post-enrolment problem.In the literature, the UCTP has been reported to be solved successfully through various metaheuristic algorithms.Metaheuristic algorithms are stochastic methods which are employed when either the search space becomes too vast or when there are no known algorithms which are capable of finding the optimal solutions (Rossi-Doria et al., 2002).However, the parameters of the algorithms often require careful tuning prior to before they could be applied to solve the problem (Brownlee, 2011).Therefore one of the main concerns is how to produce an enhanced initial seed before employing the metaheuristic algorithms to further enhance the result.For example, a graph coloring heuristics has been employed to produce an enhanced initial seed in examination timetabling problem by (Burke et al., 1995) and a two-point hybrid evolutionary algorithm is employed by (Rizam and Bakar, 2008) to produce an enhanced initial seeding in a similar examination timetabling problem.Additionally, the UCTP is also successfully solved by various metaheuristic algorithms such as Genetic Algorithm (Agustín-Blas et al., 2009;Jain et al., 2010;Kohshori and Abadeh, 2012;Suyanto, 2010), Ant Colony Optimization (Lutuksin and Pongcharoen, 2010;Thepphakorn et al., 2009), Particle Swarm Optimization (Qarouni-Fard et al., 2007;Shiau, 2011;Tassopoulos and Beligiannis, 2012), Artificial Bee Colony algorithm (Weng et al., 2013), Simulated Annealing (Aycan and Ayav, 2009;Frausto-Solís et al., 2008;Zhang et al., 2010) and Tabu Search (Alvarez-Valdes et al., 2002;Lü and Hao, 2010) to name a few.However, most metaheuristic algorithms require a considerable initial seed in order to search for the optimal solution.
The works described in this study is inspired from the idea of employing graph coloring heuristics in the assignment of room to courses considering that once courses are scheduled to periods, the room assignment can be performed by simply solving a bipartite matching problem (Lü and Hao, 2010).In this study, the authors propose a heuristic room matching algorithm which seeks to improve the initial seed of the solutions.

MODEL DEFINITION
The CB-UCTP model is commonly adopted in many local universities as well as other international universities.The problem essentially deals with the scheduling of a set of lectures to various rooms and timeslots, where conflicts between courses are set according to the curriculums published by the University and not on the basis of enrolment data.The entities and their descriptions are adopted from the ITC-2007 technical report (Gaspero et al., 2007) and are given as follows.
Days, timeslots and periods: A number of teaching days are given in the week (typically 5 or 6).Each day is split into a fixed number of timeslots, which is equal for all days.A period is a pair composed of a day and a timeslot.The total number of scheduling periods is the product of the days times the day timeslots.

Courses and lecturers:
Each course consists of a fixed number of lectures to be scheduled in distinct periods; it is attended by given number of students and is taught by a lecturer.For each course there is a minimum number of days that the lectures of the course should be spread in, moreover there are some periods in which the course cannot be scheduled.

Rooms:
Each room has a capacity, expressed in terms of number of available seats.All rooms are equally suitable for all courses (if large enough).
Curriculums: A curriculum is a group of courses such that any pair of courses in the group has students in common.Based on curriculums, we have the conflicts between courses and other soft constraints.
Based on the aforementioned entities, the solution to the problem is the complete assignment of a period (day and timeslot) and a room to every lecture for each course with respect to the stipulated constraints.The curriculum-based timetabling problem is composed of a set of n courses C = {c 1 , ..., c n } to be assigned to a set of m rooms R = {r 1 ,...,r m } and a set of p periods T = {t 1 , ..., t p }. Every course c i consists of l i lectures to be scheduled.A period consists of a day and a timeslot.A total of p periods are spread out over h daily timeslots and d days, i.e., p = h x d.In addition, there is a set of w curricula CR = {Cr 1 , ..., Cr w } in each curriculum Cr k is a group of courses that share common students.The nomenclature described in Table 1 is adopted from (Lü and Hao, 2010) whilst the properties of the dataset described in Table 2 is adopted from (Abdullah and Turabieh, 2012).

Constraints:
The stipulation of constraints defines the search space of the solution and in this work; the matching algorithm only considers solutions which are already in its feasible form i.e., satisfied all of the hard constraints and only evaluates the penalty of the soft constraints.The hard and soft constraints of the problem are listed as follows.
H 1 (lectures): "All lectures of a course must be scheduled and assigned to distinct periods.A violation occurs if a lecture is not scheduled or two lectures within a course are scheduled in the same period." H 2 (conflicts): "All lectures of courses in the same curriculum or taught by the same lecturer must be scheduled in different periods.Two conflicting lectures in the same period represent one violation.Three conflicting lectures count as 3 violations: one for each pair."H 3 (room occupation): "Two lectures cannot be assigned to the same room at the same period.Two lectures in the same room at the same period represent one violation.Any extra lecture in the same period and room counts as one more violation."H 4 (availability): "If the teacher of the course is not available to teach that course at a given period, then no lecture of the course can be scheduled at that period.Each lecture scheduled in a period unavailable to that course is one violation.''S 1 (room capacity): "The number of students that attend the course for each lecture must be less than or equal to the number of seats of the rooms hosting its lectures.Each student above the capacity counts as 1 violation."S 2 (minimum working days): "The lectures of each course must be spread over the given minimum number of days.Each day below the minimum, counts as 1 violation."S 3 (isolated lectures): "Lectures belonging to a curriculum should be adjacent to each other (i.e., in consecutive periods).For a given curriculum we The course scheduled at room rj and period ti nri (X) Number of rooms occupied by course ci for a candidate solution X: Number of working days that course ci takes place at in candidate solution X: where: appk,i (X) Whether Crk appears at ti in X: Each isolated lecture in a curriculum counts as 1 violation."S 4 (room stability): "All lectures of a course should be delivered in the same room.Each distinct room used for the lectures counts as 1 violation." A list which details the various properties of the datasets is described in Table 2.The objective function of the problem therein is to minimize the violation of the hard constraints such that it produces a feasible timetable as given in Eq. ( 1).The mathematical notation for the constraints of the problem is adopted from Abdullah and Turabieh (2012) as follow: where, F (X) = Fitness value of candidate solution: where, is a truth indicator function which takes value of 1 if the given proposition is true and 0 otherwise.Based on the mathematical model as stated above, the goal therein is to minimize the violation of the hard constraints such that it produces a feasible timetable.Upon feasibility, the algorithm then searches for a feasible solution, X* such that F (X*) ≤F (X) for all X in the feasible search space region.

SOLUTION METHODOLOGY
Metaheuristic algorithms are employed when the size of the search space becomes too vast for exact methods and that no effective heuristic of identifying optimal solution is available (Rossi-Doria et al., 2002).Due to their stochastic nature, a good initial seed is capable to aid the algorithm to converge to the global optimum within a shorter amount of time.Therefore one of the main concerns in the timetabling research community is how to produce a high quality initial solution.For instance (Burke et al., 1995) proposed a graph coloring heuristics to produce an initial seeding of higher quality as compared to randomly generated solutions while (Rizam and Bakar, 2008) has employed a Two-point Hybrid Evolutionary Algorithm (Tp_HEA) to capture the enhanced initial seed to be used in the sequential evaluation phase.Hence, this study proposes a heuristic room matching algorithm which is used to produce an enhanced initial seed for the curriculum-based course timetabling problem.Note that the initial feasible solutions used in this study are constructed using the constructive algorithm proposed by (Lü and Hao, 2010) and omits the explanation of the procedure as it is out of the scope of this study.Interested readers can find out more about constructive heuristics in generating a feasible timetable in the literature (Chiarandini et al., 2006;Lü and Hao, 2010).

Heuristic room matching algorithm:
In this study, the proposed heuristic room matching algorithm attempts to heuristically reassign the rooms of the solutions with the most ideal rooms in order to improve the initial seed of the candidate solution.Since is quite frequent in practice, for simplicity purpose, for rooms to be assigned at the end after the assignment of lectures to periods, the proposed algorithm is invoked after a feasible solution is found.In following Outlines the room matching algorithm pseudocode.
Phase 1: Construction of a feasible solution, X (omitted in this study): Output the feasible solution, X feasible to be utilized by the matching algorithm.
Phase 2: Heuristic room matching algorithm: Construction of pre-processing files: Construct a Total_Timeslot matrix, TTS for each room.
Construct a Course_Room matrix, crseroom which matches the usable rooms to each courses.

Invoke matching algorithm:
do while (j< = no. of lectures) select a usable room, r usable which corresponds to period j from crseroom and assign to course, c j update the removal of r usable from TTS end Upon obtaining a feasible solution, the heuristic room matching algorithm is invoked to reassign the ideal rooms to all courses.The algorithm initializes with the construction of a Total_Timeslot matrix, TTS which lists every available timeslots for all rooms.Subsequently, a Course_Room matrix, crseroom is constructed based on a distance metric index, d index similar to that to the works of (Caldeira and Rosa, 1997) which measures the suitability of each room by subtracting the room capacity, cap j from the student enrolment, std j of a particular course.The assignment is only possible for all negative values of d index and the suitability increases for d index 0.In the computation of the d index illustrated in Fig. 1, room B with a seating capacity of 200 can be assigned to course c0001 with the enrolment of 130 students with its d index value -70.We only accept negative d index as this denotes that the room capacity is bigger than the student enrolment.At the end of each iteration, the TTS updates with the removal of the assigned room to prevent any form of conflict.
The proposed algorithm is then tested on Track 3 of the Second International Timetabling Competition which consists of twenty-one problem instances which comprises the early, middle and late dataset of the curriculum-based course timetabling problem model.

RESULTS AND DISCUSSION
This section provides the results of the experiment.Table 3 and Fig   Based on the results, for all of the tested instances, the proposed algorithm is able to enhance the quality of the initial seed significantly.In all of the tested problem instances, the matching algorithm exhibits an improvement in the fitness score, f soft_improve ranging from 99.04% to being able to successfully assign the rooms to each lecture regardless of the search environment in less than one second, which is reflected in column t (sec) in Table 3.By reassigning a suitable room to each lecture, the matching algorithm has provided a considerable advantageous search point for the optimization of soft constraints as the optimization algorithm no longer needs to be concerned in the assignment of a suitable room and is able to focus in other regions of improvement.

CONCLUSION
The overall goal of the work presented in this study is to provide and generate an enhanced initial seed for the curriculum-based course timetabling problem which corresponds to Track 3 of the Second International Timetabling Competition.In order to acquire the enhanced initial seed for the problem, the authors have presented a heuristic room matching algorithm which is derived from the idea of graph coloring heuristics to solve a bipartite room matching problem.The proposed algorithm initializes with the construction of preprocessing files and then heuristically reassigns the most ideal rooms to each course until all courses have been reassigned with a suitable room.This approach is simple yet efficacious as it is able to render significant improvement to the candidate solutions in a significantly short amount of time and allows any future optimization to negate the aspect of room capacity.For future works, the authors intend to incorporate heuristics which take into account the other soft constraints collectively to provide a greater quality initial solution.

Fig. 1 :
Fig. 1: Computation of the distance metric index, d index . 2 depict the soft constraints improvement score of the initial feasible solution for

Table 1 :
Nomenclature in the curriculum-based university course timetabling problem

Table 2 :
Properties of the various problem instances featured in track 3 of the ITC-2007 account for a violation every time there is one lecture not adjacent to any other lecture within the same day.