Solving University Course Timetabling Problem Using Multi-Depth Genetic Algorithm Solving UCTP Using MDGA

. The University Course Timetabling Problem (UCTP) is a scheduling problem of assigning teaching event in certain time and room by considering the constraints of university stakeholders such as students, lecturers, and departments. The constraints could be hard (encouraged to be satisﬁed) or soft (better to be fulﬁlled). This problem becomes complicated for universities which have an immense number of students and lecturers. Moreover, several universities are implementing student sectioning which is a problem of assigning students to classes of a subject while respecting individual student requests along with additional constraints. Such implementation enables students to choose a set of preference classes ﬁrst then the system will create a timetable depend on their preferences. Subsequently, student sectioning signiﬁcantly increases the problem complexity. As a result, the number of search spaces grows hugely multiplied by the expansion of students, other variables, and involvement of their constraints. However, current and generic solvers failed to meet scalability requirement for student sectioning UCTP. In this paper, we introduce the Multi-Depth Genetic Algorithm (MDGA) to solve student sectioning UCTP. MDGA uses the multiple stages of GA computation including multi-level mutation and multi-depth constraint consideration. Our research shows that MDGA could produce a feasible timetable for student sectioning problem and get better results than previous works and current UCTP solver. Furthermore, our experiment also shows that MDGA could compete with other UCTP solvers albeit not the best one for the ITC-2007 benchmark dataset.


Introduction
The University Course Timetabling Problem (UCTP) is a scheduling problem of assigning teaching event in certain time and room by considering the constraints of university stakeholders such as students, lecturers, and departments. The constraints could be hard (encouraged to be satisfied) or soft (better to be fulfilled). Regarding its difficulty, Garey included timetabling as an NP-Hard problem [1].
Moreover, several universities such as Telkom University [2], Purdue [3], and the University of Waterloo [4] implement student sectioning. Student sectioning is a problem of assigning students to classes of a subject while respecting individual student requests along with additional constraints [5]. Therefore, the fulfillment of each students' preference is encouraged, as well.
In regular timetabling, we place student enrollment (the process which the students choose their classes) after the class timetable available. Oppositely, in the student sectioning, students choose a set of preference classes first then the system will create a timetable depend on their preferences. Subsequently, student sectioning significantly increases the problem complexity. As a result, the number of search spaces grows hugely multiplied by the expansion of students, other variables, and involvement of their constraints.
UCTP is a minimizing optimization problem, so the objective is to minimize all the predefined constraint violation for each of the teaching events. One of the most recently studied for UCTP is the application of genetic algorithms (GA), which are based on the theory of evolution [6], and that have proved to be efficient for problems of moderate and realistic size such as AIMGA [2], Parallel GA [7,8], Fast Practical GA [9], Directed GA [10], and NSGA-II [11].
In GA, the most time consuming part which is in the fitness evaluation. Thus, student sectioning with large number of variables will make GA runs impractical. To implement GA as a practical solution for this problem, we need to divide the problem to be smaller problem so we could solve it, and then increase the level gradually until we reach the goal. This paper proposes Multi-Depth GA (MDGA) as a GA variation implementing such approach.
MDGA uses three levels of objective function which is differed by its complexity (depth of the problem): shallow, medium, and deep objective function. These objective functions are applied in different step of GA. Moreover, MDGA implements advanced mutation operation by combining three different local search which specifically designed for student sectioning UCTP. Finally, the combination of multi-level objective function and advanced mutation in MDGA will be a significant advantage for overcoming student sectioning UCTP.
Taken together, the primary motivation of this work is how to design MDGA for student sectioning UCTP. In detail, the main goals of this research are (1) to formalize a real-world scaling student sectioning UCTP, (2) to design MDGA to meet the problem requirements, and (3) to analyze MDGA performance in handling student sectioning UCTP.
This paper consists of five sections. We organize the remainder of this paper as follows. Section 2 talks about the student sectioning UCTP. Section 3 shows the MDGA design to meet UCTP problems. Section 4 shows how we conducted the experiments, results, and analysis. The last but not the least, Section 5 takes place as the conclusion and discussion of this work.

University Course Timetabling Problem
Generally, UCTP is a problem of arranging a set of teaching events (events) into a predefined packet of time and room while satisfying all constraints within the problem. Equation 1 is the formulation of a packet (q) of time (t) and room (r).
Time could be different from one university to another, which could be varied in weekly, daily, hourly, or even minutely. For example, a university could implement 40 minutes for a time while a certain university could have 60 minutes. Rooms are UCTP resources which could vary in capacity, facility, ownership, and specialization (for example theory and practice classroom). The notation in Table 1 is used for UCTP formulation.
An event (e) consists of a lecturer (l) who teaches a certain class (c) with a set of students (S ), which is defined by following notation: Hence, a timetable is a mapping set of all events into several or all packets. A mapping of a packet and an event is a pair (p), which is defined by following notation: As referenced from previous research [2,8], this research also used two types of constraints: the hard and soft constraints. Hard constraint (HC) is a constraint that must be satisfied. Soft constraint (SC) is better to be fulfilled to improve the quality of the timetable. Table 1. UCTP Formulation Indices and sets p ∈ P set of pairs e ∈ E set of events e p event of pair p q ∈ Q set of packets q p packet of pair p l ∈ L set of lecturers l p lecturer of pair p b ∈ B set of subjects b c subject of class c G b ⊆ L set of group lecturers for subject b k ∈ K ⊆ L set of special lecturers r ∈ R set of rooms r p room of pair p t ∈ T set of time t p time of pair p c ∈ C set of classes c p class of pair p d ∈ D set of days d p day of pair p z ∈ Z set of all students s ∈ S ⊆ Z set of students S p students of pair p Functions This research used five HCs and seven SCs. Where V i is a violation count for each i constraint. Furthermore, the following equations are the mathematical models of each constraint used in this research:

HC 1. No conflict of lecturers
There is no lecturer who has been set in different room at the same time.

HC 2. No conflict of classes
There is no packet that has been set for different event at the same time.
HC 3. Any event should be scheduled in a suitable capacity room No event that has been set in room with a less-than suitable capacity.
HC 4. Lecturers should not be scheduled within their time constraints Lecturers such as professors, rectors, and deans should be set in their time constraints.
HC 5. Some lecturers should be scheduled in their time preferences Lecturers such as professors, rectors, and deans should be set in their preferred time.

SC 1. Lecturer assignment spread
The teaching event for a lecturer should be set to a maximum of LC + events in a day. An event of a class should be set to a minimum of CC − days of interval in a week. In a real-world, there is a special case which a class can be lectured in more than once a week. For example, class AR002 must be taught twice a week. Thus, it is possible to have several similar events mapped into different packet. These similar events are interchangeably, which is shown by following notation:

SC 3. Time constraints between different events in the same group
Group teaching is mechanism which several classes with the same subject are taught by a group of lecturer interchangeably. The time interval between two events for a group teaching should less than its minimum time constraint.
SC 4. Some lecturers should be scheduled in their time preferred time The teaching event for a lecturer should be set in their preferred time.

SC 5. Time constraints between events for a lecturer
The time interval between two events that a lecturer should not less than the minimum time constraint interval. The events of a student should be set to a maximum S C + events in a day SC 7. Minimize students conflict Minimize student which has been set in different room or class meeting in same time

MDGA for UCTP
This section explains about how we encode the chromosome, formulate the problem definition in term of objective function division, and MDGA procedure.

Encoding
We use direct chromosome as the GA encoding. Direct chromosome mimics the real-world representation, which, in this case, is the university timetabling, as shown in Fig. 1. This timetable has R rooms and timeslots, which consist of 6 days multiplied by ten shifts (7 AM to 4 PM). This direct chromosome uses enumeration encoding, so the room is encoded as 1 to R for Room 1 to Room R. In the other hand, time is encoded as 1 for 7 AM Monday, 2 for 8 AM Monday, and 60 for 4 PM Saturday. As a result, the chromosome is shown in Fig. 2 as the encoding from timetable in Fig. 1. Fig. 2 shows that a gene block consists of five parts (time, room, lecturer, class, and students). We count the individual length is equal to the number of events (gene blocks). Furthermore, because the search space is only the packet (time and room), the other parts (lecturer, class, and students) are fixed. So, programmatically, all GA operations (mutation and crossover) are only applied to a packet.

Problem Definition
The goal of this research is solving student sectioning UCTP. However, this problem, especially with a huge number of students, is almost impossible to do. The enormous student numbers will lead to extensive-time computation due to objective function evaluations.
This condition will be more problematic because we have to guarantee that HCs are always satisfied. If we limit HCs satisfaction strictly, the possible search spaces will also be limited. As a result, we cannot produce any satisfactory solutions. Thus, in this research, we introduce HCs satisfaction in the objective function, as shown in Equation 28, with a large weighting. We call this equation as shallow objective function.  Minimize The shallow objective function focuses in maintaining HCs. The deeper objective function which are medium objective function and deep objective function focus in solving SCs and respecting the HCs as well. The medium objective function focuses in solving class-level SCs with the objective function as shown in Equation 29. The deep objective function focuses in solving student-level SCs with the objective function as shown in Equation 30.

MDGA Procedure
Basically, MDGA implements HCs satisfaction to generate initial population with greedy initialization. So, the initial population will has small number of HC violations. In other hands, the SCs satisfaction is applied in the core of GA procedure. Algorithm 1 shows that for each generation t, we perform GA steps such as elitism, selection, crossover, and mutation. Only in the first generation, we make an initial population of P by using greedy initialization with PopS ize as a number of individuals. For each generation, we create an empty population of P to be the new population and save elite individuals. We implement elitism mechanism to maintain elite individuals among the population. We put the best individual of P into P . Furthermore, we also put the best M individuals of P into P . So, the number of elite individuals is 1 + M.
We use roulette wheel selection to select two individuals idv 1 and idv 2 as parents. By using a roulette wheel, we can choose the parents fairly based-on their evaluation -we crossover these selected parents with crossover probability P c to produce offsprings then they are evaluated. In this step, we use class-level evaluation. We pick the best two individuals among parents and offsprings, to be the new parents.
We divide the mutation into two stages to solve the problem gradually. We mutate the new parents (stage 1 mutation) with mutation probability P m to produce offsprings then they are evaluated. This stage use class-level evaluation. We pick the best two individuals among parents and offsprings, to be the new parents.
After the population size equals PopS ize, we continue to stage 2 mutation with a mutation probability of P m . Stage 2 mutation is the same as stage 1 mutation, albeit the evaluation. Stage 2 uses student-level evaluation for parents and offsprings. We pick the best two individuals among parents and offsprings, to be the new parents. We put the last parents into P .
The process is repeated from selection until mutation until the number of individuals in P equals to PopS ize. After that, the population P replaces P and proceed to the next generation.

Crossover
We use a multi-point crossover with the number of affected genes is N c of all genes which violate constraints. The crossover follows these steps: Algorithm 1 GA Procedure Require: GA in generation t if t = 1 then Greedy Initialization population P[PopS ize] end if P = ∅ //empty population // elitism Put the best individual of P into P Put the best M individuals of P into P count = 1 + M while count < PopS ize do // selection Select idv 1 and idv 2 from P with roulette wheel // crossover Crossover idv 1 and idv 2 with probability P c [idv 1 , idv 2 ] = best 2 individuals of parents&offsprings // stage 1 mutation Mutate idv 1 and idv 2 with probability P m [idv 1 , idv 2 ] = best 2 individuals of parents&offsprings count = count + 2 end while // stage 2 mutation Select idv 1 and idv 2 from P with roulette wheel Mutate idv 1 and idv 2 with probability P m [idv 1 , idv 2 ] = best 2 individuals of parents&offsprings Put idv 1 and idv 2 into P Replace P with P

Mutation
We use three mutation steps to improve the probability of producing better offsprings. These three mutations are namely M1 (moving), M2 (swapping), and M3 (comparing). All mutations are always executed sequentially for each individual. The number of affected genes for mutation is N m of all genes which violate the constraints.

• M1 (Moving)
Select an event which violates the constraint. Move this event to an unused packet (see Eq. 1). The unused packet is a packet which has not been taken by an event. The target packet is selected from the list of unused packets with appropriate room capacity. M1 (Moving) is illustrated in Fig. 3.

Experimental Result
We perform the experiments to analyze MDGA performance in handling student sectioning UCTP. We also compare our proposed solution with other solvers to solve class-level UCTP benchmarks.

Parameter Settings
We set the weight of HCs far larger than SCs. We set the HC weight with the big number M, which M = 1000 programmatically. As a result, MGA will prioritize poor fitness caused by HCs. The SCs become the focus after all HCs have been satisfied. We set the penalty value of SCs as proportional to its influence. Regarding this consideration, the SCs penalty value configuration is presented in Table 2.
We set the GA parameters by considering previous research [2]. The GA parameter configurations are mutation probability P m = 0.1 with number of mutated genes N m = 10%, crossover probability P c = 0.8 with number of crossovered genes N c = 10%, maximum generation MaxGen = 200, and population size PopS ize = 30.   Soft Constraint Value S C1, S C2 -high lecturer and class SCs 50 S C3 -group teaching SC 5 S C4, S C5 -low lecturer SCs 20 S C6, S C7 -student SCs 1

Dataset
Dataset used in this research was Telkom University odd/even semester for 2011/12 (before merging) and 2016/17 (after merging) enrollment years. To be specific, the student body at Telkom University has increased from 6,570 students in 2011 to 23,451 in 2016. This number is a result of the merging of four universities. The detail dataset characteristics comparison is shown in Table 3.

Experiment 1 -Proof of Concept
The first experiment implemented MDGA for Telkom UCTP 2011/12 as well as 2016/17 enrollment years. We observed its performance based on the best and average fitness values in 5 runs. For additional insight, we include the HC violation percentages. Table 4 shows that MDGA could yield an acceptable fitness value for 2011/12 as well as 2016/17 enrollment years. MDGA could achieve a small violation percentage timetabling, which means we can accept these results as a feasible timetable.

Experiment 2 -Comparison Analysis
The third experiment put MDGA together with Standard Genetic Algorithm (GA) [6], Asynchronous Island Model Genetic Algorithm (AIMGA) as a previous solver for Telkom UCTP [2], and UniTime [12] as a current generic UCTP solver. The parameter configuration and chromosome structure of GA and AIMGA were the same with MDGA. The comparison details are shown in the following Table 5. According to [12], UniTime has different constraint configuration format with Telkom UCTP. Therefore, we conducted a constraints mapping from Telkom UCTP into UniTime format (v2.3), which is explained in Table 6. Where SAME_ROOM means given classes must be taught in the same room, SPREAD means given classes have to be spread in time (overlapping of the classes in time needs to be minimized), NHB_GTE means given classes must have 1 hour or more in between, NHB_LT means given classes must have less than 6 hours from the end of first-class to the beginning of the next, and NHB means given classes must have exactly x hours in between the end of one and the beginning of another.   Table 7 shows the average of violation percentage comparison of MDGA, GA, AIMGA, and UniTime in 5 runs. The unfeasible value in UniTime cell for Telkom UCTP 2016/17 enrollment year means it could not get a result in a reasonable time (6 hours runtime limit exceeded). Besides, this table points out that MDGA could lead other algorithm results for both problems.
These results are extracted from each paper or a review paper in UCTP by Babaei et al. [26]. Similar to the review paper, we only compare the violation numbers because, in general practice of university timetabling, the computational time is usually not the primary consideration. That is because a university is usually required to make a timetable once in a semester. So the time limit might be around a few days in the end or beginning of a semester. Table 9 shows that MDGA could get the fewest violations for 6 of 24 test cases. This result proves MDGA could compete with other UCTP solvers albeit not the best one for the ITC-2007 benchmark dataset.