Problem
University timetables must coordinate courses, faculty, rooms, student enrollments, and time slots. Manual planning makes it difficult to track all constraints together, increasing the risk of double-booked faculty or rooms, student clashes, unsuitable room capacity, and missed faculty availability.
Objective
Automate university timetable creation, reduce the manual scheduling workload, and produce usable schedules that honor resource limits and prevent faculty, room, and student clashes.
CSP model
Each course is assigned a faculty member, day, time slot, and room. The solver rejects assignments that violate hard rules, then scores complete schedules against faculty preferences and workload goals.
Timetable generation workflow
- 01 · PrepareLoad academic dataCourses, faculty, rooms, slots, and enrollments
- 02 · PrioritizeOrder constrained coursesLabs and high-enrollment courses first when enabled
- 03 · SearchTry candidate assignmentsBacktracking rejects hard-constraint violations
- 04 · ScoreKeep the best scheduleScore complete solutions using soft preferences
- 05 · ReturnSave or explain failureReturn a timetable or diagnostics for infeasible inputs
The report documents a backtracking search with bounded attempts, best-solution tracking, and early stopping for a high-scoring complete schedule.
Solution & approach
We modeled scheduling as a CSP. Each course is assigned a feasible faculty, room, day, and time slot. Hard checks reject overlapping room or faculty assignments, student enrollment clashes (including cross-semester overlaps), unavailable faculty times, and unsuitable room or course matches. A backtracking search tries candidate schedules, prioritizes more constrained courses such as labs and high-enrollment courses, and retains the best-scoring complete solution. Faculty preferences and workload considerations contribute to schedule quality as soft constraints. Administrators manage data and generate schedules; administrators and faculty can view and export timetables.
Technology stack
Next.js · React · Tailwind CSS · Node.js · Express.js · PostgreSQL · Prisma ORM · Constraint Satisfaction Problem (CSP) · PDF and Excel export · GitHub · Vercel
Key features
- CSP-based timetable generation with backtracking search
- Hard checks for faculty, room, and enrolled-student clashes
- Faculty unavailable-day and time-slot enforcement
- Room type, capacity, and course enrollment matching
- Heuristic course ordering for more constrained courses
- Faculty preference scoring and schedule quality statistics
- Role-based administrator and faculty workflows
- Timetable viewing and PDF/Excel export
Team contributions
Screenshots and demonstration
Challenges and decisions
The central challenge was satisfying interacting constraints without allowing a locally valid assignment to create a room, faculty, or student clash elsewhere in the schedule. The solver checks conflicts during assignment, including student overlaps across semesters, and treats faculty unavailability as a hard rule. Another challenge was finding good schedules efficiently as course data changes. The implementation orders constrained courses earlier, explores alternative orderings with bounded backtracking attempts, tracks the best complete schedule, and records diagnostics when it cannot find a solution. Faculty preferences are scored as soft goals so they can improve schedule quality without overriding hard validity rules.
Results and limitations
The delivered system combines academic data management, CSP-based timetable generation, role-specific timetable access, and schedule exports. The thesis documents functional test cases for the core workflows; its PDF export test records successful exports for both administrator and faculty views and a clear error when no timetable has been generated. The report does not provide benchmark timings or quantified improvements over manual scheduling, so none are claimed here.
Lessons learned
This project showed me that a useful scheduling solver depends as much on careful constraint modeling and diagnostics as on the search algorithm itself. Hard validity rules need clear checks at assignment time, while preferences work better as scored soft constraints. Prioritizing the most constrained courses and explaining why a schedule could not be completed also makes the generator more practical to operate.