Honours course timetabling and classroom assignment

This work addresses the timetabling problem faced by the Department of Statistical


Introduction
Timetabling problems, in general, consist of assigning events (e.g.courses, shifts , lectures) to specific timeslots over a fixed planning horizon.These problems arise in numerous industries and activities including education, transport, sport, and the healthcare system [6].Educational timetabling problems, in particular, have a very high application value and have received increasing attention over the past few years [3,11].Three types of timetabling problems are often encountered in educational system, namely the course timetabling problem which deals with course and classroom allocations [13], the examination timetabling problem which tackles the issue of assigning exams to examination periods and venues [7], and the school timetabling problem which consists of distributing classes to periods for a specific class-teacher combination [9].The focus of this work is mainly on module timetabling problem specific to the honours class in the Department of Statistical Sciences at the University of Cape Town (UCT).
Each year the Department of Statistical Sciences at UCT faces challenges regarding lecturer, modules, and venue allocation for the honours class.Currently, the department creates the timetable manually, which results in an hard labour and potentially an unsatisfactory work condition.This work attempts to address this issue by providing a clear structure of the problem and at developing an automated system that can be employed by the department in order to alleviate the burden caused by the manual approach.
The honours modules consists of sixteen modules broken down into nine core and seven elective modules.The cohort of Applied Statistics students is required to take seven core modules while the group of students majoring in Mathematical Statistics is required to take six core modules.Furthermore, students who are completing a Bachelor of Business Science specialising in Analytics degree, irrespective of their major, are required to complete a minimum of two elective courses, whereas those who are completing a Bachelor of Commerce or a Bachelor of Science in Statistical Sciences are required to take a minimum of three elective courses.
Modules either require two or four hours of lecture time per week.Modules that require two hours of lecture time a week could comprise of two single sessions or one double session classes.Modules that require four hours of lecture time a week, on the other hand, require two double session classes.Moreover, the department makes use of two internal venues and a computer lab to schedule lecture sessions, with venue capacities ranging from 18 to 28.In 2022, the year during which this work was investigated, the department employed seventeen lecturers specialising in different areas of Statistics.Finally, academic days are from Monday to Friday from 8am to 6pm, hence no lecture times can be scheduled outside this window.
The overarching aim in this work is to develop mathematical programming models to represent the characteristics of the honours course timetabling and classroom assignment problem as per the description above for the Department of Statistical Sciences at UCT.The proposed model consists of three phases: The first phase concerns allocation of lecturers to modules, referred to as lecturer allocation, the second phase involves assignment of modules to time slots, namely module allocation, and the last phase consists of allocating classes to venues, referred to as venue allocation.The model is designed based on the following criteria: (1) lecturers are assigned to a set of modules based on their preferences and expertise, (2) students' preferences in terms of the lecture times are taken into account, and (3) the timetable is created based on the available venues.This way, the generated timetable allows some flexibility and helps students and lecturers to maintain a balance between class preparation and non-academic activities.It also ensures a reasonable level of infrastructure utilisation.
The remainder of this paper is structured as follows.In Section 2, a brief description of the existing literature on the timetabling problem is presented.This is followed by a presentation of the proposed models in Section 3. Details of the data employed and the model implementation are discussed in Section 4. The computational results are reported in Section 5. Validation and limitations of the study are discussed in Section 6.Some final remarks along with future research directions are provided in Section 7.

Literature review
The primary objective of course timetabling is to allocate each course at a time (or set of times) which does not conflict with the time(s) assigned to any other course required by the students attending it [13].This is relatively easy if there are only a few courses taken in combination with the course of interest.It becomes considerably more difficult as the combinations of courses requiring different time placements increase.The availability of venues, lecturers, and a variety of other constraints, further complicate the problem.
Challenges that are experienced when creating timetables are the results of conflicts, availability of resources, and preferences.The majority of existing models in the literature used to solve the problem are based on integer linear programming [5,10].The objective function differs from model to model to cater for the specific rules, policies, and preferences of universities, lecturers, and students.Examples of objective functions often considered in the literature include minimisation of the cost incurred by the module allocation according to the available timeslots, minimisation of the violations of some constraints, minimisation of the dissatisfaction of students and/or lecturers, and maximisation of the allocation of lecturers to modules based on their preferences [3].
Similar to the objective function, the set of constraints considered in the existing models is dependent on the rules governing the institutions.The most commonly used constraints encountered in the literature include the uniqueness constraint, which ensures that no clashes occurs in the generated timetable, the completeness constraint, which ensures that all modules are scheduled on the timetable, the cumulative or consecutive constraint, which accommodates consecutive sessions of teaching periods and repeated classes over the scheduling horizon, and the capacity constraint, which warrants that the timetable adheres to venue capacity [3].Some constraints are classified as soft constraints, which can be violated to obtain feasible solutions.Examples of soft constraints prevailing in the literature include the allocation of modules or classes to timeslots based on preferences, the allowance of an ample time break between two consecutive sessions, and piggybacking -assigning classes with similar syllabi to a single lecturer [11].
In terms of solution approaches, the majority of works focused on solving educational timetabling problems to optimality using exact methods.Successful solutions using branch and bound methods or integer programming-based methods have been reported in [4,5].A common criticism for the integer programming-based methods, however, is the heavy computational requirements that the branch and bound technique imposes on these models.Therefore, approximate solution techniques from the realm of metaheuristics are preferred, especially to solve large-scale problems.The most commonly used techniques encountered in the literature include the method of simulated annealing algorithm, tabu search, and genetic algorithms [1,7,8].Some research has also been done on the application of graph colouring to solve timetabling problems [12].
In 2003, Daskalaki and Birbas [5] proposed a two-stage relaxation procedure in an attempt to solve efficiently the integer programming model of a university timetabling problem.The relaxation concerns the consecutive constraints which are computationally heavier than the others and is performed in the first stage.A number of subproblems using the outputs of the first stage are solved for local optima during the second stage.Daskalaki and Birbas demonstrated that their proposed approach reduces computation time substantially and that it improves the solution quality over single-stage approaches.
A case study on the course timetabling and classroom assignment problem at Universidad de la Sabana, Colombia, was investigated by Torres-Ovalle et al. [13] in 2014.The problem was modelled using integer linear programming and was solved using a hierarchical twophase approach.The course timetabling problem was solved in the first place, then the classroom assignment problem was solved separately by taking into account the results returned by the first phase.Their computational results demonstrated that the proposed approach achieves a better utilisation of classrooms while satisfying both hard and soft constraints of the problem.Their analyses also revealed the reduction of total cost incurred by the solution approaches and the increase in teaching resource availability.
In 2016, Perera and Lanel [12] attempted to solve a university course timetabling problem using a graph colouring approach.The system uses an integer programming model to assign a set of courses to time periods where each set is the result of a graph colouring approach.The model results in a feasible solution which has been shown to reduce the maximum idle time of students.The model was also shown to be flexible and allowed any changes to the constraints depending on faculty requirements and other factors.
The model proposed in this work is based on an integer programming approach and it is solved to optimality.Interested readers are referred to the recent survey of Gashgari et al. [7] for application of metaheuristic techniques to solve timetabling problems.

Model formulation
A hierarchical three-phase integer programming model is proposed in this section to address the course timetabling and venue allocation for the honours programme at the Department of Statistical Sciences at UCT.The lecturer allocation refers to the allocation of lecturers to modules.This first phase allocation of "who is teaching what" is further used to determine the availability of each allocated lecturer to teach the relevant module in specific timeslots and a primary timetable is generated accordingly.This timetable serves as input for the last phase, where available venues are assigned to each module on the timetable.A final timetable for a single week of each semester is created at the end of the final phase.The weekly timetable is replicated across all weeks of the semester.
The reasoning behind using this hierarchy is to generate a flexible timetable so that it allows the department to decide on the teaching structure of the modules and to incorporate all other requirements pertaining to the degrees of the students.Particularly, the design allows the department to change the lecturer or module allocation based on preferences.

Notation
The notation used in the model proposed in this work is as follows:

K
The set of all venues available, k, where booking an external venue is classified as a venue.

J
The set of all lecturers, j.

I
The set of all modules, i. D The set of all days, d.T The set of all time slots, t.
δ j,i A binary variable indicating if lecturer j is allocated to teach module i.
The minimum number of hours of teaching expected of lecturer j. h max j The maximum number of hours of teaching expected of lecturer j. c i The number of classes for module i. m i The minimum number of classes a lecturer can teach for module i.This may be equal to the total number of classes a semester or not more than half the total number of classes a semester.ts The number of time slots per day of teaching.For the current problem there are ten time slots a day.

H i
The number of hours of class that must be scheduled for module i per week.

S *
A subset of I, containing all the single period modules that require two classes a week, s * .D * A subset of I, containing all the double period modules, d * .

DS *
A subset of D * , containing all the double period modules that require two classes a week, ds * .
The number of classes for module i taught by lecturer j. x i,d,t A binary variable indicating that module i has been assigned to day d during time slot t. z k,i,d,t A binary variable indicating the venue k in which module i has been allocated to take place on day d in time slot t.
l j,i The preference weight for module i for lecturer j. p i,d,t The preference weight for a module i to be scheduled on day d at time slot t. a k,i,d,t The preference weight for allocating module i's class to venue k on day d in time slot t. r j,i The number of classes for module i that lecturer j can teach.h i The length of each module i's class in hours.

Phase 1 -Lecturer Allocation
The aim in the first phase is to maximise the number of lecturers being allocated to modules of their preferred choices.The model formulation is as follows: The objective function (1) consists of maximising the number of modules assigned to each lecturer according to his or her preference weights.Constraint (2) ensures that all required classes for each module are allocated to lecturers.Constraint (3) restricts the number of classes a lecturer j can lecture for each module i according to his or her expertise.Constraint (4) enforces the boundaries on the total number of hours allocated to each lecturer to teach the honours modules.Finally, constraint (5) ensures that lecturers who are allocated to a module teach no more than the maximum number of classes for that module.

Phase 2 -Module allocation
The aim in this phase is to model students' preferences in terms of having their classes scheduled in certain timeslots.Four timetables are generated from this model, taking morning and afternoon preferences into account for both the first and second semesters.The model formulation is as follows: s.t t∈T t∈T The objective function ( 6) consists of maximising the students' preferences of having their classes scheduled in particular time slots based on the relevant weights.All timeslots that are not available have a preference weighting of zero; this accommodates the scenarios where classes have already being scheduled in those timeslots according to the availability of lecturers.The completeness constraint (7) ensures that all modules are scheduled in the timetable with the required number of hours.The uniqueness constraint (8) ensures that only one module can be allocated to a timeslot to avoid any conflicts between classes.
In addition, lecturers can choose between double or single session classes and one or two classes per week depending on the required number of hours that need to be taught in the semester and teaching preference.Constraints related to having double sessions are given in ( 9)- (11).The constraint (12) relates to having two single sessions a week, while the constraint ( 13) is linked with having two double sessions at least a day apart in a week.
To be able to schedule a double session, the two hour timeslots need to be scheduled consecutively.Constraint (9) ensures consecutive sessions for the first timeslot of the day, constraint (10) ensures consecutive sessions from the second timeslot of the day up to the last third timeslot of the day, and constraint (11) ensures consecutive sessions for the last two timeslots of the day.When scheduling two single sessions twice a week, the single sessions must not be on the same day.This is enforced by constraint (12).Moreover, when scheduling two double session classes, the two classes must be held on different days.Constraint (13) ensures that there is at least a day between each classes of a given subject.Finally, constraint (14) ensures that there is a break between two classes.

Phase 3 -Venue allocation
This phase consists of allocating venues to the classes scheduled during Phase 2. The model is implemented for both the Semester 1 and Semester 2 timetables.It is formulated as follows: s.t The objective function (15) consists of maximising the use of internal venues within the department and allocating as few classes as possible to external venues.The completeness constraint (16) ensures that a venue is allocated for the required number of hours per module per week.The uniqueness constraint (17) ensures that only one venue is booked for each module on a specific day during a certain timeslot.Any modules that have consecutive sessions need the same venue to be allocated for the sessions, this is achieved through constraints ( 18)-(20).

Data and model implementation
Details regarding the data collection and the structure of the database built are presented in this section.The model implementation is also discussed.

Data collection process
The list of modules along with the number of students taking each module is shown in Figure 1.The letter "W" indicates a core module that all students must take while the letters "M" and "A" indicate core modules that are only required to be taken by Mathematical or Applied Statistics students, respectively.The symbol "E" refers to elective courses which are available to be taken by all students except the advanced probability theory which can only be taken by students majoring in Mathematical Statistics.
No data on the lecturers and students preferences was available at the time the study was conducted, hence the need to gather these manually and create a database that could be used for the study.The data collection was done through surveys by sending questionnaire to students, lecturers, and administrative staff of the department.The initial surveys were sent out via email however the response rate was quite low, therefore face-to-face meetings were held where possible.
A sample of the questions that were asked to the lecturers is given in Figure 2. Lecturers were asked to provide a ranking on their favourite modules, to indicate which modules A sample of the questions that were asked to the students is given in Figure 3. Students were surveyed on their chosen elective courses and their preferences towards lecture times.
Answers to the questionnaire were transformed into appropriate formats which can be used as inputs for the model.For the lecturers' preference weights, for example, the most preferred module was assigned a weight value of 4, the second most preferred module was given a preference weighting of 3, the third favourite module was assigned a weight value of 2, and the remaining modules the lecturer can teach were given a preference weighting of 1.More detailed information on the collected data and the values of the parameters employed in the model implementation may be found in [2].

Model implementation
To ensure that the timetables created by the proposed model adhere to the rules and restrictions pertaining the relevant honours programme, additional information related to the model implementation are given in this section.
The following modules can only be scheduled during Semester   In addition, the generated timetable must accommodate the strategic thinking courses taken by the Business Science students.Typically these courses run from 11am to 1pm on Mondays and Fridays.Additionally, the department hosts a weekly seminar from 1pm to 2pm on Mondays, which all students are required to attend.To allow for thesis work, no classes are scheduled on Fridays.These restrictions are embedded in the model in the form of preference weightings which are set to be equal to zero to ensure that no classes are scheduled in these timeslots.Finally, there are two internal venues with class capacities of 18 and 28, respectively.In case no internal venue is available or cannot accommodate the class size, an external venue is booked through the venues department at UCT.
The model was coded in R using RStudio 2022.07.1.The model was executed on an Intel(R) Core(TM) i5-4300U, CPU running at 2.50 GHz with 4 GB RAM in the Windows 10 Home operating system.

Results
The results returned by the model described in Section 3 are presented in this section.Discussion and validation of the results follow in the next section.

Phase 1 model results
The lecturer allocation returned by the Phase 1 model is shown in Table 2.This solution represents the optimal allocation of lecturers to modules based on their preference rankings while adhering to their required range of teaching hours for the year and the maximum number of classes that they can teach per module.It also illustrates the split between the number of classes each lecturer teaches per module.As can be seen from Table 2, the split is mostly even which places a fair workload balance for the majority of the lecturers per module.The exception to this is the analytics course which is made up of three sections, each comprising of six classes.The result displayed in Table 3 indicates that 76% of lecturers were allocated to their most preferred modules.Since Lecturer 5 did not indicate any preferences to any modules, removing his allocation from the result increases the percentage of allocation of lecturers to their most preferred module to 81%.It is noteworthy that the allocated number of hours or classes per lecturer were within the bounds of minimum and maximum hours required.This shows that the solution is feasible and satisfies the hard constraints of the model.3: An illustration of the modules allocation according to lecturers' preferences.The 1st, 2nd, and 3rd columns indicate whether the allocated module was the 1st, 2nd, or 3rd choice of the lecturer.

Phase 2 model results
The first two timetables generated from the Phase 2 model in respect of both Semesters 1 and 2 are shown in Figure 4.For the Semester 1 morning preference, no classes are scheduled at 8am as this is the least preferred timeslot by the majority of the students.
Fridays are blocked out to allow students to have a dedicated day within the week to work on their honours theses.This also avoids a potential clash for the analytics students who need to attend a compulsory two-hour lecture at 11am on Fridays.In addition, the timetable satisfies the restrictions and rules of the department.This includes the weekly departmental seminar form 1pm to 2pm every Monday, during which no class should be scheduled (see Figure 4a).Substantial shifts are noticed in the timetabling solutions for the afternoon preference for both semesters, as depicted in Figure 5.The majority of the modules are scheduled from 12pm according the students' preferences.The timetables also adhere to the constraints and are feasible.

Discussion
A comparison between the timetables of Section 5 and the actual 2022 timetables for both semesters reveals that the actual timetables violate some constraints and rules of the honours programme and the department.In the actual timetable, for example, two clashes are spotted with respect to Mondays and Fridays blocked out slots for Analytics students.These are highlighted in gray on the timetable in Figure 7b.This situation is undesirable, hence the alternative timetable obtained from the proposed model is more suitable (see Figure 7a).Moreover, the actual Semester 1 timetable violates the consecutiveness constraint by having two modules scheduled consecutively without breaks (see Figure 6b).
The Semester 1 timetable returned by the model shown in Figure 6a thus outperforms the latter timetable and would be more suitable.Different scenarios were also experimented with and a sensitivity analysis was conducted to test the flexibility and the effectiveness of the proposed model.A two-phase integer programming approach was designed and compared to the results returned by the three-phase model.In the two-phase model, the lecturer allocation and module allocation were simultaneously modelled in one phase, followed by the venue allocation phase.The comparative results indicated that the timetables returned by the two-phases violate the consecutiveness constraints by having no breaks between the scheduled modules.However, the two-phase approach achieved higher solution quality with respect to the module allocation or creation of the timetable compared to the three-phase model (see Table 5).
The two models performed at the same level of optimality for the venue allocation, whilst the three-phase approach performed more optimally in terms of run time (see Table 6).Interested readers are referred to the work of Thompson et al. [2] for more detailed results and formulation of the two-phase model.
Four further scenarios were considered.The first two scenarios consisted of incorporating a sabbatical leave in both semesters, respectively.In this case, it was assumed that the lecturer with the highest lecture load goes on sabbatical leave and the model was adjusted to reflect this change.The third scenario imposed an additional restriction to the model by ensuring that a specific lecturer-module allocation is achieved.For example, if Lecturer 6 must be allocated to teach Biostatistic, for a particular reason, then this constraint must be enforced in the model and so does the resulting timetable.The last scenario takes into account a specific lecturer preference in terms of having his or her classes scheduled on his or her preferred timeslots.An example of the results returned by these scenarios in comparison to the results obtained from the original model is summarized in Table 7.The results shown in Table 7 indicate that the model is sensitive to changes in lecturer availability, which is to be expected.Furthermore, the model is not sensitive to any restrictions in terms of enforcing a specific lecturer-module allocation (the objective function values returned by the Phase 2 models of all scenarios stay the same).No changes in the objective function value with respect to the venue allocation model is also perceived for all four scenarios.This indicates that the Phase 3 model is relatively insensitive to changes in the module allocation.Detailed results and further information related to this sensitivity analysis may be found in [2].

Conclusion
This work tackles the challenges faced by the Department of Statistical Sciences at UCT when creating a feasible timetable for its honours programme.A hierarchical integer programming approach was proposed to model the problem, broken down into three phases involving lecturer allocation, module allocation, and venue allocation.The model was solved using the Rglpk package in RStudio.
The approach focused on addressing three key characteristics of a desirable timetable.The first characteristic consists of assigning lecturers to their most preferred module, which was achieved by the proposed model with a 81% preference rate.The second characteristic concerns students' preferences in terms of when to schedule modules over the scheduling horizon.Multiple timetables were created based on morning or afternoon preferences of which the students were ask to vote and choose the most desired timetable.The final characteristic considered was to maximise the use of internal venues which was achieved by assigning internal venues to all modules for which class capacity was not an issue.
The results were validated by students and the course convenors of which positive feedback was received from both.A high percentage of students, 84.2%, preferred the timetable obtained from the model to the current timetable.The programme convenors also commented on the flexibility of the generated timetable and its potential use by the depart-ment.The fact that the model allows any adaptation or changes to the departmental needs make it useful.
The next step for this research consists of making the model available to the department via a user-friendly computerised decision support system tool.Such software would take as inputs all parameters of the model and return as outputs the timetables.Further research directions also includes adaptation of the proposed approach to model a broader timetabling problem such as undergraduate course timetabling within the department and across faculties.

Figure 1 :
Figure 1: Module information of the honours programme at the Department of Statistical Sciences at UCT.

Figure 2 :
Figure 2: A sample of questions in the questionnaire sent out to lecturers.

Figure 3 :
Figure 3: A sample of questions in the questionnaire sent out to students.

Figure 4 :
Figure 4: Timetables returned by the Phase 2 model with respect to morning preference module allocations for both semesters.

Figure 5 :
Figure 5: Timetables returned by the Phase 2 model with respect to afternoon preference module allocations for both semesters.

( a )
Timetable generated by the model.(b) Current timetable drawn manually.

Figure 6 :
Figure 6: Comparison between the timetable generated by the model and the actual timetable for Semester 1.

( a )
Timetable generated by the model.(b) Current timetable drawn manually.

Figure 7 :
Figure 7: Comparison between the timetable generated by the model and the actual timetable for Semester 2.

Table 2 :
Lecturer allocation returned by the Phase 1 model.

Table 4
provides an indication of which modules require bookings of external venues based on the solutions obtained from Phase 1 and Phase 2 models.The result indicates that 57% of the modules were assigned to internal venues, which leaves less than half of the modules requiring external venues bookings.This solution suggests a relatively low administrative workload which is desirable.

Table 4 :
Venue allocation returned by the Phase 3 model.

Table 7 :
Examples of results returned by the four scenarios in terms of the objective function value and run time in comparison to those of the original model.