Skip to content
OnlyProjects
B.Sc · Information TechnologyFor educational purposes only
Code included

Automated Exam Timetabling for a Multi-Programme College: Graph Colouring versus Simulated Annealing (Python)

Conflict-free exam schedules from DSATUR and simulated annealing, measured on realistic college instances

Mapped to your syllabusUniversity of Calcutta CCF 2022 (4-year) · Research project (Hons with Research) · Semester 7–8

Overview

1 min read

Every end-semester examination, the exam section of a multi-programme college must place 40–50 courses into about 10 working days of morning and afternoon sessions so that no student faces two exams in one session, every hall fits its enrolment, and students are not ground down by back-to-back papers. Under Calcutta University's CCF, a B.Sc (Hons) student reads Major, Minor, MDC and SEC courses drawn from different departments, so the enrolment graph is dense and the schedule built by hand in a spreadsheet almost always hides clashes that surface on exam day.

This research project builds ExamTT, a Python tool that models the problem as graph colouring — courses are nodes, two courses share an edge when at least one student takes both, and sessions are colours — and measures four solution strategies on realistic instances: a random greedy baseline, Welsh–Powell, DSATUR, and simulated annealing that repairs and refines any initial schedule against a weighted cost of hard clashes and soft penalties (same-day repeats, consecutive-session clashes, rooms opened).

The contribution is an empirical comparison, not just a tool. Ten generated instances calibrated to the college's enrolment profile (3,200 enrolments, 12 halls, 2 sessions a day) are solved five times each with fixed random seeds; the study reports hard-conflict counts, soft-cost breakdowns, convergence curves and runtimes, and tests whether differences are significant. The dissertation is a defensible piece of undergraduate research: a clear problem, formal constraints, standard algorithms, honest measurement — and a tool the exam section can use.

Relevant for
West Bengal
Level
Advanced · 24 weeks · solo
Common at
University of Calcutta, University of Mumbai, University of Delhi
Updated
Nov 2026

Syllabus alignment

University of Calcutta · CCF 2022 (4-year)

Research project (Hons with Research) · Semester 7–8

Subjects this project applies
  • Python
  • Spreadsheets (SEC-1)
  • DBMS elective (instance data stored in SQLite)
How it is evaluated

See your department's project guidelines.

Also fits: Mumbai University B.Sc IT 2022-23 (autonomous-college mirror), Delhi University UGCF 2022, BCU / Bangalore University SEP 2024.

What's in the box

11 parts · 5 free · 2 previewed · 4 unlock for ₹2,000

Problem & synopsis

5 min read

Problem statement

The exam section of a multi-programme college builds the end-semester examination timetable by hand in a spreadsheet. Under CCF, each honours student combines a Major with Minor, MDC and SEC courses from other departments, so the pattern of shared students across 40+ courses is far too dense to track mentally. The consequence repeats every semester: two exams land in the same session for some students and are discovered only when admit cards are printed; large courses are given halls that cannot seat them; some students get three exams in one day while others get a week free. Fixes are ad-hoc room changes that create new clashes elsewhere.

The problem is not carelessness but complexity — the task is equivalent to graph colouring, which is NP-hard, so a human cannot verify clash-freeness for thousands of enrolments. There is a need for a measured, automated approach: a formal constraint model, algorithms with guarantees about what they optimise, and an independent validator that proves the published schedule is clash-free before it reaches students.

Synopsis

Abstract

Examination timetabling is a classic NP-hard scheduling problem, still solved manually in Indian multi-programme colleges. This project formalises the exam-timetabling problem for a college running Calcutta University's CCF curriculum, implements a graph-colouring-based solver in Python with three constructive heuristics (random greedy, Welsh–Powell, DSATUR) and one metaheuristic refinement (simulated annealing), and measures quality and runtime on ten realistic instances. The central research question is: does annealing a DSATUR seed produce significantly better schedules than constructive heuristics alone, and at what runtime cost?

Introduction

A typical CCF college examines several honours programmes at once. Every student mixes a Major with Minor, MDC and SEC courses, so the courses any two programmes share are many; a clash is easy to create and hard to spot by eye.

Existing System and Literature

  • Schedules are assembled in a spreadsheet by trial and error; clashes are found when a student's admit cards collide; the fix is an ad-hoc room change.
  • The literature treats timetabling as graph colouring since Welsh and Powell (1967); Carter and Laporte (1996) survey the field; Kirkpatrick et al. (1983) introduced simulated annealing, now a standard refinement method.
  • Published work benchmarks mostly on international datasets (Toronto, ITC). This project generates instances calibrated to an Indian multi-programme college under CCF, where cross-programme enrolments dominate — a stated gap.

Problem Formalisation

  • Hard constraints: (H1) no student has two exams in one session; (H2) every course is scheduled exactly once; (H3) per-session seating demand never exceeds hall capacity; violating any makes a schedule infeasible.
  • Soft constraints (penalised): (S1) a student with two exams on one day; (S2) exams in consecutive sessions; (S3) each hall opened beyond the minimum.
  • Decision variables: each course is assigned one of 20 sessions (10 days × 2) plus a seat allocation across 12 halls.

Proposed System

  1. An instance builder: course, student and enrolment tables in SQLite, importable from the spreadsheets the office already keeps, plus a generator producing ten instances with realistic density.
  2. A conflict-graph builder in NetworkX over enrolments.
  3. Four solvers: random first-fit; Welsh–Powell (descending degree); DSATUR (saturation-largest-first); and simulated annealing with relocate/swap moves and geometric cooling, seeded from the best constructive solution.
  4. An independent validator that re-checks H1–H3 for every output, a metrics module that decomposes cost into hard and soft parts, and matplotlib convergence curves.
  5. An experiment runner: 10 instances × 5 seeds per algorithm, analysed in pandas with mean ± standard deviation and a Wilcoxon test.

Feasibility Study

  • Technical: the pipeline runs on a standard i5 laptop; the largest instance (45 courses, 3,200 enrolments) solves in minutes. NetworkX, pandas and matplotlib are stable, documented libraries.
  • Economic: zero licence cost; no special hardware.
  • Operational: the office's existing spreadsheets are the only input format required.
  • Research feasibility: the algorithms are standard; the novelty — the CCF-specific instance model and the measured comparison — is achievable by one student in two semesters.

Objectives

  1. 01Formalise CCF exam timetabling as a constrained graph-colouring problem with three hard constraints and three penalised soft constraints.
  2. 02Build an instance model in SQLite plus a parameterised generator producing ten instances calibrated to a real multi-programme enrolment profile.
  3. 03Implement four solvers in Python: random greedy baseline, Welsh–Powell, DSATUR (via NetworkX) and simulated annealing with relocate/swap neighbourhoods.
  4. 04Implement an independent validator that proves every schedule satisfies the hard constraints before it is reported.
  5. 05Measure solution quality (hard conflicts, soft-cost breakdown), runtime and convergence behaviour across 10 instances × 5 seeds per algorithm.
  6. 06Statistically compare the best constructive heuristic with the annealed schedules using the Wilcoxon signed-rank test.
  7. 07Release the pipeline (solver, validator, experiment runner) as reproducible, seed-controlled Python with a pytest suite.

Scope

In scope

  • End-semester examination timetabling only (not class timetables or invigilation duty rosters).
  • Instances of 30–50 courses, up to ~3,200 enrolments, 10 days × 2 sessions, up to 12 halls; one exam per course.
  • Four named algorithms; costs and cooling parameters fixed by a documented tuning pass.
  • Deterministic, seeded experiments with reported distributions; results analysed in pandas and reported as tables and convergence plots.

Out of scope

  • Room-by-person invigilation allocation, hall split of a single course across buildings (demand is summed per session), and mid-term/continuous-assessment scheduling.
  • Exact methods (integer programming, CP-SAT) as full solvers — mentioned in the dissertation as the natural next step.
  • A web or GUI interface; the tool is a documented command-line pipeline.
  • Real personal data: the college dataset is anonymised to enrolment counts per course pair; no student names or roll numbers are stored.

Methodology

Research design: a computational-experiment (algorithmic empirical) study. The independent variable is the algorithm (4 levels); dependent variables are hard-conflict count, soft cost, runtime and iterations to convergence; controlled variables are the instance set and random seeds. Every number in the dissertation is reproducible from a single run_experiments.sh invocation with fixed seeds.

PhaseWeeks (24 total)ActivitiesDeliverable
Literature review1–3Timetabling-as-colouring, Carter & Laporte survey, SA basics; write the 2-page research proposalProposal approved by supervisor
Formalisation4–5Fix H/S constraints, cost function, instance parametersProblem-definition note
Instance builder6–8SQLite schema, spreadsheet import, parameterised generator, density calibrationTen version-controlled instances
Constructive solvers9–12Random greedy, Welsh–Powell, DSATUR; validator + metrics modulesSolver v1 with tests
Annealing solver13–16SA with relocate/swap moves, T₀ and cooling tuning pass, convergence loggingSolver v2 with tuning log
Experiments17–1910 instances × 5 seeds × 4 algorithms; CSV of all runsRaw results + plots
Analysis20–21pandas summaries, Wilcoxon test, convergence readingResults chapter tables
Writing22–24Dissertation chapters, viva preparation, code cleanupFinal dissertation

Validity controls: the validator is independent of the solvers; the test suite pins known-small instances with hand-computed optima; every run logs its seed, version hash and machine time, so the comparison survives the viva question "how do you know this is not luck?"

Architecture & tech stack

3 diagrams · 7 technologies · 2 min read

  • Python 3.12
  • NetworkX
  • pandas
  • NumPy
  • matplotlib
  • SQLite
  • pytest

ExamTT is a batch pipeline of seven stages. Nothing is interactive: each stage reads files and writes files, which keeps the experiment reproducible.

  1. Instance layer — SQLite database with course, student, enrolment, hall and session tables; the generator writes instances, the importer reads the office's spreadsheets.
  2. Model layer — the conflict graph is built in NetworkX (nodes = courses, edge weight = number of shared students); sessions and hall capacities stay in plain dictionaries.
  3. Solver layer — four solvers with one common interface (solve(instance) -> Schedule); simulated annealing accepts any constructive schedule as its seed.
  4. Assurance layer — a validator that re-derives H1–H3 from the instance (never from solver state) and a metrics module that decomposes the cost into hard and soft parts.
  5. Analysis layer — pandas frames over per-run CSV logs; matplotlib convergence curves; the Wilcoxon comparison.
flowchart TD
  A["Spreadsheet import / generator"] --> B[("SQLite instance store")]
  B --> C["Conflict graph (NetworkX)"]
  C --> D1["Random greedy"]
  C --> D2["Welsh-Powell"]
  C --> D3["DSATUR"]
  D1 --> E["Simulated annealing (relocate / swap)"]
  D2 --> E
  D3 --> E
  D1 --> F["Validator + metrics"]
  D2 --> F
  D3 --> F
  E --> F
  F --> G[("Results CSV + convergence plots")]
  G --> H["pandas analysis + Wilcoxon test"]

Instance schema

erDiagram
  COURSE ||--o{ ENROLMENT : "has"
  STUDENT ||--o{ ENROLMENT : "holds"
  SESSION ||--o{ ASSIGNMENT : "receives"
  COURSE ||--o{ ASSIGNMENT : "is placed in"
  HALL ||--o{ SEAT_ALLOC : "seats"
  ASSIGNMENT ||--o{ SEAT_ALLOC : "is seated by"

  COURSE {
    string code PK
    string title
    int strength
    string programme
  }
  STUDENT {
    string anon_id PK
    string programme
  }
  ENROLMENT {
    string anon_id FK
    string code FK
  }
  SESSION {
    int id PK
    int day
    string slot
  }
  HALL {
    string name PK
    int capacity
  }

Algorithm cost function

flowchart LR
  S["Candidate schedule"] --> V{"Hard check H1-H3"}
  V -->|"violation"| P["cost = hard_penalty x violations"]
  V -->|"feasible"| Q["cost = w1 x S1 + w2 x S2 + w3 x S3"]
  P --> N["SA accepts / rejects by cost"]
  Q --> N

Modules

6 modules

  1. Module 01

    Instance Store and Generator

    SQLite schema for courses, anonymised students, enrolments, halls and sessions; a parameterised generator that varies course count (30–50), per-student course load (Major + Minor + MDC + SEC) and hall capacity to produce ten instances whose conflict-graph density matches the calibrated college profile.

  2. Module 02

    Conflict-Graph Builder

    Reads enrolments and builds an undirected weighted graph in NetworkX where nodes are courses and an edge's weight counts students shared by the two courses. Reports density, degree distribution and the clique bound used as a lower bound on sessions needed — the numbers the dissertation uses to argue the instances are non-trivial.

  3. Module 03

    Constructive Solvers

    Three one-shot colouring strategies behind a common interface: random first-fit baseline; Welsh–Powell ordering by descending degree; DSATUR via NetworkX's saturation-largest-first strategy. When colours (sessions) run out, the solver opens additional sessions on later days and records the overrun. Output is a Schedule object, never side effects.

  4. Module 04

    Simulated-Annealing Refinement

    Starts from the best constructive schedule; each step picks relocate-one-course or swap-two-courses, evaluates the weighted cost (hard penalties dominated by soft weights w1 > w2 > w3), and accepts by the Metropolis rule. Initial temperature is tuned so early acceptance is about 80%; geometric cooling α ∈ {0.95, 0.97, 0.99} was compared in the tuning pass and 0.97 chosen. Logs cost per iteration for convergence curves.

  5. Module 05

    Independent Validator and Metrics

    Re-checks H1 (per-student session clash), H2 (every course exactly once) and H3 (per-session seat demand vs hall capacity) directly from the instance and the schedule, independent of solver internals. Metrics decompose the final cost into S1 same-day repeats, S2 consecutive-session clashes and S3 halls opened, so the dissertation can say which kind of improvement annealing bought.

  6. Module 06

    Experiment Runner and Analysis

    Runs the 10 × 5 × 4 grid with fixed seeds, writing one CSV row per run (algorithm, instance, seed, hard conflicts, S1–S3, runtime, iterations). The analysis notebook produces mean ± standard-deviation tables, convergence overlays and the Wilcoxon signed-rank test between DSATUR and the annealed schedules across the ten instances.

Slides

12 slides · titles free · bullets, notes and the .pptx unlock

  1. Slide 1

    Automated Exam Timetabling: Graph Colouring versus Simulated Annealing

  2. Slide 2

    Motivation

  3. Slide 3

    Research Question and Formalisation

  4. Slide 4

    Literature Positioning

  5. Slide 5

    System Pipeline

  6. Slide 6

    The Four Algorithms

  7. Slide 7

    Experimental Design

  8. Slide 8

    Results

  9. Slide 9

    Cost Decomposition

  10. Slide 10

    Demo / Sample Schedule

  11. Slide 11

    Threats to Validity

  12. Slide 12

    Conclusion & Future Work

Bullets, speaker notes and the .pptx · ₹2,000

The titles above are the real outline. The rest is what you present from.

Unlock for ₹2,000

Viva questions & answers

3 of 16 answered free · 13 unlock

Read each answer, close it, and say it in your own words. Your viva will ask. Now you'll know.

  1. 01Concept

    Why is exam timetabling an NP-hard problem, and what does that mean practically for your project?

    Deciding whether the conflict graph can be coloured with k colours is the graph k-colouring decision problem, which is NP-complete, and exam timetabling adds capacities and soft costs on top. Practically it means no known polynomial algorithm guarantees the best schedule, so my project compares heuristics and a metaheuristic that trade optimality for tractable runtime, and measures that trade-off instead of claiming optimality.

  2. 02Concept

    Explain exactly how you map the exam problem onto graph colouring.

    Each course is a node. An undirected edge joins two courses when at least one student is enrolled in both, weighted by the number of shared students. Colouring the graph assigns courses to sessions, because a proper colouring means no edge has both ends in one session — which is exactly hard constraint H1 that no student sits two exams together. Hall capacity is a per-colour bin-packing check layered on top of the colouring.

  3. 03Concept

    What is DSATUR and why does it usually beat Welsh–Powell on your instances?

    DSATUR colours the vertex with the largest saturation degree — the number of distinct colours already used by its neighbours — breaking ties by ordinary degree, and updates saturation dynamically after each placement. On my instances it beats Welsh–Powell's static descending-degree order because the dense, irregular enrolment graph keeps changing which course is most constrained, and DSATUR adapts to that while Welsh–Powell commits to a fixed order.

+13 more questions, with answers

Try the free ones out loud first. Your examiner will not accept “it's in the PPT”.

Source code & how to run

6 steps · complete source code · unlocks with the project

Unlocks with the project · ₹2,000

6 steps · source code zip

Prerequisites, install, seed data and tests, written for demo day. Plus the complete source.

Unlock for ₹2,000

READMEFIRST

248 words · unlocks with the project

What to change before it goes anywhere near a submission. Skipping it is how the demo fails live.

Unlocks with the project · ₹2,000

248 words · ~1 min read

The checklist of things to rename, re-seed and re-think so the project reads as yours.

Unlock for ₹2,000

Instructions

419 words · unlocks with the project

How to study it, adapt it and walk your examiner through it, step by step.

Unlocks with the project · ₹2,000

419 words · ~2 min read

Report structure, formatting rules and the submission checklist your department will grade.

Unlock for ₹2,000

References

7 sources

  1. NetworkX Documentation — Graph Algorithms (greedy_color, saturation-largest-first)
  2. pandas Documentation
  3. pytest Documentation
  4. University of Calcutta — CCF 2022 Curriculum & Syllabus, Computer Science (CSR-82)
  5. D. J. A. Welsh and M. B. Powell (1967), 'An upper bound for the chromatic number of a graph and its application to timetabling problems', The Computer Journal, 10(1), 85–86
  6. S. Kirkpatrick, C. D. Gelatt and M. P. Vecchi (1983), 'Optimization by Simulated Annealing', Science, 220(4598), 671–680
  7. M. W. Carter and G. Laporte (1996), 'Recent Developments in Practical Examination Timetabling', Practice and Theory of Automated Timetabling, LNCS 1153, Springer

Cite this bundle

OnlyProjects. (2026). Automated Exam Timetabling for a Multi-Programme College: Graph Colouring versus Simulated Annealing (Python): B.Sc Information Technology project bundle [Educational resource]. https://onlyprojects.online/projects/bsc-it-exam-timetabling-colouring-vs-annealing

Future scope

1 min read

  • Tabu search and a CP-SAT (OR-Tools) exact model as a fourth and fifth solver to measure how far metaheuristics are from optimal on these instance sizes.
  • Invigilation duty allocation as a second assignment problem over the published schedule, sharing the same instance store.
  • Room-split handling for oversized courses and preferential morning slots for large-enrolment papers.
  • A small web front end for the exam section with conflict highlighting and what-if session dragging backed by the same solver.
  • Multi-objective formulation (Pareto front over S1–S3) instead of fixed weights, with an interactive weight explorer for the controller of examinations.

Keep browsing

Same degree, same syllabus slot, different idea. Pick the one your guide will actually approve.