Concepts
Hard vs soft constraints, with real examples
The distinction sounds academic until you have spent a week overriding your own rules because you declared all of them inviolable.
The definitions
A hard constraint is a rule that must hold in any valid timetable. Breaking it does not produce a worse timetable; it produces an invalid one. A lecturer cannot be in two rooms at once. Ninety students cannot sit in a room with sixty seats. A chemistry practical cannot run in a seminar room without fume cupboards.
A soft constraint is a preference. Satisfying it makes the timetable better; violating it makes the timetable worse but still usable. A lecturer would rather not teach on Friday afternoons. Students should not have three-hour gaps. Teaching should be condensed into fewer days.
A scheduling engine treats these completely differently. Hard constraints define the space of legal solutions. Soft constraints define which of those legal solutions is best, and they are traded off against each other.
Classifying the rules you already have
Most institutions have a list somewhere. Almost none of them classify it.
| Rule | Type | Why |
|---|---|---|
| Lecturer cannot teach two sessions at once | Hard | Physically impossible; no timetable containing this is usable. |
| Room capacity must fit the group | Hard | The session cannot take place. Occasionally softened where a group is known not to attend in full. |
| Session requires specific equipment | Hard | Teaching cannot happen without it. |
| Lecturer marked unavailable Tuesday morning | Hard | If they submitted it themselves, treat it as hard. That is the point of self-service availability. |
| No more than six teaching hours per day | Usually hard | Often institutional policy or a union agreement rather than a preference. |
| Lunch break between 12:00 and 14:00 | Soft or hard | Depends on institution. Make it explicit rather than assuming. |
| Lecturer prefers mornings | Soft | A preference. Optimise for it; do not fail because of it. |
| Students should have no gaps longer than two hours | Soft | Highly desirable, rarely fully achievable. |
| Teaching condensed into fewer days | Soft | Directly conflicts with the previous row. This is exactly what optimisation is for. |
| Preferred room for a given module | Soft | Usually a convenience, occasionally hard where equipment is fixed. |
Why the confusion is expensive
Declaring every rule hard feels safe. It is not. A constraint set where every preference is inviolable usually admits no solution at all, and the system correctly reports that a large number of sessions cannot be placed.
What happens next is the expensive part: someone spends a week manually overriding constraints one at a time to force a result, which is precisely the manual labour automation was meant to remove — and the resulting timetable has no record of which rules were bent or why.
The opposite error is rarer but worse. Marking a genuine hard constraint as soft produces a timetable that looks complete and contains an impossibility, discovered in week one by the people affected.
A practical test
Ask one question of each rule: if this were violated, would the session still be able to take place?
If no, it is hard. If yes but somebody would be unhappy, it is soft. If the answer is "it depends who", you have found a political constraint rather than a scheduling one, and it needs deciding by a human before it goes into any system.
Want to see this working?
Book a 45-minute online presentation and we will walk through it against your institution's own scheduling problem.