Timetable Planning for Secondary Schools
How SchoolAdmin's AI timetabling works — from bell schedule to published timetable
1. Why Timetabling Is the Hardest Job in School
Every term, someone in your school sits down with a blank grid, a list of teachers, and a prayer. Their job: assign every class, every subject, every teacher, and every room to a specific period on a specific day — without a single conflict. No teacher in two rooms at once. No class double-booked. No lab overflowing.
This is the timetabling problem, and it is genuinely one of the hardest scheduling challenges that exist. Mathematicians call it an NP-hard constraint satisfaction problem — the same category as airline crew scheduling and chip circuit design. There is no formula that spits out the right answer. You have to search through possibilities, intelligently, and settle for the best solution you can find.
Manual timetabling typically takes 2–4 weeks of an academic officer’s time. Worse, one small change — a teacher resigns, a new stream is added, a lab is closed for renovation — cascades through dozens of entries. The manual approach is slow, fragile, and error-prone.
SchoolAdmin’s AI timetable solver replaces this with an automated process that handles all constraints simultaneously, generates a complete timetable in under an hour, and lets you fine-tune the result with a visual editor. This guide explains the concepts behind it so you can set up your school for success.
2. The Building Blocks of a Timetable
Before you can generate a timetable, five things need to be in place. Think of them as the raw materials the solver works with:
| Building Block | What It Defines | Example |
|---|---|---|
| Periods | The time grid — when lessons can happen | Period 1: 08:00–08:40, Break: 10:40–11:00 |
| Venues | Physical rooms where lessons take place | S1-Red Classroom, Science Lab 1, Computer Lab |
| Subjects | The curriculum — what is taught | Mathematics, Biology, Agriculture, General Paper |
| Teachers | Who teaches each subject, with qualifications and availability | Mr. Kamya (Biology, Chemistry), Ms. Nakabugo (Mathematics) |
| Classes & Streams | Who is being taught — student groups | S1 (Red, Blue, Yellow), S5 (PCM, HEG, BCM) |
The setup wizard guides you through these step by step. Once all five are configured, the system has everything it needs to generate a conflict-free schedule. Let us look at each one in detail.
3. Periods & the Bell Schedule
The bell schedule is the backbone of your timetable. It defines when lessons can happen — the rows of your weekly grid.
Uganda’s Standard School Day
Most Ugandan secondary schools follow a similar pattern: lessons from 08:00 to 16:40, with a mid-morning break, lunch, and an afternoon session. Here is a typical day school bell schedule:
| Time | Slot | Type | Duration |
|---|---|---|---|
| 08:00 – 08:40 | Period 1 | Lesson | 40 min |
| 08:40 – 09:20 | Period 2 | Lesson | 40 min |
| 09:20 – 10:00 | Period 3 | Lesson | 40 min |
| 10:00 – 10:40 | Period 4 | Lesson | 40 min |
| 10:40 – 11:00 | Break | Break | 20 min |
| 11:00 – 11:40 | Period 5 | Lesson | 40 min |
| 11:40 – 12:20 | Period 6 | Lesson | 40 min |
| 12:20 – 13:00 | Period 7 | Lesson | 40 min |
| 13:00 – 14:00 | Lunch | Break | 60 min |
| 14:00 – 14:40 | Period 8 | Lesson | 40 min |
| 14:40 – 15:20 | Period 9 | Lesson | 40 min |
| 15:20 – 16:00 | Period 10 | Lesson | 40 min |
| 16:00 – 16:40 | Period 11 | Lesson | 40 min |
Single Periods vs Double Periods
Ugandan schools predominantly use double periods — two consecutive 40-minute slots paired into an 80-minute block. Double periods are essential for:
- Science practicals — setting up a lab experiment, running it, and cleaning up takes more than 40 minutes
- Computer Science — students need time to boot machines, write code, and test their work
- PE and Agriculture — changing, going to the field, doing the activity, and returning
- Art and Technical Drawing — creative work benefits from uninterrupted blocks
Day-Specific Overrides
Not every day is the same. Most schools have:
- Monday assembly — replaces Period 1 with a 30–40 minute assembly
- Friday prayers — replaces Period 1 with denominational worship
- Wednesday sports — afternoon periods replaced with games and athletics
The solver treats these as fixed slots that cannot hold regular lessons, and adjusts lesson counts accordingly.
Boarding School Extras
Boarding schools add preparation sessions: morning prep (05:30–07:30), evening prep (19:00–21:00), and sometimes night prep (21:00–22:00). These appear in the timetable grid as non-teaching periods — the solver does not schedule lessons into them, but they show up for student reference.
4. O-Level Scheduling — Students Stay, Teachers Rotate
In Ugandan O-Level (Senior 1 through Senior 4), the scheduling model is straightforward: students stay in their home classroom all day, and teachers move between rooms.
The Home Classroom Rule
Each stream — say S1-Red — is assigned a home classroom. Every lesson for that stream happens in that room (with exceptions for practicals). The students never leave; only the teachers rotate.
This means:
- No time wasted on students moving between rooms
- Classroom management is simpler — one room, one class teacher
- The solver only needs to decide which teacher teaches when — the room is already known
Exceptions: Practical Subjects
Subjects that need specialised rooms break the home classroom rule:
- Biology and Chemistry move to the science laboratory
- Computer Studies and ICT move to the computer lab
- PE and Agriculture move to the sports field
The solver knows which subjects require special rooms (you configure this in setup). For these lessons, it assigns the appropriate venue instead of the home classroom — while still ensuring no two classes share the lab at the same time.
5. A-Level Scheduling — Students Move, Option Blocks Coordinate
A-Level (Senior 5 and Senior 6) is fundamentally different. Students pick subject combinations — typically three principal subjects plus compulsory subsidiary subjects. Since different students in the same stream may take different subjects, students move to subject-specific rooms.
Subject Combinations
Each A-Level student enrols in a combination of three principal subjects. Common combinations include:
| Code | Subjects | Career Path |
|---|---|---|
| PCM | Physics, Chemistry, Mathematics | Engineering, Medicine |
| PCB | Physics, Chemistry, Biology | Medicine, Pharmacy |
| HEG | History, Economics, Geography | Law, Public Administration |
| MEG | Mathematics, Economics, Geography | Business, Finance |
| HEL | History, Economics, Literature | Law, Journalism |
Option Blocks
The key challenge: if a PCM student takes Physics, and an HEG student takes History, those two subjects can happen at the same time (different students, no conflict). But Physics and Chemistry cannot overlap (a PCM student takes both).
The solution is option blocks — groups of subjects that are scheduled concurrently. Within each block, students pick one subject:
| Block | Subjects | Scheduled |
|---|---|---|
| Block A | Physics, History, Art | All at the same time |
| Block B | Chemistry, Economics, Literature | All at the same time |
| Block C | Mathematics, Geography, Biology | All at the same time |
Subsidiary Subjects
In addition to their three principal subjects, all A-Level students must take compulsory subsidiary subjects:
- General Paper (GP) — critical thinking and essay writing
- Subsidiary Mathematics — for students not taking principal Maths
- Subsidiary ICT — computer literacy
Because every student at a level takes these, the solver creates one combined student group per level (e.g., “all S5 students”) for subsidiary subjects. This is simpler than option blocks — the entire level attends together.
6. Elective Clusters — Coordinating O-Level Choices
O-Level students do not only take compulsory subjects. They also pick elective subjects from three clusters, and this creates a scheduling coordination challenge unique to O-Level.
The Three Clusters
| Cluster | Subjects | Student Picks |
|---|---|---|
| Religious Education | Islamic Religious Education, Christian Religious Education (Catholic), Christian Religious Education (Protestant) | One from this cluster |
| Languages | French, German, Arabic, Kiswahili | One from this cluster |
| Pre-Vocational | Agriculture, Hospitality, Tailoring, Carpentry, Metalwork, Leatherwork, Performing Arts | One from this cluster |
Why Concurrent Scheduling Matters
Consider S1-Red: 15 students chose Agriculture, 12 chose Tailoring, 8 chose Carpentry. These subjects must all happen at the same time so that each student only misses the one subject they did not pick. If Agriculture is on Tuesday 10:00 and Tailoring is on Thursday 14:00, the 15 Agriculture students have a free period on Thursday afternoon — wasted time.
Cross-Stream Synchronisation
The coordination extends across streams too. All of Form 1’s elective subjects should ideally happen at the same timeslots, regardless of stream. This allows:
- Teacher sharing — one Agriculture teacher covers S1-Red, S1-Blue, and S1-Yellow simultaneously (all in the same room)
- Room sharing — only one Agriculture room is needed instead of three
- Efficient use of specialists — if you have only one French teacher, they teach all Form 1 French students in one slot
The solver handles this by treating elective synchronisation as a high-priority soft constraint. It tries extremely hard to align elective slots across streams, but will not fail the entire timetable if perfect alignment is impossible (for example, if room capacity is too limited).
7. Venues — More Than Just Classrooms
Every lesson needs a room. For O-Level, that is usually the home classroom. But the school has a variety of specialised spaces, and the solver needs to know about all of them.
| Venue Type | Used For | Special Requirements |
|---|---|---|
| Regular Classroom | Most O-Level lessons, theory subjects | Desks, whiteboard, seating for 40–50 |
| Science Laboratory | Biology, Chemistry, Physics practicals | Fume hoods, running water, gas taps, safety equipment |
| Computer Lab | ICT, Computer Studies | Workstations, network, printers |
| Sports Field | PE, Agriculture (practical) | Open ground, equipment shed |
| Library | Literature, General Paper, research | Quiet space, reference materials |
| Assembly Hall | Assemblies, chapel, combined sessions | Large capacity (200+), PA system |
| Kitchen | Hospitality practicals | Cooking stations, food storage |
| Workshop | Carpentry, Metalwork, Tailoring | Workbenches, tools, power supply |
When you set up your school in the wizard, classrooms can be auto-created from streams — one per stream. You then add specialised rooms manually. The solver uses venue type, capacity, and features to decide which room suits each lesson.
Capacity Matters
If your Form 1 class has 45 students per stream but your science lab only seats 30, the solver knows it cannot put that class in that lab without splitting them. The system will flag this as a capacity issue during pre-flight validation.
8. Teacher Workload — The Balancing Act
A timetable is only as good as its workload distribution. Overloading one teacher while leaving another with empty days is unfair, unsustainable, and against most schools’ policies.
The Five Workload Limits
| Limit | Default | What It Prevents |
|---|---|---|
| Max periods per week | 24 | Total weekly overload |
| Max periods per day | 6 | Exhaustion in a single day |
| Max consecutive periods | 3 | Teaching without a break |
| Min free periods per day | 1 | No time for marking, preparation, or rest |
| Max double periods per day | 2 | Too many 80-minute blocks back-to-back |
These are global defaults. You can override them for individual teachers — for example, a part-time teacher might have a max of 12 periods per week.
The Structural Shortage Problem
Sometimes the numbers simply do not add up. If your school needs 15 ICT periods per week but you have only one ICT teacher whose maximum is 12, you have a structural shortage of 3 periods. No amount of clever scheduling can fix this — you need another teacher, or you need to reduce the curriculum.
Fair-Share Budgeting
Many teachers are qualified in multiple subjects. A Biology and Chemistry teacher might be needed for both. The solver uses a fair-share budget algorithm that distributes each teacher’s available periods across subjects based on demand:
- If Biology needs 40% of a shared teacher’s time and Chemistry needs 35%, the budget is split accordingly
- High-scarcity subjects (where few teachers are qualified) get a larger share
- The algorithm runs before generation to prevent one subject from consuming a shared teacher’s entire capacity
Want to see this in action?
SchoolAdmin generates conflict-free timetables for your school in under an hour — with zero spreadsheet wrestling.
Register Your School9. Teacher Assignment Priorities
Not all teacher assignments are equal. SchoolAdmin uses a four-tier priority system that respects your manual decisions while giving the solver freedom where you have not made a choice.
| Priority | Source | Solver Behaviour | Example |
|---|---|---|---|
| 1 (Highest) | Paper-level assignment | Never changes this teacher | “Mr. Kamya teaches Biology Paper 1 for S3” |
| 2 | Timetable-level lock | Keeps this assignment from previous generation | “Ms. Nakabugo locked for S1 Mathematics” |
| 3 | Curriculum hint (HoD suggestion) | Tries to use this teacher, but can override if needed | “HoD suggests Mr. Okello for S2 English” |
| 4 (Lowest) | Automatic | Solver picks any qualified teacher | System assigns whoever is available and qualified |
This hierarchy means you can pin your most important assignments (paper-level, exam classes) and let the solver handle the rest. The more you pin, the less flexibility the solver has — but the more predictable your outcome.
10. Before You Generate — The Pre-Flight Checklist
Before the solver starts, SchoolAdmin runs five automatic validations. Think of this as a pilot’s pre-flight checklist — if something critical is wrong, you find out now rather than after 45 minutes of failed generation.
| Check | What It Validates | Pass Example | Fail Example |
|---|---|---|---|
| Curriculum Fit | Do all required lessons fit in available teaching slots? | 1,200 lessons needed, 1,320 slots available | 1,400 lessons needed, 1,050 slots — shortfall of 350 |
| Elective Alignment | Do all O-Level classes have matching elective cluster definitions? | All forms have 3 matching clusters | S1 has 3 clusters, S2 has 4 — mismatch |
| A-Level Combinations | Does every A-Level student have a valid subject combination? | All 120 students have 3 principals + subsidiaries | 8 students missing General Paper assignment |
| Teacher Capacity | Are there enough qualified teachers for each subject? | Biology: 2 teachers, 12 periods needed, 24 capacity | ICT: 1 teacher, 15 periods needed, 12 capacity |
| Venue Adequacy | Are there enough rooms, labs, and special spaces? | 2 science labs for 3 classes (staggered scheduling works) | 1 computer lab for 6 classes needing simultaneous ICT |
Each check shows a green tick for pass, amber warning for minor issues (the solver can work around them), or a red block for critical failures that must be resolved first.
11. How AI Generation Works
When you click Generate, here is what happens behind the scenes — explained without jargon.
Step 1: Data Gathering
The system collects everything: all classes, subjects, teachers, rooms, periods, elective clusters, option blocks, teacher preferences, and workload limits. It transforms this into a mathematical model — a precise description of all lessons that need scheduling and all the rules they must follow.
Step 2: Construction — Filling the Grid
The solver starts by rapidly placing lessons into the grid. It works through each lesson one by one, picking the best available timeslot, room, and teacher. This is the “greedy” phase — it gets 60–70% of lessons placed within the first few minutes.
At this stage, the solver ignores minor preferences (like “Mr. Kamya prefers morning lessons”) and focuses only on hard rules — no conflicts, no double-bookings, correct room types.
Step 3: Optimisation — Swapping for Quality
Once every lesson has a slot, the solver enters optimisation. It tries millions of small swaps — moving one lesson to a different time, swapping two teachers, shifting a room assignment — and keeps changes that improve the overall quality score.
This phase runs for 15–45 minutes, depending on school size. The solver stops when it has not found any improvement for several minutes (stagnation detection) or when a maximum time limit is reached.
Hard vs Soft Constraints
| Type | Rule | Consequence if Violated |
|---|---|---|
| Hard | No teacher in two rooms at the same time | Timetable is invalid — must be fixed |
| Hard | No student group double-booked | Students cannot attend — must be fixed |
| Hard | O-Level lessons in home classroom (except practicals) | Students in wrong room — must be fixed |
| Hard | Lab subjects in labs, not classrooms | No equipment for practical — must be fixed |
| Hard | No room used by two classes at once | Physical impossibility — must be fixed |
| Soft | Teacher prefers morning lessons | Teacher gets afternoon — inconvenient, not impossible |
| Soft | Spread subjects evenly across the week | Two Maths lessons on Monday — not ideal, but workable |
| Soft | Max 3 consecutive lessons for a teacher | Teacher gets 4 in a row — tiring but manageable |
| Soft | Elective subjects at the same time across streams | Not perfectly synchronised — uses extra rooms/teachers |
| Soft | Balance teacher workload across the week | Heavy Monday, light Friday — uneven but not broken |
What You See During Generation
While the solver runs, you see a progress screen showing:
- Lessons placed — how many of the total have been assigned
- Hard violations — should reach zero during optimisation
- Soft penalty score — lower is better (measures preference satisfaction)
- Elapsed time — and estimated time remaining
12. After Generation — The Timetable Editor
Once generation completes, you have a full timetable ready for review and fine-tuning. The editor gives you five viewing perspectives and powerful editing tools.
Five Ways to View Your Timetable
- By Class — see the full weekly grid for S1-Red, S2-Blue, etc. This is the most common view for checking that each stream has a complete, balanced schedule.
- By Teacher — see Mr. Kamya’s personal schedule. Useful for confirming free periods, checking room locations, and spotting overloads.
- By Room — see which lessons use the Science Lab on which days. Essential for lab prep scheduling and maintenance planning.
- By Combination — for A-Level, see the schedule from a PCM or HEG student’s perspective. Confirms that option blocks are correctly aligned.
- Dashboard — overview metrics: total lessons, violation counts, teacher utilisation averages, room occupancy rates.
Reading the Grid
The main grid shows days as columns (Monday through Friday, or Saturday) and periods as rows. Each cell contains a lesson with:
- Subject name and code (colour-coded)
- Teacher initials
- Room code
- A lock icon if the entry is frozen
Empty cells are available for manual lesson placement. Break rows span the full width in a muted colour. Double periods span two rows vertically.
The Smart Edit Panel
Click any cell to open the smart edit panel — a slide-in panel on the right side of the screen.
For an empty cell: the panel lets you create a new lesson by selecting a subject, teacher, and room. It shows intelligent suggestions — “Mr. Kamya is free and teaches Biology” — and validates your choice for conflicts before saving.
For a filled cell: the panel shows the current assignment and lets you change the teacher, room, or duration. It also shows options to move the lesson to another slot, delete it, lock it, or add notes.
Drag-and-Drop
For quick moves, you can drag a lesson from one cell to another:
- Single tap — opens the smart edit panel
- Double-tap and hold — starts dragging the lesson (on desktop)
- Long press — starts dragging (on touch devices)
As you drag, the grid shows you whether the target cell is valid (green), would cause a swap (amber), or has conflicts (red). Drop the lesson on a valid cell and the change is applied instantly.
Conflict Heatmap
Toggle the conflict heatmap to overlay a visual indicator on every cell that has a problem. Red glows indicate hard violations (must fix), amber glows indicate soft violations (should fix). Each cell shows an icon with a tooltip explaining the specific conflict.
13. Manual Adjustments & Locked Entries
No auto-generated timetable is perfect on the first try. The editor exists for the last 5–10% of adjustments that require human judgement.
Common Post-Generation Fixes
- Lab timing — the solver placed Biology practical at 08:00, but the lab technician arrives at 09:00. Move the lesson to a later slot.
- Teacher preference — Mr. Okello strongly prefers mornings. The solver gave him two afternoon slots. Swap them with a willing colleague.
- Guest lecturer — a visiting speaker takes S3 English every Wednesday 11:00. Create the entry manually and lock it.
- Combined class — S1-Red and S1-Blue take combined Music. Create a single entry covering both streams.
Locking Entries
When you lock an entry, it becomes frozen in place. If you regenerate the timetable later (perhaps after adding a new teacher or stream), locked entries are treated as fixed constraints — the solver works around them.
This is powerful for protecting:
- Guest lecturer schedules that cannot change
- Combined class arrangements negotiated between departments
- Entries you have manually perfected and do not want disturbed
Batch Operations
Hold Ctrl and click multiple entries to select them. A toolbar appears with batch actions:
- Lock All — freeze all selected entries
- Unlock All — unfreeze all selected entries
- Delete — remove all selected entries (with confirmation)
Every batch action is undoable with Ctrl+Z. A single undo reverses the entire batch, not one entry at a time.
The Workload Panel
While editing, open the workload panel to see every teacher’s current utilisation. Teachers are colour-coded:
- Green (under 90%) — healthy, room to spare
- Yellow (90–100%) — near capacity, be cautious adding more
- Red (over 100%) — overloaded, needs rebalancing
Click a teacher in the workload panel to highlight all their lessons in the grid. Non-matching lessons dim, making it easy to see one teacher’s full week at a glance.
14. Real-World Scenarios
Here are six common situations and how to handle them in SchoolAdmin.
Scenario 1: “Our only Physics teacher is on sick leave for two weeks”
Solution: Open the teacher’s schedule view. For each of their lessons during the absence period, use the smart edit panel to assign a substitute teacher. Lock each substituted entry so it does not change if someone regenerates. When the teacher returns, unlock and revert.
Scenario 2: “S3 Biology needs double periods but we only have one lab”
Solution: The solver already handles this — it staggers lab usage across days. If S3-Red has Biology lab on Tuesday morning, S3-Blue gets Wednesday morning, and S3-Yellow gets Thursday. Check the room view to confirm no overlaps. If you need more lab time, consider splitting the class into smaller groups.
Scenario 3: “A-Level students complain about four back-to-back lessons”
Solution: Go to timetable settings and reduce the max consecutive periods from 4 to 3, or increase the min free periods per day from 1 to 2. Then regenerate. The solver will spread lessons more evenly, giving students breathing room between blocks.
Scenario 4: “We added a new stream mid-term”
Solution: Add the stream in Academics, assign teachers to its subjects, and create a venue for its home classroom. Then regenerate the timetable. Locked entries from existing streams are preserved — only the new stream’s lessons are fresh. Review the result and lock the new entries once you are satisfied.
Scenario 5: “Two teachers both want Wednesday mornings off”
Solution: Set both teachers as unavailable on Wednesday mornings in staff availability settings. The solver treats unavailability as a hard constraint — it will not schedule either teacher on Wednesday morning. If this creates a shortage (not enough teachers to cover all classes), the pre-flight check will flag it.
Scenario 6: “Our Form 1 elective clusters do not match Form 2’s”
Solution: Elective clusters should be consistent across all O-Level forms at the same level. Go to curriculum setup and align the cluster definitions — ensure Form 1 and Form 2 both have the same three clusters with the same subjects in each. Then regenerate. The solver will synchronise elective scheduling across both forms.
15. Quick Reference & Glossary
5 Things to Check Before Generating
- All classes and streams are configured with their full subject list
- Every subject has at least one qualified teacher assigned
- Specialised rooms (labs, computer rooms, fields) are registered as venues
- Elective clusters match across all O-Level forms
- A-Level option blocks are defined and every student has a valid combination
What to Do When Generation Reports Violations
- 0 hard violations — the timetable is valid. Review soft penalties for quality, then publish.
- 1–10 hard violations — minor conflicts. Use the conflict heatmap to find them, then fix manually in the editor. Usually teacher or room clashes that a quick swap resolves.
- 10+ hard violations — structural issue. Check pre-flight validation again. Common causes: too few rooms, teacher shortages, or overly constrained availability.
Glossary
| Term | Definition |
|---|---|
| Period | A single time slot in the school day (typically 40 minutes) |
| Double Period | Two consecutive periods treated as one 80-minute block |
| Stream | A subdivision of a class (e.g., S1-Red, S1-Blue, S1-Yellow) |
| Home Classroom | The room where an O-Level stream stays for all non-practical lessons |
| Option Block | A group of A-Level subjects scheduled concurrently so students can pick one per block |
| Elective Cluster | A group of O-Level elective subjects that must run at the same time (Religious Ed, Languages, Pre-Vocational) |
| Subsidiary Subject | A compulsory A-Level subject taken by all students at a level (GP, Sub Maths, Sub ICT) |
| Hard Constraint | A rule that must never be violated (e.g., no double-booking) |
| Soft Constraint | A preference the solver tries to satisfy but can compromise on (e.g., teacher morning preference) |
| Workload | The number of periods a teacher is assigned, measured against their maximum limits |
| Locked Entry | A timetable entry frozen in place that regeneration cannot move |
| Pre-Assignment | A teacher manually assigned to a class-subject before generation (Paper or Timetable level) |
| Structural Shortage | When subject demand exceeds the total capacity of all qualified teachers — unsolvable by scheduling alone |
| Fair-Share Budget | Algorithm that distributes shared teachers’ time across subjects based on demand and scarcity |
| Conflict Heatmap | Visual overlay in the editor showing which cells have constraint violations |
| Venue | Any physical space where a lesson takes place — classroom, lab, field, hall |
| Subject Combination | The set of 3 principal subjects an A-Level student enrols in (e.g., PCM, HEG) |
| Construction Heuristic | The first phase of solver generation that rapidly places lessons into the grid |
| Local Search | The optimisation phase where the solver swaps lessons to improve quality |
| Stagnation | When the solver stops finding improvements — it terminates and returns the best solution found |
Ready to Stop Wrestling with Timetables?
SchoolAdmin’s AI solver handles 1,800+ lessons, 50+ rooms, and 110+ teachers — so you do not have to.