Advanced Constraints¶
Generated Division Constraints¶
When you create class divisions, ScheduLearn automatically generates subject constraints behind the scenes. These constraints ensure that divisions and tracks behave correctly. Because you normally do not need to interact with them, they are hidden by default.
Generated subject constraints for divisions.
To view these constraints, go to the Subject tab on the Constraints page, click the magnifying glass icon (Show Filter) on the toolbar, and check Show Hidden Constraints (green rectangle above). The checkbox appears once you have divisions or pinned lessons, and it also shows the constraints created by pinning lessons. Hidden constraints can't be edited or deleted, and they are marked with a blue track or pin icon to distinguish them from user-created constraints.
They keep subjects in the same track apart, and let subjects in different tracks run at the same time.
You only need to pay attention to these constraints if you add a constraint that contradicts them. For example, in the screenshot above, the generated constraint states: Algebra 2 must not be at the same time as History. If you later create a constraint stating that Algebra 2 must be at the same time as History, the two can't both be met, which creates a scheduling conflict.
A user-created constraint and an automatic division constraint that can't both be met.
In the screenshot above, the user-created constraint Algebra 2 must be at the same time as History contradicts the division-generated constraint above it, creating a scheduling conflict. When a hidden constraint is part of a scheduling conflict, ScheduLearn shows the hidden constraints on the Subject tab even if Show Hidden Constraints is unchecked, so you can see every constraint involved. To fix it, change your own constraint or edit the tracks on the class card.
Constraint Weights¶
Constraint weights are an advanced feature that is off by default. Turning them on for a type of constraint lets you make its constraints soft. A soft constraint is a preference rather than a requirement, like a yellow cell on a teacher's calendar.
To enable constraint weights, click the gear icon on the toolbar of the Constraints page, or open the Solver Settings on the Schedule page. Both show the same Constraint Weights panel.
Each category has its own switch. The ones you'll use most are Subject, Workload and Lesson Spread, where each constraint gets its own weight (see below), and the calendar categories (see Weights for Calendar Constraints). Turning a category on shows a slider for the whole category. ScheduLearn multiplies each soft constraint's own weight by its category's weight. In the screenshot above, yellow teacher cells count most (5), then workload and lesson spread constraints (3), then subject constraints (2).
Enabling weights changes nothing by itself. Every constraint stays hard until you change its weight. Turning a category off again makes its soft constraints hard.
Each constraint can be set to one of the following:
- Off
- 1–5 (soft constraint, increasing importance)
- Hard (requirement)
Subject Constraint Dashboard¶
Subject constraint dashboard with weights enabled.
In the screenshot above, the second constraint is weighted (3), making it a soft constraint. The third constraint is off. The rest are hard (note the lock icon).
Workload Constraint Dashboard¶
Workload constraint dashboard with soft and hard constraints.
Here a soft and a hard constraint work together. The first two constraints are:
- Brown's lessons must be consecutive with spacing of 1 period (soft, weight 4)
- Brown's lessons must be consecutive with spacing of 2 periods (hard)
This means the schedule must meet the 2-period requirement, but will try to keep the gap to 1 period if possible.
Lesson Spread Constraint Dashboard¶
Lesson-spread constraint dashboard with weights enabled.
In the screenshot above, the lesson spread on Algebra 1 (no more than 1 lesson per day) is a soft constraint with weight 4.
Note
Optimize lessons to be at same period is always soft.
Weights for Calendar Constraints¶
Calendar constraints aren't weighted cell by cell.
- Teachers — each teacher has a single weight that applies to all of their yellow and red cells once Calendar Teacher (Yellow Constraints) or Calendar Teacher (Red Constraints) is enabled. See Teacher Constraint Weights.
- Subjects — enabling Calendar Subject (Red Constraints) turns every subject's blocked cells into strong preferences. The category's slider sets how strongly ScheduLearn avoids them.
Modifying Constraint Weights Using Bulk Actions¶
The Subject and Workload tabs let you update many constraints at once, and so does the Lesson Spread tab if its weights are on. Click Turn on Bulk Actions in the toolbar, select the constraints you want (or click Select all), then set their weight with the slider. If weights aren't enabled for that category, the slider is replaced by an Enable / Disable button. On the Subject and Workload tabs, Delete removes the selected constraints.
Setting weights using bulk actions. The green arrow points to the weight slider.
Constraints updated to weight 3 using bulk actions.
What to Do When a Scheduling Conflict Is Unclear¶
The cause of a scheduling conflict isn't always clear. Often you only need to fix it, not fully understand it.
If you get a scheduling conflict and believe a valid schedule should exist, the most common causes are:
- Incorrect subject data
- Incorrect or contradictory constraints
If the data is correct, no schedule can meet all your constraints. Finding this out early saves time, and often a small change fixes it.
ScheduLearn provides several tools to help isolate the problem.
-
Validate the schedule.
Validating checks each class, teacher and classroom on its own. If one can't be scheduled, the full schedule can't be either. Problems between several classes or teachers only show up when you generate (see Generating and Validating the Schedule).
-
Examine the constraints in the scheduling conflict.
This is often the best clue. If every constraint in the scheduling conflict involves the same two teachers, the problem likely lies between them.
In such cases, we recommend generating a schedule only for the affected teachers: in Build A Partial Schedule, choose Only selected and pick those teachers. Turn off Respect pinned lessons elsewhere if you want to test the teachers on their own, without pinned lessons from the rest of the schedule. If that partial schedule also fails, you have successfully isolated the incompatibility. It may be due to insufficient overlapping availability, or because their subjects must occur simultaneously but no shared slot exists.
Generating partial schedules is fast and helps confirm that individual components of the schedule are valid, even when the full schedule is not.
If you've been able to reduce the problem to a smaller section of the schedule and still don't know what to do, we recommend using the Place as many as possible option on the Schedule Page (see Solver Configuration). This places as many lessons as it can while meeting every hard constraint. The lessons it leaves unplaced point to the problem, though they may not be its only cause.
-
Make constraints soft.
If the schedule still won't generate, you can turn hard constraints into strong preferences. ScheduLearn can then break them, and the ones it breaks show what it would take to find a schedule.
For teachers' red (can't work) cells:
- In the Constraint Weights section of the Solver Settings, enable Calendar Teacher (Red Constraints) (see Teacher Constraint Weights).
- On the Teachers page, turn on Select Mode, click Select All, then click Edit.
- Under Teacher weight, set the slider to 5, then save your changes.
- Generate the schedule.
Red cells now count as strong preferences instead of hard constraints. Any red cell that ScheduLearn had to schedule a lesson in shows up as an unmet constraint, telling you which teachers' availability is causing the scheduling conflict. When you're done, set the teachers back to Hard, or turn off Calendar Teacher (Red Constraints).
The same works for subject, workload and lesson spread constraints. Enable Subject, Workload or Lesson Spread under Constraint Weights, then on the matching tab of the Constraints Page click Turn on Bulk Actions, click Select all, and set their weight to a number, such as 5 (see Modifying Constraint Weights Using Bulk Actions). Any of these constraints that ScheduLearn breaks shows up as unmet.
