Timetable constraints

Soft constraints and timetable quality

How soft constraints express timetable preferences that the solver can trade off with penalties.

Juho Isola, Smootables founder

Soft constraints describe timetable quality. They are preferences, not guarantees. The solver can violate them, but each violation carries a penalty that the solver tries to minimise.

Common soft constraints include spreading a subject across the week, placing core subjects in the morning, reducing teacher gaps, limiting consecutive or daily periods, keeping teacher days compact, and avoiding certain subjects in the last period.

This guide answers one question: how should planners use soft constraints without confusing them with hard rules? It stays with planner process and decisions, not product comparison. To evaluate software features, see automatic school timetabling software.

Key takeaways

  • Soft constraints are preferences that guide timetable quality.
  • Each violation has a penalty, and the solver tries to minimise the total penalty.
  • Use soft constraints for spread, gaps, compact days, consecutive periods, and last-period preferences.
  • If a rule must never be broken, it belongs in the hard set instead.

What belongs in the soft set?

Put a rule in the soft set when it improves the timetable but can be missed if needed. The solver uses penalties to compare possible timetables and choose the one with the fewest or lowest soft violations.

Soft constraints should be written as clear preferences. Avoid mixing them with hard constraints, because that makes infeasible models harder to diagnose.

Common soft constraints

These preferences often define timetable quality after the hard set is feasible.

  • Spread a subject across the week
  • Place core subjects in the morning where local policy prefers it
  • Minimise teacher gaps or idle periods
  • Cap consecutive periods for a teacher or class
  • Cap daily periods and keep teacher days compact
  • Avoid certain subjects in the last period where possible

How to tune soft constraints

Soft constraints need relative priority. The question is not whether every preference matters. The question is which penalty should matter more when two preferences conflict.

  1. List each preference separately.
  2. Confirm that none of the preferences is actually a hard rule.
  3. Assign a penalty or priority to each soft constraint.
  4. Generate a timetable after the hard set is feasible.
  5. Review which soft violations remain.
  6. Adjust priorities only when the trade-off is understood.

Why equal penalties can confuse review

If every soft preference has the same priority, the solver has little guidance about which compromise matters most. A compact teacher day, a better subject spread, and fewer last-period lessons may compete for the same slots.

Make the trade-off explicit. A soft violation is not a failure by itself. It is evidence about which quality goals could not all be satisfied after the hard rules were met.

Soft-set review checklist

Use this checklist before changing penalties.

  • Each soft constraint is a preference, not a feasibility rule
  • Spread, gap, compact-day, and last-period rules are separated
  • Penalty values or priorities are documented
  • Remaining violations are reviewed after a feasible solve
  • Penalty changes are made one category at a time
  • Hard constraints are not weakened to improve soft scores

How soft constraints explain quality

A timetable can be feasible and still be poor. Soft constraints show where quality was lost: a teacher has gaps, a subject is bunched, or a day is less compact than planned.

Use the soft-violation list to discuss quality, not feasibility. Feasibility belongs to hard constraints. Quality belongs to soft constraints and their penalties.

Questions planners ask about soft constraints

Does a soft constraint guarantee the result?

No. A soft constraint can be violated. Its penalty tells the solver that the timetable is worse when the preference is missed.

Which preferences are usually soft?

Typical soft preferences include subject spread, core subjects in the morning, fewer teacher gaps, capped consecutive periods, compact teacher days, and avoiding some last-period subjects.

Can a soft rule hide a hard problem?

Yes, if a mandatory rule is entered as soft. Keep clashes, required lessons, unavailable periods, and teaching-day limits in the hard set.

More guides on this topic

See how Smootables fits your school

Book a walkthrough and we will map Smootables to your planning, workload, and timetabling process.