Xshala All resources Talk to a consultant
Guide 9 min read

Timetabling as a constraint problem, not a spreadsheet

Rooms, faculty load, electives and lab blocks. The first ninety per cent of a timetable takes an afternoon. The last ten takes three weeks, and the reason is always the same.

Ask how the timetable gets made and you will usually be shown a grid, a colour code and a senior teacher who has done it for eleven years. The grid is a record of the answer. It is not the method. The method lives in that teacher’s head, and it is a set of constraints they apply in an order they could not write down if asked.

That matters for one practical reason. A grid cannot tell you why a slot is impossible. A constraint model can, and the difference shows up precisely at the point where every institution gets stuck: the last few classes that will not place.

Two kinds of constraint, and only one is negotiable

Everything a timetable has to respect falls into one of two buckets. Writing them into the same list is the original error, because it hides which rules you are allowed to break when the grid will not close.

Hard
Physically impossible to break
One teacher cannot be in two rooms at once One room holds one class at a time A student cannot attend two subjects in one period A lab needs the lab, and a double period Statutory contact hours must be met
Soft
Costly to break, but possible
Mathematics before lunch, not after No teacher with four consecutive periods Games last, so nobody returns sweating A subject spread across the week, not stacked Senior faculty free on their research day
Why the split is the whole technique

When a timetable will not close, you are not looking for a cleverer arrangement. You are looking for the cheapest soft constraint to break. If soft rules are recorded as if they were hard, there is nothing to trade and the search fails with no explanation, which is exactly what a spreadsheet does.

The order that finishes, and the loop that does the work
STEP 01 Immovables Assembly, lunch, games, shared external faculty STEP 02 Tightest first Labs and elective baskets, the scarcest resources STEP 03 Core subjects Daily-frequency subjects across the week STEP 04 Remainder Everything with slack, placed last Published with a diff log WHEN A CLASS WILL NOT PLACE Relax the cheapest soft constraint, then retry Report which rule was traded and what it cost. Never restart the grid by hand.

Place the tightest thing first

The instinct is to start with the biggest subject, because it has the most periods. That is backwards. Start with whatever has the fewest legal positions, because those decisions constrain everything else and you want to discover an impossibility on day one rather than on day nineteen.

In most institutions the tightest resource is not a room and not a teacher. It is the elective basket: a set of subjects that must run simultaneously so that students can choose one from each, which pins several rooms and several faculty to the same slot before anything else is decided.

{{ t.n }}

{{ t.d }}

Faculty load is a fairness problem wearing a maths costume

Two teachers can have identical period counts and wildly different weeks. Count these five things separately or the load report will be defended in every staff meeting.

Measure What it catches Ignore it and
{{ l.k }} {{ l.c }} {{ l.risk }}

The timetable is not the deliverable. Change is.

A published timetable survives about a fortnight. A teacher goes on leave, a lab floods, a section splits because admissions ran over, a guest lecture takes Thursday afternoon. The real test of a timetabling system is not the first grid. It is the two hundredth substitution.

Three things a substitution must do
Respect the same hard constraints. A substitute who is already teaching elsewhere is not a substitute. The check has to be the same one the original placement used.
Reach the people affected. Students, the substitute, the room register and the attendance sheet for that period, in one action rather than four notifications sent by hand.
Leave the original visible. Attendance and syllabus coverage are reported against the class that was planned as well as the class that happened. Overwriting the plan loses the ability to say what was missed.

This is also where syllabus coverage quietly fails. Twelve substitutions in a term look harmless on a grid and can mean one subject lost a fifth of its contact hours. Only a system that keeps plan and actual apart can tell you that before the examination.

Six questions for your current process

{{ q.t }}

If the honest answer to most of these is a person’s name rather than a rule, the timetable is a piece of institutional knowledge with one point of failure. Writing the constraints down is worth doing even if you never automate the search.

Bring last term’s timetable and the list of what broke.

A consultant separates your hard constraints from your soft ones and shows the substitution flow on your own sections.