# education.timetable-clash
Checks a timetable for double-booking: every pair of sessions on the same day
whose times overlap and that share a room, a teacher or a student group. Each
clash says which two sessions, when the overlap is and what they share.
## Decisions
- **Half-open times.** A session from 540 to 600 (09:00-10:00) is over at
600, so one starting at 600 in the same room does not clash with it.
Treating back-to-back lessons as clashes is the usual bug; a vector pins it.
- **Lists, not single values.** Team teaching, combined groups and split
sites mean a session can have several teachers, groups or rooms; any one in
common is a clash, and all the shared ones are listed.
- **A fixed order**, so the same timetable always gives the same report:
by `day`, then the overlap's start, then the first session's position in
the input, then the second's. Within a clash, `first` is the session that
came earlier in the input, and shared names follow its lists' order.
- `day` is a number, so a two-week timetable is days 1 to 10 and anything
else (term weeks, rotating days) can be encoded the same way. Times are
minutes after midnight; `time.minutes-between` and friends convert.
- Every pair is compared: for a school timetable of a few thousand sessions
that is fast enough, and simpler to trust than a sweep line.
## Errors
A repeated `id`, `day` below 1, a start outside 0 to 1439, an end not after
the start or past 1440, or a fractional minute all raise.