Intelligent Exam Scheduling with Optimization: A Case from a Major U.S. University

Share this post
Manik Sharma
September 26, 2025
5 minutes

Every semester, universities have to deal with the same big problem: making a schedule for exams. At first, it seems straightforward to put tests in rooms and at certain times. But when there are hundreds of classes, thousands of students, not enough rooms, and strict rules to follow, things get very complicated very quickly.

Being OR practitioners, we tried our own way to solve this problem for a U.S. university using Google's OR-Tools, which is an open-source optimization solver. We didn't use spreadsheets or trial and error; instead, we wrote down all the university's rules as constraints, then used the solver to automatically generate a valid exam schedule.

The Rules We Had to Follow

These were the main rules that we established as constraints in the model:

  • There is only one exam per subject. There must be only one room and one time slot assigned to each exam. There are no missing or duplicate exams.
  • Tracking how rooms are used. A room assigned to an exam for a certain time slot is marked as full for that time slot.
  • Room capacity. The number of students taking an exam in a room cannot exceed the number of seats available in that room.
  • No test scheduling conflicts for any student. Two tests can't be given to the same student(s) at the same time.
  • Compatibility in the same room. Some tests can't be administered at the same time in the same room, as there are rules about supervision, noise, and special accomodations.
  • Lead time for the room. Some rooms require a break between exams to allow for mandatory events like set-up and cleaning. Once a room has hosted an exam, it can't be used again for the next L-1 time slots for a lead time of L.

Decision Variables

In our model, the solver had to decide:

  • Where and when each exam occurs: A binary variable that is assigned a value of 1 if exam i is assigned to room r  at time slot t, or 0 otherwise.
  • Whether a room is in use in a slot: A binary variable that is assigned a value of 1 if a room r is used at time slot t, and 0 if it is empty.‍

Objective Function

The model solves for the following objective:

  • Minimize the overall exam period (makespan): In simple terms, this means scheduling the exam period to end as early as possible without violating any constraint.

‍A feature of constraint programming is that if the university wants to generate a valid schedule (without worrying about compactness), we can run the model without regard for an objective funaction and find any feasible timetable in the fastest time.

Results

By turning these rules into a mathematical formulation and utilizing the Or-tools solver, we were able to generate an optimized exam schedule for the university. The model output is a binary array that represents the schedule that adheres to all of the mentioned constraints and minimizes the objective. Each exam is assigned to its own time slot, the schedule ensures that no room was too crowded, there were no conflicts between time slots, and the schedule respected lead time and room compatibility requirements. Rescheduling is now streamlined so if scheduling changes are needed, they can be immediately tested with a few clicks. It used to take days of manual work, but now exam scheduling can be performed in just a few minutes. The optimization model produced a complete exam schedule, assigning each exam to a room and a time slot while respecting all of the desired constraints. After some post-processing of the output, we can produce a final schedule to a user. Here is a subset of the final output representing the schedule of a small department within the university. Keep in mind that the exam schedule for this department was jointly scheduled with all other departments:

 Exam ID  Room ID  Slot Students
 E66  R1  1  55
 E78  R1  1  48
 E63  R2  1  104
 E80  R2  1  192
 E77  R3  1  195
 E47  R4  1  147
 E61  R5  1  199
 E25  R6  1  137
 E64  R1  2  50
 E76  R1  2  98

The complete schedule was exported to Excel, making it easy for administrators to review, share, and make updates if last-minute changes are required.

Why This Is Important

This method speeds up the scheduling process, improves student and faculty satisfaction, and makes the exam schedule more equitable for all students. Instead of spending days changing spreadsheets, the model makes a schedule that follows all the rules we impose automatically. The model also quickly rebuilds the schedule if courses or rooms change. This usecase demonstrates how optimization can help universities to make a positive impact on faculty by reducing operational friction, and on their students by improving the quality of exam schedules.

Share this post
All
optimization models
scheduling
Solver
Manik Sharma
September 26, 2025
5 minutes