Constraint recipe
A teacher gap is a free period between two lessons on the same day. If a teacher has lessons in periods 1 and 4, the empty periods 2 and 3 are gaps, including when period 4 is their last lesson that day. Only time before the first lesson, lunch, and time after the final lesson are excluded. Rule out double-bookings and unavailable periods first, then tighten gap preferences or move lessons.
Key takeaways
- Count gaps between lessons on the same day, including before the last lesson.
- Fix clashes and unavailable periods before chasing zero gaps.
- Part-time days, double periods, and specialist rooms often force gaps.
- Every gap you close moves a lesson; check what the move breaks for the receiving class and room.
When a gap is a problem
Planners also call gaps idle periods, and one between lessons may be fine. Five on the same day may break local workload policy. Gaps cost paid staff time, but they do not stop the timetable from running. That makes them different from a clash, where the same teacher is assigned to two classes at once and the timetable is invalid.
Treat gaps as a quality target unless your policy makes a specific gap illegal. A hard rule cannot be broken; a soft rule is a preference the timetable system can bend when something more important blocks it. Gap limits are almost always soft: the generator reduces them where rooms, availability, and required lessons still allow it.
A worked example: three gaps in one week
Ms. Keller teaches 12 maths lessons across five classes. Filter the timetable to her week and count the free periods between lessons on each day. Tuesday has two gaps and Thursday one. Monday afternoon is empty, but that time falls after her last lesson, so it does not count.
Before: Tuesday P2 and P3, Thursday P2
| Mon | Tue | Wed | Thu | Fri | |
|---|---|---|---|---|---|
| P1 | 7A | 8B | 9A | ||
| P2 | 7B | Gap | 7B | Gap | |
| P3 | 9A | Gap | 8B | 7A | |
| P4 | 9A | ||||
| P5 | 7A | 7B | |||
| P6 | 8A |
- Lesson
- Gap (idle period)
- Moved lesson
After: the same 12 lessons, zero gaps
| Mon | Tue | Wed | Thu | Fri | |
|---|---|---|---|---|---|
| P1 | 7A | 8B | 9A | ||
| P2 | 7B | 9A | 7B | 7A | |
| P3 | 9A | 7A | 8B | ||
| P4 | |||||
| P5 | 7B | ||||
| P6 | 8A |
- Lesson
- Gap (idle period)
- Moved lesson
The fix is not free. Moving 9A from Tuesday P4 to P2 means class 9A now has a different subject in P4, and the room Ms. Keller uses must be free in P2. Every closed gap is a move, and every move needs the receiving class, teacher, and room to be free. This is why a generator sometimes leaves a gap in place: the compact placement exists for the teacher but not for everyone else in the slot.
What keeps gaps in place
Teachers who work only two or three days leave fewer slots to pack lessons tightly. Double periods and lab blocks need adjacent time, which can open holes elsewhere in the day. Team teaching needs every assigned teacher free in the same period, which shrinks options for the whole group. A specialist room that is only free in P1 and P4 can force a gap between those lessons no matter what the generator tries.
See soft constraints for how quality preferences like gap limits give way to clashes, rooms, and availability.
Work through the gaps in order
Do the checks in this order so you do not chase a zero-gap target that availability makes impossible.
- Filter the timetable by one teacher at a time and count free periods between lessons on the same day, as in the example above.
- Check for double-bookings and for lessons placed in periods the teacher marked unavailable. Fix those first; they are validity problems, not quality problems.
- For each remaining gap, note whether the lessons around it are pinned, team-taught, double periods, or tied to a specialist room.
- Decide what matters more for your school: compact teacher days, subject spread across the week, or the shape of the students' day. Tightening one usually loosens another.
- Raise the gap preference, or move the blocking lessons by hand, then regenerate.
- Compare the gap count before and after. If a gap survives, record why: a part-time day, a room limit, or a team-teaching overlap usually explains it.
Mistakes that create more gaps
- Treating every gap as a clash or a data error instead of a quality target
- Pinning lessons early, then blaming the generator for the gaps the pins created
- Demanding zero gaps from part-time staff who work only a few days each week
- Closing a teacher's gap with a move that opens two gaps for a colleague
In Smootables
Solver Settings
Adjust how the timetable solver prioritizes different constraints. Each weight can be set between 0 and 200.
Student Gaps
Minimize idle time between lessons for students. Higher = fewer gaps.
0Teacher Gaps
Minimize idle time between lessons for teachers. Higher = fewer gaps.
120Student Daily Balance
Spread student lessons evenly across days. Higher = more balanced.
100A gap is a free period between two lessons on the same day. Empty slots between earlier lessons and the last lesson of the day count. Only time before the first lesson, lunch, and time after the final lesson are excluded. Smootables treats gaps as something to reduce when you want tighter days, not as a clash that makes a timetable invalid.
Open Settings → Timetabling and raise Teacher Gaps (0 to 200). Zero turns the preference off. A higher number asks the generator to pack each teacher's day more tightly when rooms, availability, and other rules still allow it.
- Run Generate timetable only after clashes and room rules already look feasible.
- Compare Teacher gaps in the analysis summary across two runs before committing to a heavy weight.
Quick answers
Are teacher gaps hard or soft constraints?
Usually soft. A double-booking or a lesson in an unavailable period makes the timetable invalid; an idle period between valid lessons is a workload quality issue.
Does free time before the first lesson count as a gap?
No. Gaps are free periods between two lessons on the same day. Time before the first lesson, lunch, and time after the last lesson are excluded.
Why won't the generator remove every gap?
Another rule may leave no compact placement. Check part-time days, team teaching, double periods, and specialist rooms before raising the gap weight again.