Below are future plans and further ideas:
- Implementation of the problem using genetic algorithms.
- Fine-tuning solver hyperparameters to achieve better results.
Suppose an educational institute has a number of students each enrolled in certain courses. A final exam is going to be held for each course. All exams must take place within a specific time window. (i.e. one week) During these dates, there are specific valid time periods that exams can be held at. (i.e. 8 AM - 10 AM, 10 AM - 12 PM, 14 PM - 16 PM) Also, all exams must be held in available rooms which have certain capacities.
Notice
The list of students is available. In other words it is known that which student is enrolled in what courses.
Mandatory Constraints:
- Each course's exam must be held on a specific day and time period.
- Each student must have at most one exam at a single time period on a day.
- Each course's exam must be held in at least one room.
- Room capacities must be considered.
- The number of used rooms at a single time period must not exceed the total number of available rooms.
Preferred constraints: (In order of preference)
- Each student should preferably have no more than one exam in a day.
- Each student should preferably have at least one day off between their exams.
- Preferably, only one course's exam should be scheduled in each room during a given time period.
A brief summary of the model is presented below. This can be used to set up a solver environment for this problem. For detailed model description please read the documentation.
Definition | Symbol | Description |
---|---|---|
The set of courses. | ||
The set of valid days to hold the exams. | ||
The set of valid time periods in a day. | ||
The set of available rooms. | ||
The set of enrolled students. |
Binary:
Non-Negative Integer:
Attention
Non Negative Reals are used instead of Non Negative Integers for intermediate variables to enhance solver performance.
- Binary:
$\psi_{s,c,d,h}$ (In 2nd hard constraint) - Binary:
$\gamma_{s,d,h}$ (In 1st soft constraint) - Non-Negative Real:
$\lambda_{s,d,h}$ (In 1st soft constraint) - Non-Negative Real:
$\lambda_{s,d,h}^\prime$ (In 1st soft constraint) - Binary:
$\sigma_{s,d,d^\prime}$ (In 2nd soft constraint) - Non-Negative Real:
$\beta_{s,d,d^\prime}$ (In 2nd soft constraint) - Non-Negative Real:
$\beta_{s,d,d^\prime}^\prime$ (In 2nd soft constraint) - Non-Negative Real:
$\zeta_{d,h,r}$ (In 3rd soft constraint)
Note:
Extras For Modeling AccuracyBinary:
$\omega_{s,d,h}$ Binary:$\omega_{s,d,h}^\prime$
$$\lambda_{s,d,h}\leq|\mathbb{R\times C}|\cdot\omega_{s,d,h}\hspace{1cm}\forall s,d,h$$ $$\sum_{h^\prime \neq h}\lambda_{s,d,h^\prime} \leq |\mathbb{H}|\cdot|\mathbb{R\times C}|\cdot(1-\omega_{s,d,h}) \hspace{1cm}\forall s,d,h$$ $$\lambda_{s,d,h}^\prime\leq|\mathbb{R\times C}|\cdot\omega_{s,d,h}^\prime \hspace{1cm}\forall s,d,h$$ $$\sum_{h^\prime \neq h}\lambda_{s,d,h^\prime}^\prime \leq |\mathbb{H}|\cdot|\mathbb{R\times C}|\cdot(1-\omega_{s,d,h}^\prime) \hspace{1cm}\forall s,d,h$$
A sample dataset was generated to ensure all constraints (hard and soft) are being checked as well as the feasibility of the model. The data is described below.
There are 4 students and 7 courses.
Course | Student |
---|---|
|
|
|
|
|
Initially, the model was solved on the above sample dataset without the consideration of constraint 1 extras. GLPK Integer optimizer 5.0 solver was used and the time taken was 10.2 seconds. The model outputs are as follows:
Room 1 (cap=1) | Room 2(cap=2) | |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
As it can be seen, no student has more than one exam in a day, students
Then we included the constraint extras for the first hard constraint and the model performance improved significantly on the same dataset. time taken reduced to 3.8 seconds and with the search tree being remarkably smaller, memory usage improved by a factor of 3.7. The solver produced the following results.
Room 1 (cap=1) | Room 2(cap=2) | |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
This result is valid as well with minimal violations of the second and third soft constraints. Students
We tried to solve the model on a larger dataset with 12 courses, 8 students, 3 days, 2 time periods and 2 rooms and by the 100 minute mark, we achieved 85% MIP gap. However, due to single process nature of the GLPK solver, we were not able to obtain a full solution.