GenerateRandomSearch

Exam Timetable Generator

Exam timetabling has one hard rule and everything else is preference: no student may be in two places at once. That rule turns a timetable into a colouring problem, where two exams sharing even a single student cannot share a slot. This generates a cohort, works out which exams genuinely conflict, and fits them into as few slots as the greedy rule manages — then checks the result by walking every student's whole enrolment rather than trusting the construction.

What this generator does

Builds a cohort of students with course enrolments, derives which exams share a student, then assigns slots most-constrained-first so no conflicting pair collides. The finished timetable is checked student by student, not pair by pair.

How to use this tool

  1. Choose how many exams, how many students, and how many courses each takes.
  2. Generate, and read how many slots were needed.
  3. Look at which exams shared a slot — those are the ones with no student in common.
  4. Raise the courses per student to watch the slot count climb.

Understanding the controls

How many exams
Between 3 and 14 subjects. More exams need more slots only when they actually share students.
How many students
More students means more distinct course combinations, so more pairs of exams end up in conflict.
Courses each student takes
This drives the difficulty far more than the other two: every student taking one more course adds a burst of new conflicts.

Common use cases

  • Practising timetable construction with a cohort that actually clashes
  • Showing why exam scheduling is graph colouring in disguise
  • Producing a sample timetable for a planning exercise
  • Teaching the difference between a hard constraint and a preference
  • Generating test data for a scheduling tool

How this generator works

Two exams conflict when at least one student takes both, which makes the exams a graph and a slot a colour. Exams are then scheduled most-constrained-first — the one clashing with most others gets the earliest free slot — because leaving the hardest exam until last is how a timetable ends up needing an extra slot it did not need. That rule is quick and not always the fewest, so every timetable with one slot fewer is then tried, and tried again, until none works; where the search finds a shorter timetable than the rule did, that is the one shown and the notes say so. The result is verified by walking every student's own list of exams and confirming their slots are all different, which catches an error the pairwise construction could hide.

Randomness and fairness

Uses your browser's cryptographic random source to build the cohort by default. A seed reproduces the same students and the same timetable, which is deterministic and not cryptographically secure.

For how randomness is produced across the whole site, see how Generate Random works.

Limitations and good to know

  • The fewest slots is proved by trying every timetable, which is affordable only because the page stops at fourteen exams; a real cohort of sixty papers needs a method that settles for a good timetable it cannot prove is the shortest.
  • Only the clash rule is enforced — room capacity, invigilators, back-to-back exams and reading time are all real constraints this ignores.
  • Students are generated rather than imported, so this is for practice and demonstration, not for timetabling an actual cohort.
  • Every slot is treated as identical, so an exam that must be in the morning cannot be pinned.

Privacy and your data

The cohort and the timetable are generated in your browser. Neither is transmitted, and no real student data is involved at any point; what is measured is that the tool was used.