1 Introduction

A timetabling problem generally consists of assigning a set of activities to resources such that a set of problem-dependent constraints is fulfilled. Usually, these constraints are considered to be hard, since resources (such as rooms or teachers) cannot be shared. Desirable characteristics of the timetable are represented in the objective function as explicit valuations of certain properties or as violations of soft constraints. The overall goal is to find a feasible assignment minimizing a weighted sum of valuations and penalties arising from the soft constraints (cf. Schaerf 1999).

There is a wide range of real-world applications in this area, including university timetabling, where different categories of specific problems are distinguished: Examination timetabling (ETT), post-enrolment course timetabling (PE-CTT) and curriculum-based course timetabling (CB-CTT). The latter two deal with the assignment of courses to time periods and rooms, however, there are certain differences. In PE-CTT the timetable is established after the enrolment of students, thus taking into account that students are enrolled in various combinations of events and somehow incorporating these selections. CB-CTT determines a timetable based on a curriculum of study programs, that is, a list of courses to be taken by a group of students. A recent survey on all the available formulations of educational timetabling is provided by Ceschia et al. (2023).

Clearly, Operations Research applications in education span a much wider range than only timetabling problems, see Johnes (2015) for an overview. Real-world planning tasks in education often simultaneously comprise components of various problems, depending on the stage of planning and area of application (such as elementary or tertiary education). In many scenarios complex planning entities are involved and information becomes available in several steps. This is also the case for the problem considered in this paper.

The timetabling problem we are dealing with is a complex scenario involving several non-standard properties. It considers students enrolled in two different subjects chosen from a long list of subjects, each of them with its own curriculum. Placing courses into time slots such that each student can follow the required courses of its two subjects without overlaps appears to be an impossible task. However, it becomes more tractable by the presence of parallel groups for each course. This is known as student sectioning (see e.g. Müller and Murray 2010), where students are assigned to particular sections of a course satisfying constraints such as room or section capacity. Therefore, after deriving an adequate timetable, one seeks an optimal assignment of students to sections of courses avoiding conflicts and taking into account students’ needs. From a planning perspective, our problem can be considered a multi-phase scheduling problem, since three consecutive planning stages are required.

Our goal is a highly customized plan, taking into account the individual progress of each student. Since the timetable has to be set up way before the actual study progress and the resulting course requirements of students are known, our timetabling problem considers an abstract model of the student body, while the actual students are assigned to courses and time slots in a later stage. Customization also requires an adaptation of the term structure prescribed for the courses to accommodate the observed student behaviour. An analysis of the students’ exam data shows that more than 40% of courses are passed later than in the prescribed term. Thus, the usual term-based timetable structure does not allow a sufficiently customized plan. The complex structure of our timetabling problem and the high degree of customization will in most cases compromise the feasibility of the problem. Therefore, we will introduce various possibilities to deal with infeasibilities in order to obtain acceptable solutions.

In our approach, there is a trade-off between achieving an overall effective solution and ensuring fairness for individual students. While we will provide insights to the decision-maker on managing this trade-off, we do not extensively investigate the fairness issues of course allocation in this study. We refer interested readers to the comprehensive monograph (Mühlenthaler 2015) as well as the journal paper (Mühlenthaler and Wanka 2016).

Our approach encompasses a three-stage planning process. In Stage 1, we focus on shifting important “main lectures” from their historical starting times to align with the regular time grid, which forms the basis of our plans. This stage specifically considers courses with a large audience and established time slots, which are aligned with the regular time grid to avoid overlaps with other courses, while minimizing disruptions and inconvenience. Stage 2 involves the formulation of a comprehensive Integer Linear Programming (ILP) model that determines the time periods for all parallel groups of courses in a single optimization step. The model assigns sets of relevant courses to student groups with similar characteristics, ensuring collision-free time periods. It is important to note that these student groups are estimations of future student demand, as this planning process takes place several months prior to the start of the academic year. Stage 1 and Stage 2 are the core of the optimization task, that determines the timetable for the majority of courses, providing the day of the week and starting time for each course. This weekly plan remains fixed throughout the entire term. Special courses, such as laboratory exercises, which take place only during a limited number of weeks, are excluded from our considerations. In Stage 3, the final course assignment of students is addressed in a manner that ensures each student receives a personalized timetable that is meaningful and free of overlaps. This stage occurs at a later time, when actual students are matched to the estimated student groups determined in Stage 2. Both Stages 1 and 3 incorporate extensions of the linear assignment problem, accommodating additional conflict constraints to optimize the course allocation process. Computational results with real-world data of more than 2000 students illustrate the possibilities offered by a centralized planning process to support the timely progress of students.

1.1 Contribution and outline

To summarize the contribution of this paper, we gather it under four main aspects:

  1. (1)

    We tackle a highly complex planning scenario with a widely heterogeneous student body.

  2. (2)

    We consider a high degree of customization, producing an individual timetable for every single student, tailored to its demand and systematically including deviations from the prescribed term structure.

  3. (3)

    Special consideration is devoted to the issue of infeasibility, which is of particular relevance in regard to our practical application.

  4. (4)

    Our planning task involves a significant degree of uncertainty, since the timetable has to be fixed at an early time when actual student numbers and demands are not known. We employ placeholders for small groups of homogenous students as forecasts, to be matched to actual students later at the beginning of each term.

As detailed in Sect. 2, the ITC-2019 (International Timetabling CompetitionFootnote 1) is widely recognized for encompassing a diverse range of timetabling features, some of which intersect with the problem addressed in this paper. Notably, our planning task introduces distinct features that are only partially covered by the ITC-2019. These features can be summarized as follows:

  1. (1)

    Uncertainty Our problem involves dealing with uncertainty, where the precise student demands remain unknown during the initial timetable setup.

  2. (2)

    Objective While a minor distinction, our objective encompasses the combination of students based on their second subject.

  3. (3)

    Forecasting postponement Our approach includes forecasting when students are likely to undertake specific courses, leading to the postponement of late courses.

  4. (4)

    In-Depth infeasibility treatment We delve into an extensive treatment and analysis of infeasibility issues.

After discussing related literature in Sect. 2, we give a detailed description of our problem in Sect. 3. The mathematical models introduced for solving our timetabling problem will be presented in Sect. 4. Computational experiments in Sect. 6 illustrate the potential and limitations of the optimization framework based on the real-world data of the University of Graz described in Sect. 5. Some of the results of this paper were included or announced in the proceedings paper (Steiner et al. 2022).

2 Related literature

In the literature, there exist several strategies of section management, depending on the concrete problem where they are applied. The problem has been tackled either as a separate problem or integrated into the timetabling procedure. Aubin and Ferland (1989) for example iteratively adjusted both timetable and section assignment given an initial timetable. Banks et al. (1998) propose a rather simultaneous approach, where they assign sections of courses to time periods and iteratively add constraints, each representing a student course selection, to satisfy as many choices as possible.

A very comprehensive approach is the one by Müller and Murray (2010), who propose a multi-phase sectioning strategy, considering various information stages in educational planning and using different (heuristic) algorithms for each phase. In detail, they identify three different approaches to sectioning that they call Initial sectioning, Batch sectioning, and Online sectioning, which differ based on the time when it takes place and the information available at that time. The same approach has been further extended and specifically applied to a Faculty of Education by Müller and Rudová (2016). More in details, the authors translate the complex structure of conflicts and alternatives created by the curricula into a set of course/section lists for individual students, using also estimated percentages of attendance for each activity.

The same research group proposed also a multi-stage approach (cf. Rudová et al. 2011), in which the first stage fixes the large lectures and the subsequent two stages fix classes and laboratories, respectively. The first stage is analogous to our Stage 1, while the others are quite different from our setting, in which Stages 2 and 3 are executed in different times (several months apart) due to new information coming at a later time.

An integrated timetabling and sectioning problem has been recently proposed for the fourth International Timetabling Competition (ITC-2019) by Müller et al. (2018). The ITC-2019 problem consists of sectioning students into classes based on course enrolments and then assigning classes to available periods and rooms. Courses may have a complex structure of classes, with one or more configurations, further divided into subparts and the parent–child relationship between classes. The other remarkable feature is that the timetable may differ from week to week, instead of replicating the same weekly timetable for the whole semester.

It is worth mentioning that for such a complex timetabling/sectioning problem as the ITC-2019 one, the solution techniques based on MIP solvers turned out to be very competitive. Indeed, the MIP formulation by Holm et al. (2022) won the competition and produced the best solution for the majority of the instances. Most of the remaining best solutions have been obtained by a local search approach, which did not enter the competition as it was proposed by one of the organizers (i.e., Müller 2022).

Other successful applications of MIP models to timetabling problems are the works by Lach and Lübbecke (2012) and by Bagger et al. (2019), that worked on the CB-CTT problem obtaining both good solutions and tight lower bounds. Another complex, real-world sectioning problem has been proposed by Esmaeilbeigi et al. (2021) for a military school. In their problem, a lesson has a multiphase structure, such that each phase may require different resources and is taken by different students.

Complexity analysis of the student sectioning problem has been carried out by Dostert et al. (2016) and Schindl (2019), identifying the cases in which the problem is polynomial and those in which the problem is NP-hard.

In practice, it is common for complex timetabling problems that some instances prove infeasible, such that no solution of any quality satisfies all constraints. During the process of developing an ILP formulation, it may well happen that a system of constraints, that individually are reasonable and do represent what the modeller intended, turns out to be inconsistent at a global level. Researchers’ and practitioners’ methodology to deal with this challenge can be roughly divided into post-infeasibility analysis or diagnosis and infeasibility resolution techniques, in that order. While the former usually employs the isolation of the infeasibility and/or a relaxation of the problem, the latter seeks a marginal modification of the constraints in order to ‘repair’ the problem (cf. Chinneck 2008). Chakravarti (1994) describes two plausible ways of approaching the analysis: (i) Rlastic programming that is attributed to Brown and Graves (1975) and (ii) The identification of a subset of constraints without which the instance would be feasible (proposed, among others, in Roodman 1979). These (now) so-called irreducible inconsistent subsystem (IIS) can then be analyzed to investigate which constraints should be relaxed and to estimate the magnitude of alteration.

In elastic programming, for each constraint, non-negative elastic variables are introduced, which are added or subtracted depending on the inequality type, and also considered in the objective function. Since this technique is applied in our work, more details follow in Sect. 4.2.3. A similar method is also applied in scalarization techniques for multiobjective (combinatorial) optimization (see e.g. Ehrgott and Ryan 2003 or Safi and Marzooni 2012).

The resolution of infeasibility, as stated, generally focuses on a marginal alteration of the constraints, that is, an adequate perturbation of the right-hand side of the coefficients such that the resulting instance becomes feasible. Attaining an appropriate feasible reformulation is, to some extent, related to a specific problem instance and thus usually a combination of methods is used, also including interactivity with the decision maker. León and Liern (2001), for example, use a general fuzzy approach and provide lower bounds on the changes on each of the right-hand side coefficients. Then the decision maker can stop the process if she accepts their magnitude. To increase the adequacy of the perturbation of the coefficients—that is: which constraint to alter to what extent—problem-specific knowledge can be used, e.g. in the resolution of railway timetable instances in Polinder et al. (2018).

Infeasibility can also occur at a later stage when real-world circumstances change, such that no feasible solution can be found anymore for an originally feasible model. In such a case, the objective is not only to restore feasibility, but also to minimize disruption in relation to the specific context (e.g. a timetable as in Phillips et al. 2017).

3 Problem description

The University of Graz, Austria, offers programs in most major academic disciplines for its roughly 30,000 students. Among these programs, the teacher education study program (qualifying teachers for middle and high school level) with an enrollment of ca. 4200 students sticks out for its particularly complex planning scenario. From a student perspective, there are no less than 28 subjects to choose from. The study program requires each student to pick exactly two of these, with no restrictions imposed on the selection. A similar situation was mentioned in test instances from a School of Education in ITC-2019. Not surprisingly, in practice, there are 8 to 10 subjects attracting together the vast majority of students, while more than 10 more “exotic” subjects can be considered as rare choices.

From a timetable planning perspective, the arbitrary selection of subject pairs poses a basically insolvable challenge. Clearly, it will not be possible to construct a timetable that permits for every pair of subjects a feasible, i.e. non-overlapping, schedule of the courses prescribed for a certain term. Not surprisingly, students frequently complain about time conflicts in their respective timetables. It is also clear that these conflicts necessarily lead to postponing courses and, in general, have a negative effect on the students’ performance.

The current planning process to mostly perpetuates the historically evolved timetable from the previous academic year and applies some local improvements to accommodate complaints voiced by students obstructed in their progress by conflicting time slots of their courses. To provide better study conditions and shorten the average duration of study (consider that high school teachers are currently on high demand in Austria), the administration of the University of Graz asked us to develop an automated planning tool for computing timetables better suited to the needs of individual students.

One major aspect of interest is the presence of several parallel groups, i.e. sections, for many courses, which are crucial for accommodating the conflict-free combination of students from different subjects. Assigning the students to an appropriate section of courses requires a combination of student sectioning and timetabling, which has been considered also in the ITC-2019 instances, as well as in earlier works such as of Carter and Laporte (1998). The main goal asks for conflict-free courses for every student. However, we will also consider criteria of perceived quality of individual timetables (such as compactness) and try to model certain didactic aspects. Related work regarding the incorporation of students’ perspectives has been done very recently in Christou et al. (2024). The authors focus on personalized student course plans with various objectives, such as course difficulty balance or maximization of expected student grade point average. Concretely, the difficulty is based on the associated number of credits, student failure rates of the past three years and an instructor’s “expert guess” for new courses.

Another complicating aspect is the time line of the planning process at the University of Graz. Timetables are drawn up in March for the two terms of the following academic year starting in October. At that time the actual number of students enrolled for each subject in each year is not known, but only projected student numbers are available. Based on these projections capacity planning is performed on a local level by the different departments setting the number of sections for each course.

Although our goal would be a timetable permitting a personalized, feasible sectioning of actual students, we have to perform our planning task of Stage 2 with projected student numbers estimating the demand for each pair of subjects and each term (representing progress in the study program). Stage 3 is carried out shortly before the start of each term (October and March), when actual student data is known (and differences to the projected numbers become evident). At this point, an adaption and especially a re-scheduling of courses is permitted only in exceptional cases.

An additional factor stretching the scope of customization is the fairly liberal attitude and low degree of regulation regarding the progress in the study program. While universities in many European countries as well as in the US follow a stricter year-based regime, where most students actually follow exactly those course prescribed for the their term, the situation is different in some middle-European countries, in particular in Austria or Germany. There, progress of students is much less regulated, although a course may be subject to certain prerequisites, i.e. courses required to be taken before entering the course. In general, it can be expected that a student may still not have passed some courses prescribed for earlier terms, but may already have taken a course planned e.g. for a subsequent term. This non-standard study progress poses an additional challenge for the development of individually feasible timetables.

Taking into account all these specifications, it can hardly be expected that a feasible solution with a perfect timetable for all courses and all students can be computed, but infeasibility will be the default outcome. Therefore, an important contribution of our work will be the discussion of various ways of dealing with this issue in practice and reaching reasonable plans without compromising the planning goals too much.

Lecture rooms will not be considered in our planning task, which is quite different from most existing timetabling applications. Since rooms are shared with the various other programs of the university (our planning concerns only ca. 15% of all students) an automated allocation of rooms would have a major influence on the decentral timetable planning process of the whole university. Discussing with stakeholders it turned out that rooms do not pose a major problem. Either courses have specific requirements and are therefore tightly coupled to a certain department, or they have no requirements at all (standard exercise class) and can use any room on the campus.

In the following, we will give a more formal definition of our problem. The input structure of the problem primarily consists of a set of courses. These consist on one hand of so-called main courses (lectures) MC, which usually cater to a larger audience and do not have parallel groups. However, many of them have a historically established starting time, possibly outside the regular time grid. Then there are standard courses (exercise classes, seminars, etc.) C, where each course \(c \in C\) should be taught to a group of limited capacity cap(c). Therefore, \(g(c)\ge 1\) sections (parallel groups) are offered yielding a total course capacity of \(g(c)\cdot cap(c)\). For each standard course \(c\in C\) the set of sections will be denoted by \(G(c):=\{1,\ldots , g(c)\}\). As stated above the number of these groups is determined by a separate planning process (involving also financial considerations) and is provided as an input to the timetabling task.

The time horizon is given by a set P of feasible time periods, representing a day of the week and a starting time. The timetable assigns each main course in MC and each section of every course in C to a certain time period \(p \in P\). Starting times are set by university rules to a fixed time grid starting at 8:15 and continuing with a sequence of 90 min of lecture time and 15 min breaks. This allows for seven time slots per day, which results in \(|P|=35\) time periods per week as shown below. We only assign lectures of 90 min and exclude from consideration the small number of standard courses with deviating duration. Main courses in turn are not affected.

Start

Mon

Tue

Wed

Thu

Fri

08:15

     

10:00

     

11:45

     

13:30

     

15:15

     

17:00

     

18:45

     

For each course resp. parallel-group a lecturer is given. Equivalently, for each lecturer \(l\in L\), its set of main courses \(MC_{\text{ lec }}(l)\), resp. courses \(C_{\text{ lec }}(l)\), is known. Following the most common teaching mode, we assume that each course or group is given by exactly one lecturer, although team teaching or shared courses may well occur in practice. However, our model could be easily extended to accommodate more than one lecturer per course.

We are given a set F of 28 offered subjects. Each course \(c \in MC \cup C\) is part of the curriculum of exactly one subject \(f(c) \in F\). As an exception, there is a small subset of main courses which is prescribed for all subjects (educational theory, etc.). A course a is assigned a value ECTS(a) of ECTS credits.Footnote 2 Moreover, each course a is prescribed for a certain term t(a) with \(t(a) \in T:=\{1,2,\ldots , 8\}\), corresponding to winter and summer semesters of a four year program. We will denote the set of main courses, resp. courses, of a term \(t\in T\) by \(MC_{\text{ term }}(t)\), resp. \(C_{\text{ term }}(t)\).

There is also a structure of precedence relations, which are more or less restrictive, depending on the subject. This means that for each course \(c \in MC \cup C\) there is defined a subset of courses \(pre(c) \subset MC \cup C\), which all have to be completed before course c can be started.

As pointed out above, the liberal approach to study regulations produces many students with non-standard study progresses, where courses are not completed in the term that is recommended in the curriculum. To cater in particular to those students who should take courses which are prescribed for different terms, we consider to some extend also conflicts between courses that are not normally taken in the same year. This is quite different from many curriculum-based models which follow a strict term structure. The resulting term-overlapping constraints are determined from given historical data that describes to which extent courses are completed earlier or (more likely) later than recommended. Courses that are prone to be taken later than in the prescribed term will be called displaced courses. Their identification will be described in Sect. 4.2.1.

On the demand side, there is a set of students S partitioned into subsets \(S_{\{f',f''\}}\) indicating those students studying subjects \(f', f'' \in F\) (there is no ordering of the two chosen subjects).

4 Solving the timetabling problem

To establish the timetable we will treat main courses MC and standard courses C separately in two consecutive stages and the assignment of actual students in the third one. In the following, we will describe our solution approach for each of them.

4.1 Stage 1: Alignment of main lectures

In Stage 1, we align the main courses MC (which do not have parallel sections) with the provided time grid. This alignment process is somewhat analogous to the minimal perturbation problem, which has been addressed extensively in previous literature (see e.g. Müller et al. 2005). While we do define a distance function as outlined below, it is important to note that our problem is not inherently ’dynamic’ in the same sense as discussed in the existing literature. This is because the adjustment to the grid occurs only once and is not an ongoing process. Additionally, our focus is not on solving an original (but slightly changed) problem itself, but rather on ’improving’ an initial solution, namely the current schedule of main courses. A majority of these already follow this prescribed time frame in the current timetable, but a non-negligible minority deviates from the time grid. Since the main courses are usually constant over the years with respect to their time and room, it is advantageous for the acceptance of an automatic planning system to change their starting times as little as possible. Moreover, blatant time collisions between main courses have been eliminated over the years and hardly occur anymore. Note that some of these courses are also part of other study programs outside the teacher education program (think of Analysis 1 which is also taken by students of Pure Mathematics) which means that changes may cause considerable side-effects on study programs outside the scope of our planning task.

Therefore, we determine the starting times of main courses by solving a version of the linear assignment problem with additional conflict constraints. Thereby we match main courses MC to time periods \(p \in P\) of the given time grid with the additional restriction that any two main courses \(c', c'' \in MC\) with \(t(c')=t(c'')\), i.e. belonging to the same term, must not overlap. This non-collision condition is imposed independently from the subject since it should be possible to study any combination of subjects without overlaps in the main courses as there exists no alternative for them. It also applies for the special main courses which are prescribed for all subjects.

Additionally, any lecturer \(l \in L\) cannot be assigned to more than one course at the same time, both in the winter and the summer semester.

The goal of the alignment process is the minimization of deviations of the new plan from the previous schedule. In the linear objective function we consider for every course c the distance D(cp) between the current time slot of course c (i.e. as in the previous year) and the newly assigned time period \(p \in P\). If both times are on the same day, D(cp) describes the absolute difference in minutes between the current starting time and the beginning of period p. Otherwise, i.e. if the course is moved to a different day, we assume a penalty value \(\rho\) equal to three times the maximum intra-day distance (independently from the new day). This choice of objective function was preferred to other plausible possibilities, such as trying to keep (roughly) the same time period, even if the day of the week changes. Since it is common for members of the faculty to spend only certain days of the week on campus and work from home (which may be far away) on other days, it is preferred to keep courses on the same day as in the past. Especially for teacher education, there are numerous practitioners serving as part-time lectures. They teach at schools on some days of the week and teach university courses on one or two other days. Our objective helps to keep these arrangements undisturbed. Formally, we have

$$\begin{aligned} D(c,p) ={\left\{ \begin{array}{ll} \text {distance [in Min.]}, &{} \text {if the day remains the same}\\ \rho , &{} \text {otherwise.} \end{array}\right. } \end{aligned}$$

The alignment model employs a single type of binary decision variables \(y_{cp}\), such that \(y_{cp} = 1\) if main course \(c \in MC\) is assigned to time period p, and 0 otherwise. The resulting assignment-type integer linear program is as follows:

$$\begin{aligned}&\text {min}\,\sum _{c \in MC}\sum _{p\in P} y_{cp} \cdot D(c,p) \end{aligned}$$
(1a)
$$\begin{aligned}&\text {s.t}\,\sum _{p \in P} y_{cp} = 1, \quad \forall c \in MC \end{aligned}$$
(1b)
$$\begin{aligned}&\sum _{c\in MC_{\text{ term }}(t)} y_{cp} \le 1, \quad \forall p \in P, \; t \in T \end{aligned}$$
(1c)
$$\begin{aligned}&\sum _{c\in MC_{\text{ lec }}(l)} y_{cp} \le 1, \quad \forall p \in P, \; l \in L \end{aligned}$$
(1d)
$$\begin{aligned}&y_{cp} \in \{0,1\} \end{aligned}$$
(1e)

Constraints (1b) ensure that every lecture is scheduled exactly once, Constraints (1c) enforce conflict-freeness of all main courses in the same term, and Constraints (1d) avoids collisions for lecturers. Recall that \(MC_{\text{ lec }}(l)\) denotes the set of main courses given by lecturer l, and \(MC_{\text{ term }}(t)\) the main courses of term t, \(t \in T\).

Computational results for Stage 1 will be given in Sect. 6.1.

4.2 Stage 2: Timetabling-sectioning

Stage 2 is the most complex part of our planning tool. It determines time slots from the given time grid for all standard courses C. Recall that most of these courses are offered with parallel groups. This requires a sectioning of the prospective students cohorts. As pointed out in Sect. 3, at the point of the timetable generation, the actual demand structure of students for the following academic year is by no means clear. Therefore, we first develop a model representing the expected demand.

4.2.1 Generating prospective student demand

Recall that each student of the teacher education program is enrolled in two subjects \(\{f_1, f_2\}\) (of equal importance), where each \(f_i\) is chosen arbitrarily from a set F of 28 offered subjects. In the liberal study system, students’ progress will differ considerably and often does not follow the prescribed “path” through the curriculum. Nevertheless, we want to place every student s in a certain term in T to generate cohorts of comparable students. To do so, we count the sum \(ECTS_s\) of ECTS credits reached so far and assign student s to term \(t_s=\lceil \frac{ECTS_s}{30}\rceil\), since 30 ECTS are the usual workload assigned for one term. The experience at the universities administration tells us that most students proceed equally fast in their two chosen subjects. Thus, we do not distinguish the progress in the two subjects.

Since the exact solution of a full-scale ILP model for the timetabling problem will exceed the practically acceptable computation times, we scale the optimization problem of Stage 2 to a more tractable size. To do so, we combine sets of \(\Delta\) (e.g. \(\Delta =5\)) identical students, i.e. students with the same pair of subjects and in the same assumed term, to a so-called student quantum. The set of all quanta is denoted by I. Clearly, each quantum \(i \in I\) is placed in the same term \(t_i\) as the corresponding \(\Delta\) students.

Although the \(\Delta\) students represented by a single quantum may well differ in the precise set of courses they have passed already, this simplification should be acceptable because the students will have another one or two terms to increase their credits before the actual assignment (Stage 3). Thus, even students with a currently identical track record may well differ in their state at the beginning of the next term. For this reason, it is also pointless to include a full precedence check in the selection of courses for a quantum.

The main aspect of this section is the generation of the set of courses \(C_i\) which each quantum \(i \in I\) should attend in the following year. In the subsequent optimization model, each quantum will receive a conflict-free timetable including one section of every course in \(C_i\).

As described in Sect. 3 we aim to align the timetable with the actual progress of students. Therefore, we will introduce so-called displaced courses, which many students postpone and take later than prescribed. We will use historical exam data to analyze the students’ past performance and determine a delay factor del(c) for every course \(c\in C\) as follows.

Examination data provided by the central administration of the university gives for every course c the set of students S(c) that have completed this course and for every student \(s \in S(c)\) we are also given the term p(cs) in which student s has passed course c. As noted before, p(cs) may well differ from the prescribed term t(c). Based on this data we compute a lateness value L(cs) which represents the delay of student s in passing course c relative to other courses. Note that it is not meaningful to simply take the difference \(p(c,s)-t(c)\) as a measure of delay, since a student might progress slowly (maybe to due external obligations) and take all courses later than prescribed. Hence, we aim for a relative delay measure.

To this end, we sum up the courses (weighted by their ECTS values) prescribed for later terms which student s has taken in the same term or earlier than c, and the courses prescribed for the same term as c but taken in an earlier term than c. The total number of these “preponed” courses relative to c serves as a lateness value L(cs). Formally, we have:

$$\begin{aligned} L1(c,s):= & {} \sum _{b\in C} ECTS(b) \text{ with } t(b)>t(c) \text{ and } p(b,s) \le p(c,s)\\ L2(c,s):= & {} \sum _{b\in C} ECTS(b) \text{ with } t(b)=t(c) \text{ and } p(b,s) < p(c,s)\\ L(c,s):= & {} L1(c,s)+L2(c,s) \end{aligned}$$

This definition also yields meaningful values for identifying “slowly progressing” students who pass most of their courses later than prescribed. A university might offer some support measures to motivate or coach these students actively, since according to the central planning department there exists a correlation with dropping out of the program before completion.

Now, this lateness value is compared to a predefined lateness threshold \(\Lambda\), such that a course c is said to be passed late by student s, if \(L(c,s) > \Lambda\). Computing the lateness over all students \(s \in S(c)\), we determine the delay factor of course c as

$$\begin{aligned} del(c)=\frac{|\{s \in S(c) \mid L(c,s) > \Lambda \}|}{|S(c)| }. \end{aligned}$$

Based on these delay factors, we will generated displaced courses as follows. Let \(c \in C_{\text{ term }}(t)\) be a course for some term \(t\in T\). The g(c) sections of course c will be split in two parts depending on the proportion of students passing course c late. Defining \(g_1(c):= \lfloor g(c) \cdot del(c) \rfloor\), we introduce a new displaced course \(c_d\in C_d\) with \(g(c_d):=g_1(c)\) sections and prescribed for the successive year, i.e. with term \(t(c_d):= t(c)+2\). The original course c remains at term t(c), but the number of its sections is reduced by setting \(g(c):= g(c)-g_1(c)\). In this way, some course sections are offered in line with the study schedule of slower progressing students. All non-displaced courses for some term \(t\in T\) will be called regular courses \(C_r(t)\). Notably, we only displace courses for \(t(c)\le 6\), corresponding to courses within terms one to six. This decision is rooted in the observation that courses in terms seven and eight are typically not taken at a later stage, as indicated in Sect. 5.2 through the data analysis. Even if this were to occur, no conflicts would arise. Indeed, our approach plans all courses of terms seven and eight conflict-free. Thus, also a subset of displaced courses taken in a hypothetical 9th or 10th term is a fortiori conflict-free.

To connect the course supply with demand, every quantum \(i \in I\) with term \(t_i\) is assigned a set of courses \(C_i\) that the planning tool selects to be completed in the upcoming term. These courses are taken from the so-called relevant courses \(\bar{C}_i \subset (C_r(t_i) \cup C_d(t_i))\). This set \(\bar{C}_i\) consists of all courses, which—given quantum i assumed term \(t_i\) and combination of subjects—need to be completed by i according to the curriculum.

The quantum capacity of any course c denoted by qc(c) is given by

$$\begin{aligned} qc(c):= g(c) \cdot cap(c) / \Delta \end{aligned}$$

and represents the number of student quanta that can attend course c over all parallel groups.

Algorithm 1
figure a

Generation of courses \(C_i\) for quantum \(i \in I\)

The generation of the quanta’s course sets is described in Algorithm 1. Starting with the highest term t (i.e. \(t=8\)) for each student quantum i, at first all displaced courses \(c_d \in C_d(t)\) are assigned to \(C_i\) as long as the quantum capacity \(qc(c_d)\) of the course is not exhausted. This reflects the planning objective that displaced courses should be taken with priority to avoid further deferral.

Secondly, regular courses \(c_r \in C_r(t)\) of term t are assigned. Checking for prerequisites \(pre(c_r)\) explicitly is impossible since we are dealing with “artificial” student quanta. Clearly, by design of the curriculum no regular course in \(C_r(t)\) can be contained in \(pre(c_r)\). However, a predecessor course in \(pre(c_r)\) might be labeled as displaced and possibly be inserted in \(C_i\). It is easy to avoid adding such a course \(c_r\in C_r(t)\) (line 19). In both cases, the algorithm stops as soon as a given lower bound \(\min ECTS\) is reached for quantum i. In our setting \(\min ECTS=20\) was used.

Note that the prescribed workload for a student in a term amounts to 30 ECTS. The chosen discrepancy serves as slack for the matching of real enrolled students in Stage 3, when a difference between quanta’s course lists and the actual requirements of real students seems inevitable. This also helps to reach feasibility. Moreover, the university administration would like to keep some degree of freedom for the students to select additional courses on their own, thus making it easier to accept a centralized course assignment regime.

From a different angle, this slack also reflects the special situation of main courses MC which are not considered in \(C_i\). These main courses are seen as crucial parts of each subject and therefore should be available for every student without collisions in the respective term. Thus, we will not consider their ECTS in the workload of the current term (although it would be easy to do so). However, we define \(MC_i\) as the set of main courses that belong to the term that student quantum i is assumed to be enrolled in according to her/his accomplished ECTS (for the two subjects chosen by i).

It is important to note that main courses are designed without mandatory attendance requirements, leading to a situation where the exam can be taken anytime after the course without the need of attending it a second time. Based on experience, it is reasonable to assert that once students have attended a main course, typically occurring within the prescribed term, they do not tend to retake it but rather prioritise individual exam preparation. Thus an overlap of delayed main courses with regular courses will not occur. Table 1 presents the distribution of ECTS for main courses across subjects and terms using the university’s subject ID (see Table 2b for the corresponding program names), offering insight into the appropriateness of setting the slack size at 10 ECTS. This table highlights the rationale behind this choice by demonstrating how the allocation aligns with the distribution of ECTS credits.

Table 1 Amount of ECTS per subject and term

4.2.2 Generating the timetable by an ILP model

The optimization in essence seeks to assign all sections \(g \in G(c)\) of all standard courses \(c \in C\) to the time periods \(p \in P\) of a recurring working week. Like for many timetabling problems, the main goal of the planning task is reaching a feasible solution, while the actual objective function is of secondary importance. In fact, the given planning problem will hardly ever permit a feasible solution. We will discuss in Sect. 4.2.3 how to deal with infeasibility.

The university administration as the originator of our optimization problem did not specify a particular goal or quality criterion for the timetable. Discussions with student representatives and lectures exhibited clear preferences not dissimilar from goals observed in classical university timetabling tasks. The problem description of the International Timetable Competition for example (cf. Müller et al. 2018) lists—modeled as distribution constraints—amongst others the consideration of breaks between courses or the length of blocks of courses for students. Our objective function consists of two parts: The first part aims at avoiding pairs of lectures with long breaks in between for a student quantum. Considering travel times and missing facilities for spending free time on campus this represents the desire of having courses in a single time block. The second part takes into account pedagogical as well as group dynamic aspects. It considers each session of a course and aims at minimizing the number of different secondary subjects followed by the student quanta of this session. Indeed, it would often be preferred to have a more homogeneous student body in a lecture, possibly all enrolled in the same or only two different other subjects (besides the subject of the course).

For the timetable optimization problem we introduce the following ILP model. The main decision variable is \(y_{cgp}\), with \(y_{cgp}=1\) if section \(g \in G(c)\) of course \(c\in C\) is assigned to \(p \in P\), and 0 otherwise. Likewise a student quantum \(i \in I\) is assigned to a section g of one of its compulsory courses \(c \in C_i\) if variable \(x_{icg}=1\), analogously for main courses \(c \in MC_i\) with \(g(c)=1\). In addition, we will introduce two sets of auxiliary variables for the two parts of the objective function. For every quantum \(i \in I\) and time period \(p\in P\) variables \(v_{ip}\) express the continuity of assigned time slots for quantum i. Variables \(d_{cgf}\) measure the heterogeneity of the quanta assigned to a section g, of course, \(c \in C\). Summarizing, the model’s input consists of the following:

  • A set of student quanta I and quantum size \(\Delta\) (students per quantum),

  • Overall available time periods P,

  • All first and last time periods of a day \(FP, \; LP \subset P\),

  • Standard courses \(c \in C\) with capacities cap(c) and set of parallel sections G(c),

  • Main courses MC with fixed time period p(c) for every \(c\in MC\),

  • For each quantum \(i \in I\) the two subjects \(f_1(i)\), \(f_2(i)\), and the required courses \(C_i \subseteq C\) and \(MC_i \subseteq MC\)

  • Set of lecturers L and the courses \(MC_{\text{ lec }}(l)\cup C_{\text{ lec }}(l)\) taught by each lecturer \(l\in L\)

  • Subjects F, subject \(f(c) \in F\) of course c

  • Threshold \(\Pi\) limiting the number of sections taking place at the same time period

Additionally, the coefficients \(\alpha\), \(\beta\), and \(\gamma\) in the three-fold objective function enable a linear combination of the three components, and their selection should be a collaborative effort involving the decision-makers.

The model is defined as follows:

$$\begin{aligned}&\text {min}\,\alpha \cdot \sum _{p \in P}\sum _{i\in I} v_{ip} + \beta \cdot {\sum _{f \in F}\sum _{c\in C}\sum _{g=1}^{G(c)} d_{cgf} + \gamma \cdot \Pi } \end{aligned}$$
(2a)
$$\begin{aligned}&\text {s.t.}\,\sum _{g=1}^{G(c)}x_{icg} = 1, \quad \forall i \in I, c \in C_i \; \cup \; MC_i \end{aligned}$$
(2b)
$$\begin{aligned}&\sum _{p \in P}y_{cgp} \le 1, \quad \forall c \in C \cup MC, \; g \in \{1, \ldots , G(c)\} \end{aligned}$$
(2c)
$$\begin{aligned}&y_{c\, 1\, p(c)} = 1, \quad \forall c \in MC \end{aligned}$$
(2d)
$$\begin{aligned}&\sum _{\begin{array}{c} c \in C_{\text{ lec }}(l) \\ \cup MC_{\text{ lec }}(l) \end{array}}\sum _{g=1}^{G(c)}y_{cgp} \le 1, \quad \forall l \in L, \; p \in P \end{aligned}$$
(2e)
$$\begin{aligned}&\sum _{i \in I} x_{icg} \cdot \Delta \le cap(c), \; \forall c \in C, \; g \in \{1, \ldots , G(c)\} \end{aligned}$$
(2f)
$$\begin{aligned}&x_{ic'g_{1}}+x_{ic''g_{2}} +y_{c'g_1p} +y_{c''g_2p} \le 3 \quad \forall i\in I, \; c' \ne c'' \in C_i \; \cup MC_i\nonumber \\&\quad p \in P, \; g_1 \in \{1, \ldots , G(c')\}, \; g_2 \in \{1, \ldots , G(c'')\} \end{aligned}$$
(2g)
$$\begin{aligned}&\sum _{g=1}^{G(c)}\sum _{c \in C_i \cup MC_i} (y_{cgp} -y_{cg(p-1)}-y_{cg(p+1)})\le v_{ip} \quad \forall i \in I \nonumber \\&\quad p \in P - \{FP \cup LP\} \end{aligned}$$
(2h)
$$\begin{aligned}&\sum _{g=1}^{G(c)}\sum _{c \in C_i \cup MC_i} (y_{cgp} -y_{cg(p+1)})\le v_{ip}\quad \forall i \in I, p \in FP \end{aligned}$$
(2i)
$$\begin{aligned}&\sum _{g=1}^{G(c)}\sum _{c \in C_i \cup MC_i}(y_{cgp} -y_{cg(p-1)})\le v_{ip}\quad \forall i \in I, p \in LP \end{aligned}$$
(2j)
$$\begin{aligned}&\sum _{g=1}^{G(c)}y_{cgp} \le \Pi \quad \forall p \in P, \; c \in C \cup MC \end{aligned}$$
(2k)
$$\begin{aligned}&\sum _{\begin{array}{c} \{i \; \in \; I \; : \\ \; f_1(i) = f \; \vee f_2(i) = f \; \} \end{array}}x_{icg} \le d_{cgf} \cdot \Bigg \lceil \frac{cap(c)}{\Delta } \Bigg \rceil \; \forall c \in C, g \in \{1, \ldots , G(c)\} \nonumber \\&\quad f \in F - \{f(c)\} \end{aligned}$$
(2l)
$$\begin{aligned}&x_{icg}, y_{cgp} \in \{0,1\} \end{aligned}$$
(2m)
$$\begin{aligned}&v_{ip}, d_{cgf}, \Pi \in \mathbb {N} \end{aligned}$$
(2n)

As described above the objective (2a) is threefold: (A) minimizing individual timetable compactness via minimizing the sum of auxiliary variables \(v_{ip}\), which counts the number of free periods in-between assigned lectures for each student quantum. (B) The auxiliary variable \(d_{cgf}\) represents the overall number of second subjects (curricula) in a section of a standard course c. Minimizing overall \(d_{cgf}\) results in a higher homogeneity of student quanta per section, which should be didactically advantageous since course contents could be brought into line with the second subject. (C) Although collision avoidance can be expected to imply a certain spread of sections over the weekly time grid, it appears necessary to minimize the maximum number of lectures \(\Pi\) taking place at the same time period p, since rooms are not explicitly considered in the model. The more evenly sections are distributed over the week, the easier it will be to find rooms, whose number is naturally restricted.

Constraint (2b) ensures that student quantum i is assigned precisely once to a section of a required course c. Via constraint (2c) sections and main courses can take place at most once (if the planning of the number of sections is fairly reliable, (2c) can be written with equality). However, some slots are already taken by the main courses (with one section, \(g=1\)) as assigned in the preceding Stage 1 (2d). Constraint (2e) avoids that two sections (or main courses) given by lecturer l are assigned to the same period. Given the quantum size \(\Delta\), constraint (2f) ensures that the capacities of the standard courses C are not exceeded. Constraint (2g) essentially avoids collisions: Whenever a student quantum i is assigned both to a section \(g_1\), of course, \(c'\) and \(g_2\), of course, \(c''\), these cannot take place in the same time period p. If they do, the student cannot be assigned to both of them.

Constraint (2h) is used to activate the auxiliary variable \(v_{ip}\): For all time periods, except those at the beginning and the end of each working day (sets FP and LP), it is verified whether the preceding and following time slot is also taken by a section that student quantum i has to follow. If not, then there exists an isolated lecture for student i at time period p and \(v_{ip}\) is forced to 1. Constraints (2i) and (2j) account for isolated lectures at the end and the beginning of the day. Constraint (2k) is linking variable \(\Pi\) used in the objective function, to capture the overall maximum of sections and main courses that may take place at the same time period p. Constraint (2l) finally adjusts the auxiliary variable \(d_{cgf}\), which is used in the objective function to reduce the number of different second subjects of quanta in the same section. For all sections, the enrolled subjects of assigned students are compared to all curricula (except the one the course belongs to) and counted.

Computational insights for the solution of Stage 2 will be given in Sect. 6.2.

4.2.3 Dealing with infeasibility

As the number of subjects and subject combinations increases, each of the two stages of the planning problem becomes infeasible. A first diagnosis reveals that while in Stage 1 an overlap can simply not be avoided because of constraint (1c), in Stage 2 the computed irreducible inconsistent subset contains conflicts that belong to constraints (2c) and (2f). This means that either

  • The capacity cap(c) of a course does not suffice, or

  • A course would need to take place at an additional time period

to guarantee that all students (in fact, all student quanta) can have an overlap-free timetable. From an organizational point of view, the latter is equivalent to an additional section. To deal with the inevitable infeasibility, we modify the affected constraints and introduce elastic variables as outlined before in Sect. 2. For the timetabling sectioning in Stage 2, we introduce elastic variables for additional slot availability \(e^{\textit{(mult)}}_{cg}\) of each course and section as well as two elastic variables \(e^{\textit{(cap)}}_{cg}\) and \(\hat{e}^{\textit{(cap)}}_{cg}\) for additional capacity of the sections, depending on the magnitude of overrun. The modified constraints are as follows:

$$\begin{aligned} \sum _{i \in I} x_{icg} \cdot \Delta - {e^{\textit{(cap)}}_{cg}} - {\hat{e}^{\textit{(cap)}}_{cg}}&\le cap(c), \; \forall c \in C, \; g \in \{1, \ldots , G(c)\}\\ \sum _{p \in P}y_{cgp} -{e^{\textit{(mult)}}_{cg}}&\le 1, \quad \forall c \in C \cup MC, \; g \in \{1, \ldots , G(c)\}\\ e^{\textit{(cap)}}_{cg}&\in \{0,1, \ldots ,ub_{cg}\}\\ \hat{e}^{\textit{(cap)}}_{cg}&\in \{0,1, \ldots ,\widehat{ub}_{cg}\}\\ e^{\textit{(mult)}}_{cg}&\in \mathbb {N} \end{aligned}$$

The distinction between two types of elastic variables related to the additional capacity of sections—besides varying upper bounds—becomes apparent in the corresponding modified objective function below, where the penalties for these two types of variables are different with \(\delta ^{(1)} \ll \delta ^{(2)}\). The differentiation is motivated by the fact that slight overcrowding of sections (represented by \(e^{\textit{(cap)}}_{cg}\)) as an exception—though it does not conform with the curriculum—is common practice to some extent (such as admitting three additional students to a section).

$$\begin{aligned}{} & {} \text {min} \quad \alpha \cdot \sum _{p \in P}\sum _{i\in I} v_{ip} + \beta \cdot \sum _{f \in F}\sum _{c\in C}\sum _{g=1}^{G(c)} d_{cgf} + \gamma \cdot \Pi \\{} & {} \quad + {\delta ^{(1)}} \cdot \sum _{c\in C}\sum _{g=1}^{G(c)} {e^{\textit{(cap)}}_{cg}} + {\delta ^{(2)}} \cdot \sum _{c\in C}\sum _{g=1}^{G(c)}{\hat{e}^{\textit{(cap)}}_{cg}} + {\delta ^{(3)}} \cdot \sum _{c\in C}\sum _{g=1}^{G(c)} {e^{\textit{(mult)}}_{cg}} \end{aligned}$$

The penalties are limiting the use of the elasticity in the ILP. The costly increase of the elastic variable’s values is only enforced if no solution can be found otherwise. Therefore, penalty coefficients \(\delta ^{()}\) need to be chosen appropriately in relation to the overall objective function value. Besides, it is worth mentioning, that \(e^{\textit{(cap)}}_{cg}\) and \(\hat{e}^{\textit{(cap)}}_{cg}\) will only take the values 0 or multiples of the quantum size \(\Delta\). Any value between would not contribute to feasibility but to the deterioration of the objective function instead.

For Stage 1, an analogous approach is performed for constraint (1c) with a single type of elastic variables and a corresponding penalty term added to the objective function (1a).

4.3 Stage 3: Student allocation

Recall from Sect. 3 that Stage 3 takes place several months after Stages 1 and 2, shortly before the beginning of a new term. At that time, students \(s \in S\) with their updated records of courses passed are matched to student quanta i (multiples of students) generated in Stage 2. As mentioned above the course lists of quanta \(C_i\) are estimations based on students’ data of one or two terms in the past. Consequently, discrepancies between the required courses of a student and the course list of the quantum, to which the student will be finally assigned, will be inevitable.

The matching is performed by a straightforward assignment model. Formally, we seek a maximum weight perfect matching on a complete bipartite graph. A variable \(x_{si}\) is associated with each assignment, such that \(x_{si}=1\) if and only if student s is assigned to quantum i, and 0 otherwise. Naturally, the complete bipartite graph is thinned out considerably as students will be only allocated courses in \(C_s \cap C_i\). The weight \(w_{si}\) in the objective function (3a) represents the degree of fit and is defined as the sum of the courses’ ECTS in the intersection of the quanta’s and the actual students’ course set, \(w_{si}:= ECTS(C_s \cap C_i)\). The obvious restriction of matching at most \(\Delta\) students to one quantum is realized by constraints (3c).

$$\begin{aligned}&\text {max}\,\sum _{s\in S}\sum _{i \in I}w_{si}x_{si} \end{aligned}$$
(3a)
$$\begin{aligned}&\text {s.t.}\,\sum _{i\in I}x_{si} =1, \quad \forall s \in S \end{aligned}$$
(3b)
$$\begin{aligned}&\sum _{s\in S}x_{si} \le \Delta , \quad \forall i \in I \end{aligned}$$
(3c)
$$\begin{aligned}&x_{si} \ge 0 \end{aligned}$$
(3d)

It is well known that the above mathematical program has a totally unimodular system matrix and thus can be solved as a linear program, where the integrality of \(x_{si}\) is given by default.

For ease of computation, we will apply the optimization model repeatedly on smaller parts of the data, since only matchings of students and quanta belonging to the same subject combination make sense. Therefore input data \(S_{\{f_1,f_2\}}\) and \(I_{\{f_1,f_2\}}\) is divided accordingly as well as the corresponding weight matrices \(W_{\{f_1,f_2\}}\).

4.3.1 Introducing minimal course assignments

It turned out in computational experiments (see Sect. 6.2) that the maximization of the weighted sum of assigned courses through (3a) leaves a significant number of students either with a very small number of courses or even without any course assigned at all. Clearly, this is not a welcome output of the planning process. Although the allocation of residual course places described in Sect. 4.3.2 may improve the outcome for some of these students, there is no guarantee at all on the effect of that step. Therefore, we added a lower bound \(\tau \in \mathbb {N}\) in the above model guaranteeing students a minimal load of courses (in ECTS credits). If the lower bound assumes a non-trivial value, infeasibility will immediately occur. Thus, we added the option to exempt a limited number of students from this bound. Formally, in (4) we introduce a binary variable \(b_s\) for every student \(s\in S\), where \(b_s=1\) means that the lower bound does not apply for student s. Note that in most cases, such a student would still be assigned some courses, but with a workload less than \(\tau\). To limit the number of students missing the lower bound \(\tau\), we bound their number by B in (5). Instead of checking out various constant values for this upper bound, we decided to model B as a variable and adding it to the objective function (3a) with a negative penalty weight.

$$\begin{aligned} \sum _{i \in I}w_{si}x_{si}&\ge \tau \cdot (1-b_s) \quad \forall s \in S \end{aligned}$$
(4)
$$\begin{aligned} \sum _{s \in S}b_{s}&\le B \end{aligned}$$
(5)
$$\begin{aligned} b_{s}&\in \{0,1\} \end{aligned}$$
(6)

The choice of \(\tau\) remains a relevant question. Taking an ambitious value, such as \(\min ECTS=20\), will entail a very high value of B, i.e. an unacceptably large number of students missing this bound. This would reduce the whole process to absurdity. It should also be kept in mind that a larger value of \(\tau\) may incur a disproportionate loss of objective function value (3a), i.e. other students are assigned to less suitable quanta. To gain some insight to this question we iterate over increasing values of \(\tau =0,1,2,\ldots\) and consider the corresponding loss in overall assigned ECTS credits (resembling the “total utility” of the allocation) as well as the (necessarily increasing) value of B. The results of the corresponding computations will be given in Sect. 6.3.

To tackle infeasibility also from a different angle, we can again employ elastic variables. In constraint (3c) we introduce \({e_{i}^{(quant)}}\), which allow to assign more than \(\Delta\) students to a quantum of students.

$$\begin{aligned} \sum _{s\in S}x_{si} - {e_{i}^{(quant)}}&\le \Delta ,\quad \forall i \in I \end{aligned}$$
(7)
$$\begin{aligned} {e_{i}^{(quant)}}&\in \{0,1, \ldots ,ub_{quant}\} \end{aligned}$$
(8)

Since quanta are linked to courses and their capacities, an overfilling of quanta by a positive value of \(e_{i}^{(quant)}\) possibly, but not necessarily, results in overcrowding of some sections. On first sight, this may seem highly unwelcome. However, it should be noted that quanta are generated by rounding up the actual number of students for a certain subject and term configuration. Moreover, it can be expected in practice that not all students will really follow the courses assigned to them by the planning system. Thus, a certain “overbooking” of sections seems to be acceptable. In any case, the upper bound \(ub_{quant}\) should be kept at a moderate level with \(ub_{quant} \le \Delta\) as a recommended limit.

4.3.2 Allocating residual course places

Recalling that the set of courses \(C_i\) assigned to a quantum i is usually just above the threshold of \(\min ECTS=20\), and that possibly not all these courses are relevant for a student s matched to quantum i, it can be expected that a sizable number of course places remain accessible after the above assignment process. These places will be allocated by a Round Robin procedure to students with less than \(\min ECTS\) assigned courses.

In this postprocessing step students are sorted as follows: To facilitate timely graduation, at first, all students requiring at most 30 ECTS for completing their program (not counting the courses allocated in the assignment of Stage 3) are selected and sorted in increasing order of missing ECTS. All other students are appended to this sequence and sorted in increasing order of ECTS received in the above Stage 3, which reflects a maximum fairness criterion.

Considering students in this order, we take the first student and assign her/him a section of a course that: is not fully booked, is feasible for the student w.r.t. the study program, and does not overlap with any previously allocated courses. Among these, a course is randomly selected from those which are prescribed for the earliest term. If no allocation is possible, the student is removed from the sequence, otherwise, the student is reinserted into the sequence at a later position according to the sorting criteria. One can also choose to remove students (except those close to graduation) from the sequence once their workload exceeds some limit of ECTS set by the university administration.

5 Data inspection

5.1 General information

We applied our model to those courses at the University of Graz, which form the curriculum of the teacher education study program. As summarized in Table 2a, the supply side consists of 1905 different sections belonging to 767 courses and we seek to assign 501 quanta to them. The courses belong to one of 8 subjects constituting more than half of all students enrolled in teacher education. It should be noted that about 10 of the 28 subjects are niche programs chosen only by a very small number of students. It does not make sense to explicitly include the courses of these subjects in the timetable optimization, as the lecturers of these courses are used to flexibly adapt their time slots to the students’ needs. From the perspective of academic discipline, the base case comprises the most attended subjects of sciences and humanities in teachers’ education. For the sake of legibility, we use the university’s study program ID for each of the subjects listed in Table 2b, that is also providing the university’s traditional classification to sciences and humanities.

Table 2 Information about the base case of the study

As stated, the curriculum requires the choice of two out of 28 possible different subjects. Notice that the choice of subject pairs is not at all evenly distributed when analyzing all possible combinations as depicted in Fig. 1a, but also when considering only the most prominent ones as the heat-map in Fig. 1b illustrates. On the contrary, all combinations of the most prominent eight subjects collectively encompass over \(50\%\) of the total enrolled and active student population, amounting to 3616 students. The observed disparity to the total enrolment figure of approximately 4200 (as indicated in Sect. 3) and before mentioned student count results from a significant number of inactive students that have not completed any course so far. We intentionally neglected this group in our planning procedure, since their involvement is unlikely and an allocation of resources does not seem justified.

Fig. 1
figure 1

Information about the distribution of students in \(\{f_1,f_2\}\)

The resulting figure then has been set as the base case for our study, with additional subjects being added incrementally. To clarify further: the base case includes only active students who are enrolled in two out of the eight subjects under consideration. The quantitative impact of incorporating students subscribed to only one (rather than two) of the studied subjects can be taken from Table 3. The ramifications of this inclusion (as well as the enlargement of the scope) on the computational outcomes are expounded in Sect. 6.4.

Table 3 Adding an arbitrary subject x to subjects of the base case

We consider student quanta of a non-reducible size and since the number of students actually enrolled in a specific subject combination and term is not necessarily a multiple of \(\Delta\), the quanta are not entirely occupied, but represent the rounded up values. In fact, relating the considered students to the number of quanta multiplied with the quantum size \(\Delta\), the base scenario comprises a quanta utilization share of approximately 83%.

5.2 Student quanta

The quanta are established using historical anonymized examination data of all students enrolled in the study program, whereas courses and number of sections are taken from a different source representing the curricula. As described in Sect. 4.2.1 the quanta represent the prospective student demand based on the individual accumulated ECTS credits of the students. Based on the typical workload of a term (30 ECTS), we observe a distribution among the terms, as depicted in Table 4 and Fig. 2. The seemingly low numbers for terms 7 and 8 are a result of specific requirements with high ECTS credits, such as practice-teaching in schools and the bachelor thesis, which are only recorded upon completing the study. Thus, students lag behind a bit in their ECTS count in the last two terms. Furthermore, the notable decrease in terms 2, 4, 6 (and also 8) can be attributed to the timing of data acquisition, which occurred right after the conclusion of the winter term.

Table 4 Distribution among terms
Fig. 2
figure 2

Histogram of accumulated ECTS. The bins are colored according to the estimated study term they correspond to

Clearly, the amount of students is higher in earlier terms and declining, so a continuous throughput and attendance of courses precisely according to the curriculum appears to be a misconception. The examination data further serves as the basis for the derivation of the delay factor of a course (also outlined in Sect. 4.2.1). Fig. 3a depicts the distribution of delayed courses based on ECTS (not weekly hours) using a threshold of \(T=30\). The histogram illustrates the percentage of courses with specific amounts of displacement, indicating how many courses are taken late by a certain proportion of students. The results indicate that 36% of courses are taken within the prescribed term (first bin). However, the majority, comprising over 60% of courses, are completed late, with five courses being postponed by all students. Consequently, taking into account delayed courses \(C_d\) reflects actual student behavior in reality. The surprisingly high fraction of delayed courses indicates that (i) overlaps of courses may indeed be a reason for slowed-down progress (as often claimed by students, but sometimes questioned by other involved persons) and (ii) an optimized timetable should take the delay of courses into account for increasing study performance.

Fig. 3
figure 3

Delay information derived from examination data

Examining the share of delayed courses (see Fig. 3b) we see that lateness (according to the definition in this work) is not uniformly distributed, but on the contrary depends on the term and subject. Notably, the highest concentration of courses passed late is observed between the second and the fourth term. As anticipated, during the last two terms of the study program, no courses are postponed at all. It is crucial to recall our definition of the relative delay measure, which is based on the ECTS sum of preponed courses (refer to Sect. 4.2.1). Consequently, it becomes evident that lateness in term 8 is unfeasible, while in term 7 (same year) it is highly unlikely. Moreover, the average fraction of delayed courses among all terms is clearly higher in humanities than in sciences (e.g. English with 14% of overall delay compared to Mathematics with roughly 5%).

6 Computational results

We conducted tests for the three stages of our planning tool on a standard PC with processor Intel Core i5-9500 with 3.00GHz and 32GB RAM. The data processing and preparatory computation steps as well as the mathematical models have been implemented in Python (version 3.10.6) and the latter solved using the Gurobi solver (version 9.5.2). The following observations and subsequent analysis are related to the base case as defined above; effects induced by any extensions of the scope are outlined in Sect. 6.4. Stage 1 can be solved to optimality. From a computational point of view, Stage 2 poses the major obstacle, and given the scope of the base case we seek to solve a problem comprising 1,059,717 ILP variables (where 1,038,650 are binary). After the commonly applied CPU-time limit of one hour, the best solution with a gap of 0.33% to the dual bound was found. This is quite a remarkable performance. We also tried to continue the computation and reached a gap of 0.17% after 75 min with no further improvements thereafter. Concerning optimality, it has to be pointed out that our objective function is not a definite and critical expression, but rather a weighted combination of three desired features. Therefore, a moderate deviation will hardly matter in practice, whereas feasibility is the most important issue. In Stage 3 each of the integer linear programs could be solved to optimality and the computation time of each was less than 3 min, with the computation of the weights amounting to roughly one additional minute. In conclusion, we can add that running times are not a crucial issue for our planning problem, since the task has to be performed only once a year and thus several hours of computing time would be well acceptable. However, a planner might want to change some parameters and run the model several times, which again makes more reasonable running times desirable.

6.1 Results for stage 1

Results of the alignment to the time grid are listed in Table 5. The computation took less than five minutes of CPU time. It turned out that in the winter and summer semesters 39.2 and 46.3%, respectively, of all main lectures had to be adjusted. The average adjustment over all courses that had to be moved, has been lower in winter term. Notably, 23 main lectures that already followed the time grid needed to be adjusted in order to avoid overlaps. The solution does not require a transfer of a lecture to another working day. Furthermore, the amount of rescheduled lectures varies substantially for different terms as depicted in Fig. 4a.

Table 5 Results of main lecture adjustments

The remarkably low average adjustment in the seventh term is also influenced by the relatively low number of main courses taking place in this term (see Fig. 4b).

Fig. 4
figure 4

Information about the distribution of main courses for each term

It should be noted that Stage 1 is relevant mostly for the introductory year of the new planning tool, or when additional subjects are integrated into the planning process. Once all main courses are aligned with the time grid, Stage 1 will be used only for assigning new main courses and for handling exceptions such as enforced changes.

6.2 Results for stage 2

For the objective function of the timetabling stage, we chose the weighting factors \(\alpha =\beta =\gamma =1\), although this setting will be subject to changes by the final decision maker and will be related to the priorities of the different stakeholders (e.g., lectures, students). Table 6 provides an overview of the distribution of regular (\(C_r\)) and displaced (\(C_d\)) courses among the terms. Values in bold indicate that some courses are entirely postponed by all students such that the amount of regular courses is smaller than the curriculum would determine.

Table 6 Distribution of \(C_r\) and \(C_d\) among terms

Initially, a feasibility check concerning the overall section capacities is carried out. Based on the provided data, we compare for each course the number of available places with the required places resulting from the given number of students for each term and subject combination such that if for \(c \in C\)

$$G(c) \cdot cap(c) < \sum\limits_{\begin{subarray}{l} i \in I: \\ \;\;\;\,c \in C_{i} \end{subarray} } {i \cdot \Delta }$$

a shortfall for the respective course c exists and additional sections are introduced so that at least a general coverage is possible—without considering conflict freeness.

The first two stages are considered to be the essential part, since the final output, and the timetable’s applicability respectively is largely based on the quality reached in Stage 2, building upon the output of Stage 1.

Examining the objective function value of the base case we observe that the solution comprises an amount of 1180 isolated lectures (\(v_{ip}\)), an overall of 1640 additional subjects in the courses (\(d_{cgf}\)), and a maximum of 24 courses per time slot (\(\Pi\)). While the last number is rather self-explanatory, the first two figures are not insightful themselves but can be analyzed using the distributions of the summed variable values as depicted in Fig. 5.

Fig. 5
figure 5

Information about the values of the objective function variables

The number of isolated lectures arising in the individual timetable of a quantum can be analyzed with respect to the term of the quantum, see Fig. 5a. While the figures may initially imply more inconvenient timetables during the middle of the students’ studies, a different perspective emerges when scaling the data with the number of quanta in each term \(\frac{|I|_t}{|I|}\). The most inconvenient schedules actually arise at the beginning of the students’ academic journey, with progressively more pleasant timetables observed in the later terms. This pattern can be attributed to the reduced number of prescribed courses towards the end of the study program, offering greater flexibility and accommodating a more favorable timetable from this perspective.

The second component of the objective function aimed to minimize the diversity of second subjects within each course section. As evident in Fig. 5b, the solution demonstrates that for the majority of sections (over 60%), homogeneity is achieved, meaning that a section includes only one type of subject combination \(\{f_1, f_2\}\). However, it is worth noting that there are some sections where all seven possible second subjects are represented.

The test case concerning the scope in Table 2a can be solved to optimality in a surprisingly short running time despite the considerable size of the ILP model. Extending the scope, however, to a larger set of subject combinations may result in infeasibility of the problem—even with the addition of just one single subject (i.e. with all the associated pairs of subjects). An obvious reason for this behavior is that the amount of enrolled students and the course structure is subject-related.

6.3 Results for stage 3

As described in Sect. 4.3, in Stage 3 we do not only seek to optimize the allocation of students to quanta in terms of assigned ECTS credits. We additionally enforce a lower bound \(\tau\) (measured in ECTS) for each student and to avoid infeasibility we allow a certain overcrowding of quanta by means of the elastic variable \(e_i^{(quant)}\), as well as a violation of the minimal assignment bound \(\tau\) (see Sect. 4.3.1). Since the parameter \(\tau\) can be freely chosen by the decision maker we conducted tests for various values in the range of \([2,\, 22]\). Clearly, the efficacy of the outcome of Stage 3 will strongly depend on the fit between the quanta and the actual students. If more students can choose from a larger number of quanta with a high degree of fit, i.e. with high values \(w_{si}\), we can expect a better allocation. To gain insight into the distribution of the \(w_{si}\) values, we performed data aggregation and organisation, as visually presented in Fig. 6.

Fig. 6
figure 6

An aggregated and ordered version of values \(w_{si}\). Sorted quanta i are represented as rows, and students s as columns

Specifically, we calculated the average weight values \(w_{si}\) (represented in colour) for each student s (represented as a column) across all quanta i with the same subject combination in a particular term t. Each row in the figure displays these average values for a specific term t, starting from \(t=1\) in the top row and progressing down to \(t=6\) in the bottom row. To ensure a coherent representation, we arranged the students (columns) according to their respective study terms, determined based on the ECTS credits (following the procedure in Sect. 4.2.1). Consequently, the resulting block structure aligns with the natural progression of students through their curriculum.

However, the upper right corner of the figure reveals an interesting phenomenon. As the terms progress (row-wise) and the ECTS credits increase (column-wise), there is a noticeable increase in the intersection between students and quanta from earlier terms. This finding challenges the viability of a rigid structure that solely relates course requirements to a student’s actual or presumed study term. Consequently, our approach, involving a custom allocation of courses, emerges as a promising alternative to address the complexities and uncertainties presented by such a dynamic and evolving student-course interaction.

Fig. 7
figure 7

Information about filling of quanta and student sections

Analysing the allocations of students to quanta, with a particular focus on the degree of filling, we make the observation that over 70% of the quanta are fully occupied, as demonstrated in Fig. 7a. The remaining quanta exhibit a relatively even distribution in terms of their degree of filling. As a potential improvement, quanta with no assigned students could be eliminated, thereby freeing up space in the corresponding course sections they are currently assigned to. However, this action is contingent upon future extensions and considerations. Moreover, the distribution of section filling is visually presented in Fig. 7b, highlighting that a significant majority of sections are operating at full capacity. Nonetheless, a small portion of sections (approximately 2%) remain unutilized, suggesting the possibility of their elimination or rescheduling to optimize resource allocation.

Fig. 8
figure 8

Objective function value depending on the choice of minimum ECTS value \(\tau\)

Coming back to the process of varying the minimal assignment bound \(\tau\), we give a concise overview of the results in Fig. 8. It shows the objective function value (assigned ECTS without any penalty values in \(\log\)-scale), the number of students that violate the minimum assignment (\(B=\sum _{i} b_i\)), and the total number of enforced ECTS assignment (\(\tau *|S|\)). To begin with, the results show that without restriction (\(\tau =0\)) an overall assignment of 42,458.5 ECTS (which is 20.5 per student) is achieved. With increasing \(\tau\), as can be expected, we observe a decreasing objective value and simultaneously a growth in students that need to violate the lower bound to retain feasibility. The number of students that overfill quanta, i.e. the value of \(\sum _{i}e_i^{(quant)}\) (not depicted), is also increasing with increasing \(\tau\) and culminates at a fairly moderate value of 5% of all considered students. For smaller values of \(\tau\) from 2 up to 12, the decrease of the objective function (i.e., loss of assigned ECTS) is quite small (compared to the optimum for \(\tau =0\)) and the number of students B that do not meet the bound \(\tau\) remains marginal. However, increasing \(\tau\) above 14 causes a considerable drop in the objective function and a steep increase of the number of students missing the allocation of \(\tau\) ECTS. Indeed, \(B=200\)—roughly 10% of the considered amount of students—seems to be an unsatisfactory solution. On the other hand, this means that 90% of students still reach the imposed minimal allocation. In any case, a further increase of B to 400 and more indicates that the imposed lower bound does not make sense anymore. We believe that such a representation of the trade-off between guaranteed minimal allocation (a fairness criterion) and the overall allocated ECTS (an efficiency criterion) can give the decision maker valuable insights about the possibilities and limitations of the planning process.

6.4 Enlargement of scope

As delineated in Sect. 5.1, the foundational configuration of the study exclusively encompasses students who are simultaneously enrolled in both of the subjects under consideration. The incorporation of students who have subscribed to only one of these subjects significantly augments the student population (see Fig. 9), which, in turn, leads to an eventual infeasibility of the problem. As outlined in Sect. 4.2.3, we introduce elastic variables to enforce feasibility and then analyze the variation in the value of these variables. While in Stage 1 trivially an overlap cannot be avoided, the situation in Stage 2 is more complex. The penalties and additional variable upper bounds for the now elastic program are given in Table 7 below.

Fig. 9
figure 9

Computational effects of incorporation of students subscribed to only one subject of base case

Increasing the number of possible subjects—thus the number of combinations—unsurprisingly also impedes the solvability of the problem in Stage 2. An overview of the results with an increasing number of subjects and their combinations for Stage 2 is depicted in Fig. 10. We restrict ourselves to a mere increase and omit to analyze the specific sequence of adding subjects that may well have an influence. Moreover, we would like to emphasize that the assessment regarding the presence of niche programs stands regardless of any enlargement in the computation’s scope. In particular, the subjects that remain after subtracting the base case (8) and the niche programs (10) can be included for the purpose of investigating computational trends. However, it is worth noting that we opted to focus on only four of these remaining subjects. We deemed this subset to be adequate for deriving trends and insights as follows.

Generally, slight overcrowding of up to \(ub_{cg}=5\) is less punished (\(\delta ^{(1)}\)=100) than a substantial one of \(\hat{e}_{cg}^{(cap)}\) (additional overcrowding up to 20). The introduction of an additional section is costly in practice and therefore severely deteriorates the value of the objective function. Through this weighting scheme, we obtain a sequence of actions to escape infeasibility according to their impact on the curriculum structure and the real planning of the resources (e.g. teachers).

Table 7 Chosen penalty values and upper bounds for the elastic variables
Fig. 10
figure 10

Computational results of Stage 2 with an increasing number of additional subjects with respect to the base case

Fig. 11
figure 11

Aggregated values of the elastic variables \(e_{cg}^{(mult)}\) and \(\hat{e}_{cg}^{(cap)}\) (rows are subjects, columns are terms)

By introducing additional subjects the number of students and overall course section naturally increases, which means adding variables and complexity to the problem. With four additional subjects, for example, the number of variables more than doubles amounting to 2,545,649 ILP variables (2,473,177 binary). In order to analyze the elastic variables we aggregate their values for each term and subject as depicted in Fig. 11. We can observe that the necessity of additional sections (values in Fig. 11a) are clearly higher in the middle of the curriculum in terms three to five, while in later terms—influenced by fewer students—they are not relevant anymore. Moreover, there appears to be a slightly higher utilization for this elastic constraint among the subjects belonging to humanities. Notably, even substantial overcrowding of quanta does not suffice to sustain solvability, that is to provide conflict-free timetables to students, in particular subjects (e.g. 407 to 406) as can be taken from Fig. 11b.

The growth of the objective function value is not illustrated, since we believe that the values per se do not hold valuable information. Again, an analysis requires a closer look at the single variables and the abundance of values, which are exemplarily shown in Fig. 12 for the case of two subjects added to the base case. Not surprisingly the ‘homogeneity’ of course sections in regard to the occurrence of different second subjects deteriorates (e.g. roughly 60 versus 80% in the base case).

Fig. 12
figure 12

Histogram of \(\sum _f d_{cgf}\) after enlargement of the base case (8 subjects) with two additional subjects

6.5 Practical actions for dealing with infeasibility

For the practical application of our solution approach to the planning problem we would suggest five actions for dealing with the inherent infeasibility issue:

  1. (i)

    Increase the number of options by adding more sections.

  2. (ii)

    Increase the capacity cap(c) of each section of a course c.

  3. (iii)

    Restrict the optimization model to a subset of the most frequently chosen subjects (up to 8 or 10) and add less popular subjects by a manual process (which resembles in some sense the method currently in use).

  4. (iv)

    Omit pairs of subjects from consideration which are chosen by a very small number of students.

  5. (v)

    Reduce the number of ECTS for which collision-free courses are provided by the planning system for every student.

While actions (iii) and (iv) will be unavoidable and more easily accepted, there is an interesting cost/quality trade-off involved in the decision for (i) and (ii): The former causes additional costs (assuming that external lectures are available) whereas the latter comes for free but diminishes teaching quality. Thus, it will be very interesting for the decision-makers to be informed about the effect of employing certain levels of actions (i) and (ii). Action (v) is easy to implement and does not incur into any direct cost, but it compromises the original goal of this project.

It is particularly noteworthy that our ”elastic” approach provides valuable insight for the decision maker into which of the actions mentioned above is appropriate and effective. Especially the distribution of the elastic variables helps to identify subsets of subjects where certain of these actions should be applied to reach feasibility while others have no effect. As addressed in Sect. 6.4 when comparing Fig. 11a and b for some subjects an extension of the capacities of course sections is not helpful, but the costly introduction of additional sections inevitable.

7 Conclusions

In this paper, we developed a solution approach for a complex university timetabling task arising at the University of Graz, Austria. The main distinctive features of our problem are the following:

  1. (1)

    Each student is enrolled in two different subjects selected arbitrarily from a wide range of available subjects.

  2. (2)

    We proposed a systematic mechanism of handling courses taken late, which cause student’s progress to do not follow a strict term pattern and exhibit major deviations from the prescribed structure.

  3. (3)

    Timetable planning is done at an early stage when the data of actual student numbers and their progress status, as it is required for finally assigning courses to students, is still subject to major changes.

  4. (4)

    We evaluate the perceived quality of a timetable by a linear combination of three different quality measures, including also didactic considerations.

Our solution approach consists of three stages. Two of them, namely Stages 1 and 3, solve variants of the linear assignment problem, extended by conflict constraints. The main planning task (Stage 2) is performed by an intricate integer linear program (ILP). In this way, we managed to determine timetables offering conflict-free course allocations for a large part of the projected student body. Special attention is paid to issues of infeasibility.

Incorporating our optimization framework into the actual planning task at the University of Graz is planned for 2024/25. On this aim, it will also be interesting to investigate additional options for the objective function since different stakeholders have different ideas about the appropriate quality measure of a timetable. Furthermore, while the approach delineated in this paper is specifically designed to meet the dual-subject selection framework at the University of Graz, it would be interesting to explore its adaptability to alternative academic structures. For instance, such as in academic settings where students are permitted to concentrate on a single subject, as seen in the comprehensive teacher education model employed in Finland, where a more extensive lecture series supplement an in-depth study of a single subject. Similarly, in scenarios permitting the selection of three subjects, akin to the multidisciplinary approach found in the Netherlands, our approach could be analyzed for its flexibility and scalability. Notably, in Germany, both pedagogical models are accessible, with the latter often embraced as a supplementary, voluntary subject. Such an examination could offer insights into the versatility and potential modifications necessary to cater to diverse educational models.

As a limitation of our approach, we do not consider rooms, as this would have dramatic side effects on the timetables of other offered programs. Moreover, currently, rooms do not seem to be a major bottleneck of the planning task. So far we do not include special restrictions or requests expressed by the lectures. However, it would be not too difficult to add the corresponding constraints to the ILP models of Stages 1 and 2.

In the future, we could also try to rate the difficulty of the problem according to the “Complexity” as introduced in La Rosa-Rivera et al. (2021).