Key takeaways
- Hard constraints define feasibility; a single violation makes the timetable unusable.
- The standard set: teacher, class, and room clashes, required lessons, unavailability, the teaching day.
- An impossible hard set should surface as infeasibility, never as a hidden violation.
- Rank rules hard, firm, or soft before telling a solver everything is mandatory.
The standard hard set
Six rules recur in almost every school timetable: no teacher clash, no class clash, no room clash, every required lesson scheduled, teacher unavailability honoured, and all activities inside the teaching day. Each one is binary. There is no such thing as a slightly double-booked teacher.
Everything else starts life as a preference. That is the working default: a rule enters the hard set only when someone can say what breaks if it is violated.
Infeasibility is the correct answer
When the hard set cannot be satisfied, the useful generator says so. An infeasibility report tells you which commitments collide; a silently bent rule tells you nothing until a teacher finds the clash in week one.
This is why hard constraints are a contract, not a wish. If you would accept the rule being broken under pressure, it was never hard. Move it to the soft set with a penalty and let it be traded openly.
Classify before you generate
The sourced practice is to rank rules hard, firm, or soft rather than declaring everything mandatory.
- List every rule anyone has asked the timetable to respect.
- Mark as hard only the rules whose violation makes the grid unusable.
- Mark as firm the rules the school would bend in a named emergency, and record who decides.
- Everything else is soft: give it a penalty weight instead of a veto.
- Check the hard set for joint impossibility before the first run.
- Revisit the classification when the school's commitments change, not mid-crisis.
How to do this in Smootables: rules the solver will not break
Period
Room A
Period
Room A
Period
Room A
Period
Room A
Period
Room A
Period
Room A
Period
Room A
Period
Room A
Period
Room A
Period
Room A
Conflicts detected
The following conflicts will occur if you proceed:
Room Lab B is already bookedChemistry practical at 13:00–14:30
The Smootables solver treats clashes and availability as hard: its first phase searches for a grid that satisfies the hard rules, and only then does a second phase improve quality. If the hard set cannot be satisfied, generation fails with a report naming the conflict causes and suggested actions, rather than returning a broken grid.
Hard availability is entered under Availability in Resources: full-day date blocks and repeating weekly in-day rules, for teachers and rooms. Manual edits get the same guardrail at a different strength: dropping a lesson where it clashes opens a conflicts dialog naming what would collide, and proceeding records the conflict instead of hiding it.
Over-hardening: the usual failure
The common modelling mistake is promoting preferences into the hard set: instructor time requests, no-theory-last-period wishes, favourite rooms. Each promotion shrinks the feasible space, and enough of them make it empty. The failure then arrives as unexplained infeasibility, pointing at nothing in particular.
When a run reports infeasible, audit the hard set first: which of these rules is actually a preference wearing a veto? The checks that catch this before generation are covered in constraint validation; what to check in the data itself is in checking timetable data.
Questions planners ask about hard constraints
What happens if we mark every rule as mandatory?
If the set is jointly impossible, the sourced warning applies: the solver's trade-offs become unpredictable, because you gave it no ranking to trade with. Rank constraints hard, firm, or soft instead, and the trade-offs become yours.
Is a student clash hard or soft?
By policy, either. Some schools treat any student clash as infeasible; others accept a scored violation in narrow cases. The point is that it is a decision to record, not a default to inherit.
Why would a feasible timetable still be bad?
Because hard constraints only guarantee legality. Quality (gaps, spread, compact days) lives in the soft set. A grid can satisfy every hard rule and still be a bad week for everyone in it.