Integrating a Repairing-Based Genetic Algorithm-Neighborhood Search Structure in Solving the Course Timetabling Problem

: The course timetabling problem is not a trivial task as it is an NP-hard and NP-complete problem and many solutions have been proposed due to its high complexity search landscape. In essence, the nature of the course timetabling problem is to assign a lecturer-course entity to existing teaching venue and timeslot in an academic institution. In this article


Problem Background
The notion of manually generating a workable timetable within the context of a higher-learning institution is indefinitely a daunting task and the complexity increases when there are various unique hard constraints that must be satisfied in a feasible solution. The course timetabling problem or commonly known as CTP has garnered favorable response especially in the domain of Operations Research (OR) and Artificial Intelligence (AI) communities. During the last decade, the CTP received great attention partly due to the organization of three competitions, entitled International Timetabling Competitions (ITC) namely the ITC-2002 (Paechter et al., 2002), ITC-2007(Mccollum et al., 2010 and ITC-2011(Post et al., 2016. The approaches that are commonly undertaken to solve the problems are metaheuristic algorithms which can be classified to population based algorithms such as Genetic Algorithm (Abdelhalim and El Khayat, 2016), Particle Swarm Optimization (Kennedy and Eberhart, 1995), Ant Colony Optimization (Socha et al., 2003) and local search algorithms such as Simulated Annealing (Bellio et al., 2016), Tabu Search (Lü and Hao, 2010), Great Deluge (Dueck, 1993) and Variable Neighborhood Search (Hansen and Mladenović, 1997) to name a few. The aforementioned algorithms possess their own sets of strength and weaknesses and in order to obtain a high quality solution, hybrid algorithms are proposed in order for the resultant algorithm to exhibit various strength derived from the initial algorithms such as hybrid cat swarm algorithms (Skoullis et al., 2016), hybrid particle swarm optimization (Shiau, 2011), hybrid ant colony systems (Ayob and Jaradat, 2009). This paper presents a hybrid Genetic Algorithm Neighborhood Search which integrates domain-specific exploitative properties of the Neighborhood Search into Genetic Algorithm to solve the CTP adopted from a real world example from a faculty in Universiti Teknologi Malaysia. A formal description of the dataset is presented in section 2.1 and 2.2 respectively and section 3.0 depicts the architecture of the proposed hybrid genetic algorithm neighborhood search. Section 4.0 presents the results obtained from the experiment and section 5.0 summarizes the contribution of the paper.

Model Formulation
The model and dataset addressed in this article is adopted from a faculty department in a local university in Malaysia. This section elucidates the background and properties of the dataset, the various entities involved in the problem formulation, the constraints which govern the problem and a formal mathematical formulation of the problem model.

Properties of the Dataset
Within the context of Malaysia public university's academic system (at the point in which this article is written), the intake of fresh undergraduates takes place once a year i.e., at any time, students are always in their odd (1st, 3rd, 5th) semesters or (2nd, 4th, 6th) semesters. In this article, we attempt to schedule the courses for students who are in their first, second and third year (1st semester, 3rd semester and 5th semester respectively) for five departments in a faculty in a local university in Malaysia. To present the data in a more concise manner, the dataset is categorized into three problem instances. The first instance consists of courses and the number of lectures for year 1 students, the second instance consists of year 1 and year 2 students and the third dataset consists of year 1, year 2 and year 3 students. Refer to Fig. 1.

Subject (s)
The total number of subjects offered to all 1st-3rd year faculty students. It should be noted that the subject contains the information of the instructor-incharge as well.

Work_Day (w)
In general, the administration of the university operates for five (5) working days, from Monday to Friday.

Session (sn)
Session refers to the duration for a lecture which is fifty (50) min. In general, the university allocates nine (9) usable sessions for use every day. However, only eight (8) sessions are allocated on Friday due to Muslim prayers. In summary, there is a total of forty-four usable sessions that can be used on a weekly basis.

Venue (v)
According to the dataset obtained, there is a total of seventeen (17) venues which can be used either for lecture or lab (programming) activities.
Based on the aforementioned entities, a complete feasible assignment can be described as E = {s, w, sn, v} where E refers to the complete assignment of events which consists of a set of subject, day, session and venue.  All subjects must be scheduled to distinct sessions. A violation occurs if a subject is not scheduled or two subjects are scheduled simultaneously. C H2 Subjects cannot be scheduled to a same venue simultaneously. A violation occurs if two subjects are scheduled simultaneously and additional violation constitutes additional violation score.

C H3
Each session is exactly one period long. A violation occurs if a subject is scheduled over a session.

C H4
An hour lunch break must be scheduled during 1.00-1.50 pm from Monday until Thursday and no event should be scheduled during this period. A violation occurs if a subject is scheduled during this period.

C H5
A 2-hour break must be scheduled for lunch and religious purpose during 1.00-1.50 pm on Friday and no event should be scheduled during this period. A violation occurs if a subject is scheduled during this period. C S1 Subjects should not be scheduled at the last period of the day and should not take place in the evening. A violation occurs if a subject is scheduled during this period.

C S2
Timetable for venue should be as compact as possible. A violation occurs if there is a gap in the venue schedule. C S3 Venues should be fully occupied whenever possible and its requirement should be taken into account Table 1 describes the constraints of the course timetabling problem and comprises five (5) hard constraints which must be satisfied (to produce a feasible timetable) and three (3) additional soft constraints which increases the quality of the timetable without violating the fulfilled hard constraints previously.

Model Formulation
In order to evaluate the performance of the timetable solution, the violation of each constraints is calculated based on the mathematical formulation given in Equation 1. Since producing a feasible timetable solution is of the utmost importance, a numerical weight denoted by α of value ten (10) is added to increase its significance. A feasible timetable solution will not record any C H1 -C H5 violation score (0). On the other hand, increasing the quality of the timetable is handled by the satisfaction of C S1 -C S2 soft constraints multiplied with a numerical weight denoted by β with value of one (1): • ∅ denotes that the constraints are represented by the encoding of the candidate solution Where: α = 10 β = 1 C Hx = The x th hard constraint C Sy = The y th soft constraint The chromosome of the solution is designed such that constraint C H3 and C S3 are satisfied at all times, thus recording the value of ∅ in the formulation.

Hybrid Genetic Algorithm Neighborhood Search
Genetic Algorithm (GA) is a popular multidirectional population-based metaheuristic algorithm that simulates the principles of natural selection. The algorithm has received widespread popularity through the works of Holland (1975) and is also reported to be very successful at solving real-life complex engineering problems. In the domain of timetabling, a hybrid variant of GA has been applied successfully by Kohshori and Abadeh (2012) in generating a timetable. In this article, the experiment setup encodes the chromosome such that it satisfies constraint C H3 and C S3 naturally in order to reduce the load on the algorithm. The proposed GANS adopts a repair operator featured in the works of Pongcharoen et al. (2008) and the parameters of the proposed GANS are tabulated according to Table 2     This move selects a course scheduled at the last timeslot of the day and attempts to move it to an earlier timeslot.

NS 2 -Room Compactness Move
This move selects a course which has empty gaps in between and attempts to move it to an adjacent timeslot of an existing course NS 3 -Room Move This move selects a room and attempts to reassign a new room to the course.
The concept of Variable Neighborhood Search which is also referred to as Neighborhood Search (NS) was first introduced by Hansen and Mladenović (1997) where the algorithm explores the vicinity (neighborhood) of a promising solution in hope of finding a better solution. Contrasting to populationbased metaheuristic algorithm where a multiple solutions are manipulated at a time, the NS algorithm only exploits one solution at a time. The ability to explore promising region is determined by the definition of neighborhood structures and in general, well-defined neighborhood structures tend to lead to the discovery of high-quality solutions. It has been reported that the algorithm performs significantly well at solving constraint satisfaction problems (Hoos and Stützle, 2005). The key ingredient here is to ensure welldefined neighborhood structure (Gaspero and Schaerf, 2006) as poorly defined neighborhood structure will hinder the progress of the algorithm (Papadimitriou and Steiglitz, 1982). In the domain of CTP, a successful implementation of a well-defined neighborhood structure is described in the works of Muller (2009), who incidentally is also the Track 3 winner in the ITC-2007 timetabling competition. In his works, he introduced six domain-specific neighborhood structures that possess high inter-connectivity to exploit the incumbent solution. Figure 3 describes the pseudocode of the proposed GANS.
In the proposed GANS, upon feasibility of the candidate solution, the algorithm begins to exploit the incumbent best solution, S_best for a feasible solution x* by means of neighborhood search such that f(x*) ≤f(x) for all x in the feasible search space region. 3 domain-specific neighborhood structures, NS structure are defined in aiding the algorithm to obtain a better solution, x* which are defined as in Table 3. The proposed GANS is coded entirely using MATLAB ® as the developing tool.

Results and Discussion
This section describes the results obtained from the proposed GANS. The performance measurements which are taken into account consists of the hard and soft fitness score, g hard and g soft , iteration time (t) recorded in seconds, the number of iteration, iteration, the mean, x and standard deviation, σ for each problem instance. The algorithm terminates when the global optimum is returned or when the algorithm has elapsed 300 seconds (whichever comes first). Table 4 tabulates the results for all three problem instances.
The experiment is repeated for five times and in all three problem instances, a global optimum (fitness score of zero) is returned within a reasonably short amount of time that is 11.34 sec or 71.60 sec on the average for problem instance 1; 24.77 sec or 246.10 sec on the average for problem instance 2; 108.76 sec or 267.09 sec on the average for problem instance 3. Additionally, the GANS exhibits consistent performance as the mean values for g soft recorded for each instance are relatively low. It is worth to note, that the neighborhood search mechanism is only invoked for the soft constraint evaluation only when the solution is feasible (g hard equals zero). This clearly demonstrates the efficacy of the proposed GANS. The progression of the g soft fitness scores for each instance are also illustrated in Fig. 4-6 respectively.

Conclusion
This article presents a hybridized Genetic Algorithm-Neighborhood Search (GANS) and integrates a repair operator to solve a real-world university course timetabling problem. The algorithm first obtains a feasible solution with the assistance of a repair operator and attempts to improve on the best solution using three various neighborhood structures. From the experiment, the proposed algorithm demonstrated promising results in terms of computational time and fitness score and additionally is able to obtain the global optimum for all the tested instances. To propose some future works, the authors intend to extend the algorithm to solve other timetabling problems such as the curriculum-based course timetabling problem and examination timetabling problem. Additional domain-specific neighborhood structures that may reduce the number of iterations and shorten the computational time will also be looked into as the exploitation ability exhibited by the Neighborhood Search algorithm is very promising.
Habibollah Haron: Who provided invaluable input in organizing the research materials.
Antoni Wibowo: Who provided indispensable technical and programming input.
Mohd. Salihin Ngadiman: Who gave constructive and critical feedback to the research works.

Ethics
The authors have deliberated thoroughly throughout the course of the publishing of this manuscript and conclude that all information and results reflected in this manuscript are true to its account and are not plagiarized from other sources. The dataset employed for the testing of the algorithm does not divulge any sensitive information but yet retains its degree of complexity.