Hard vs. soft constraints
Hard vs. soft constraints
Every rule the solver knows about falls into exactly one of two buckets. Getting this distinction straight before you touch the Constraints page or any of the per-lesson options on Creating Lessons will save you a lot of confused troubleshooting later.
Hard constraints: no exceptions
A hard constraint is a rule the generated timetable can never break. If satisfying every hard
constraint at once is impossible given your data, generation doesn't produce a worse timetable —
it fails outright with status INFEASIBLE, and the solver hands back a list of exactly which
constraints are in conflict — see When generation fails for how
to read that list, and the hard constraints reference for what each
labeled constraint means.
Hard constraints aren't configured on the Constraints page at all — there's no toggle or weight for them anywhere. Instead, they fall directly out of the data you enter elsewhere:
- Marking a teacher unavailable on Adding Teachers creates a hard constraint for that teacher.
- Setting a Period's type to
BREAKon Setting up Periods creates a hard "nothing may be scheduled here" rule. - Picking Locked Time Slots on a lesson (Creating Lessons) creates a hard pin.
- Giving two lessons the same Block value creates a hard "must start together" link.
- Creating a Department with meeting slots creates a hard "these teachers are unreachable then" rule.
There is no dial to turn a hard constraint down — it's either true of your data or it isn't.
Soft constraints: penalties, not rules
A soft constraint never blocks generation. Instead, every time the solver produces a timetable that violates one, it adds a penalty to an internal score (the "objective"), and the solver's whole job during optimization is to search for the arrangement with the lowest total penalty across every soft constraint at once. This means soft constraints routinely trade off against each other — satisfying one perfectly might make another worse, and the solver picks whatever combination scores best overall, not whatever satisfies any single constraint completely.
Soft constraints live on the Constraints page, split across its tabs:
- General Limits — numeric thresholds (max consecutive periods, max daily load, max/min days per week, max span per day) that several soft constraints measure violations against.
- Teacher Welfare — the max-gaps-per-day threshold and the room-stability on/off toggle.
- Student Constraints — the student-gap-minimization on/off toggle.
- Constraint Weights — a 0–100% strength dial for every soft constraint individually. See Constraint weighting for exactly how this works.
The full list of what each one actually penalizes is in the soft constraints reference.
The one thing to remember
If a rule can make generation fail, it's hard, and it's not on the Constraints page. If it's on the Constraints page, it's soft, and violating it never makes generation fail — it just makes the result less good. When something "isn't working the way you configured it," the first question is always which of these two buckets it's actually in — see the worked examples for a few concrete cases where that distinction is the whole answer.