This project formulates the university classroom scheduling problem as a binary integer linear program (ILP).
The goal is to assign each course to a professor, classroom, and time slot while maximizing preference scores and satisfying operational constraints.
Creating a course schedule is a constrained optimization problem.
Each course must be assigned to:
- One qualified professor
- One available classroom
- One valid time slot
At the same time, the schedule must satisfy several constraints:
- A professor cannot teach two courses at the same time.
- A classroom cannot host two courses at the same time.
- Professor availability must be respected.
- Room availability must be respected.
- Courses should be assigned to professors who prefer to teach them.
The model converts these requirements into a mathematical optimization problem and uses an integer programming solver to find the highest-scoring feasible schedule.
For every valid combination of:
- Course
c - Professor
p - Room
r - Time slot
t
a binary variable is created:
x(c, p, r, t) = 1 if the course is assigned to that combination, and 0 otherwise.
The model maximizes:
- Professor-course preference scores
- Professor time-slot preference scores
- Minus penalties for unassigned courses
- Each course is assigned exactly once or marked unassigned.
- Professors may teach at most one course in any time slot.
- Rooms may host at most one course in any time slot.
- Only available rooms and professors are considered.
- Python
- pandas
- PuLP
- Excel
- CBC Solver
The model reads data from data.xlsx, which contains:
CoursesProfessorsRooms
The program generates Output.xlsx containing:
- Assigned courses
- Unassigned courses
It also prints:
- Total objective score
- Number of assigned courses
Result - Optimal solution found
Total Objective Score: 26.0
Courses Assigned: 3/3