Lantiv
Timetabling Turbo 2026
Home > User's Guide > Constraints

 Constraints

The quality of an automatically constructed timetable is measured by how convenient it is for the individuals involved and by how efficiently it utilizes the available resources. The parameters that define these criteria are called Constraints.

Constraints tab

There are many kinds of constraints supported by the program, and we have already seen some of them in the previous chapters. This is because some constraints are fundamental and are taken into account even during the interactive timetabling process, whereas others are optimization constraints that are considered by the software only during the automated construction process.

But before we get to the new types of constraints, let’s review the ones we covered in the previous chapters so that we have a clear list of all the constraints considered during automation in one place.

Fundamental Constraints

All the constraints in this chapter are considered during automation, but the ones listed in this section are defined in the Interactive mode (as explained in previous chapters) rather than in the Automatic mode. Let's briefly review what they are.

Note: All the constraints described in this section are treated as mandatory constraints by the software in Automatic mode. The program will never suggest a timetable that does not satisfy all of these requirements.

Activity Length

As you may remember, each activity can be assigned a Length attribute in the activities list. The length defines the number of periods the activity should occupy consecutively each time it is scheduled. In Interactive mode, when you drag and drop an activity with a length of 2, for example, into the timetable, you are placing a two-period activity. In Automatic mode, the program behaves the same way — it always schedules such an activity across 2 consecutive periods.

Constraints activity length turbo8.png

Activity with Multiple Resources

Another important reminder: each activity can involve multiple resources of the same type (by placing a check mark next to all the relevant resources when filling in the activity’s properties).

For example, a single activity can involve two teachers, or three groups, or two teachers and three groups. Such an activity will appear in the timetables of all the involved resources and will only be scheduled in a time slot when all of them are free.

Constraints activity multiple resources turbo8.png

Activity with Multiple Possible Rooms

Naturally, when an activity can be scheduled in several possible rooms, the program has more flexibility during the automatic timetabling process. The possible rooms for an activity can be specified in the activity’s Room property by selecting them and enabling the Any of the selected resources option at the bottom of the room list.

When an activity has several possible rooms as described above, the program will automatically choose one of them during timetable construction. Note that different cells of the same activity may be scheduled in different rooms.

Constraints activity multiple possible rooms turbo8.png

Simultaneous Activities

Sets make it possible to bundle together several separate activities that need to be scheduled at the same time. Sets are created in the activities list and stand out from the other activities by their color and folder-like shape.

Each activity in a Set can involve different resources, such as groups and teachers, yet once they are united into a Set, they become a single inseparable unit and are always scheduled simultaneously by the automatic engine.

Constraints simultaneous activities turbo8.png

Times of Unavailability

As explained in the Interactive Timetabling chapter, the days and periods during which a resource (or an activity) is unavailable for scheduling can be blocked out by selecting the relevant cells and choosing "Edit" → "Block" from the main menu. A blocked cell for a resource prevents the program from scheduling any activities involving that resource in that cell.

Constraints times of unavailability turbo8.png

Fixated Cells

An activity that is scheduled in Interactive mode and then fixated (by selecting "Edit" → "Fixate" from the main menu) will not be "touched" during automation. This is very useful when you already know that a certain activity must take place on a specific day and period, or when you believe that a particular placement is the best way to schedule it.

Constraints fixated cells turbo8.png

Optimization Constraints

Now that we have reviewed the software’s fundamental constraints, we can explore the constraints used to optimize the timetable. Each type of constraint is responsible for a different aspect of the timetable. Let’s go over the various types and understand what each one means.

Cells Per Day

The constraint Cells Per Day counts the number of scheduled cells on a single day in a resource’s timetable.

This constraint has two common use cases. First, it allows you to spread activities more evenly across the week. For example, suppose a teacher has 20 activities that need to be scheduled. By setting the maximum cells per day to 4, you can force the program to distribute the teacher’s activities evenly across all 5 days, since no single day would be allowed to contain more than 4 scheduled activities.

Constraints cells per day teachers turbo8.png

The second use case is related to subjects. It allows you to ensure that a subject is not scheduled too many times on the same day in a group’s timetable. For example, if History needs to be scheduled 3 times a week, we may not want it to appear more than once per day. This can be achieved by setting the maximum cells per day for the subject History to 1.

Constraints cells per day subjects turbo8.png

Gaps

A Gap is a free cell in the middle of the day, with at least one scheduled activity before it and at least one scheduled activity after it.

The number of gaps on any single day is counted by the "Gaps per Day" constraint, while the total number of gaps during the entire week is counted by the "Gaps" constraint. There is also an additional constraint related to gaps called "Gap Size", which counts the number of consecutive free cells and allows you to limit that number.

The most common use case for limiting gaps is to prevent idle time between activities for teachers, groups, and students. For example, if a teacher is scheduled in the 1st period and then again only in the 5th period, they have 3 gaps (3 idle periods). In many cases, this may be inconvenient for the teacher. By setting the desirable number of gaps per day to "0-1" (zero and one are equally desirable), for example, the program will be encouraged to schedule all of the teacher's activities no more than 1 idle periods apart.

Constraints gaps per day teachers turbo8.png

Another use case for gaps is ensuring that activities of the same subject are scheduled back-to-back. For example, if you define a desirable value of 0 gaps for the subject Math, then any two Math activities scheduled on the same day in a group’s timetable will have to be placed consecutively — otherwise, there would be a gap between them.

Note: When an activity must be scheduled back-to-back, the activity’s Length field should be used. However, when this is preferred rather than mandatory, the gaps constraint can be used. The program only considers activities of the same subject; activities of other subjects scheduled in between are also considered as part of the gap.

Constraints gaps subjects turbo8.png

Late Starts

A Late Start is a free cell, or a series of consecutive free cells, at the beginning of the day. There are no scheduled activities before a late start, but there are scheduled activities after it. For example, if a group has no activity scheduled in the 1st period but does have one in the 2nd period, then they a "Late Start".

There are two types of constraints related to late starts: "Late Starts", which counts the number of times a resource starts the day later than the 1st period throughout the entire week, and "Late Start Size", which counts the number of consecutive free cells at the beginning of any day. The first constraint makes it possible to limit how many times a resource may start the day late (for example, no more than 3 late starts per week), while the second limits the length of each late start (for example, no more than 2 periods).

Constraints late starts groups turbo8.png

Consecutive Cells

This constraint counts the number of consecutive periods in which activities are scheduled.

The most common use case for this constraint is to limit the maximum length of a continuous series of activities in a resource’s timetable. For example, by setting the maximum value for a teacher to 4, you can instruct the program not to schedule that teacher for more than 4 consecutive periods in a row. In such a case, the program would be forced to leave a free period after the 3rd scheduled cell.

Constraints consecutive cells teachers turbo8.png

Period Range

This constraint allows you to specify the range of periods during which a resource or an activity may be scheduled. For example, to tell the program that a resource’s activities should only be scheduled during periods 1–4, you can enter "1" as the minimum value for the constraint and "4" as the maximum value.

Note: If the periods in your school start from 0 or are named differently from 1, 2, etc., you still need to enter positive numbers as the constraint’s minimum and maximum values. This is because the program maps each entered number to the corresponding relative position in the periods list. For example, 1 is mapped to the first period in the list, 2 to the second period, and so on.

Constraints period range subjects turbo8.png

Note: If the period range is a mandatory constraint that must always be respected in the timetable, it is best enforced using blocks. Simply block the disallowed periods in the subject's timetable, and the subject activities will not be scheduled during those periods. The same approach can be applied to any other resource, or to the timetable of any specific activity as well.

Constraints period range blocks turbo8.png

Occupied Periods

This constraint counts the number of periods (horizontally) in which at least one cell is scheduled. For example, suppose an activity has 5 cells: two are scheduled in the 1st period (for example, on Tuesday and Thursday), two are scheduled in the 3rd period, and one is scheduled in the 4th period. In that case, the activity is said to occupy 3 periods: the 1st, 3rd, and 4th.

So, if we want an activity to be distributed evenly across several periods during the week, we can set the desirable value of occupied periods to, for example, "3-8". The program will then try to schedule the activity across at least 3 different periods whenever possible.

Constraints occupied periods activities turbo8.png

Another common use case for this constraint is to ensure that all occurrences of an activity are actually scheduled in the same period. For example, if we want all cells of an activity to occupy the same period (regardless of which period it is), we can set the maximum value of this constraint for that activity to "1", meaning that it may occupy only a single period.

Note: If it is absolutely mandatory for an activity to be scheduled in the same period on all days, the activity's Span property should be used. By setting the span equal to the number of days, the activity is guaranteed to be scheduled in the same period throughout the entire week.

Occupied Days

This constraint counts the number of days (vertically) on which anything is scheduled in a resource’s or activity’s timetable. For example, if a teacher has 8 scheduled cells — 3 on Monday, 3 on Wednesday, and 2 on Thursday — then that teacher’s timetable is said to have 3 occupied days: Monday, Wednesday, and Thursday.

This constraint is commonly used to limit the number of workdays in teacher timetables. For example, if a teacher should have two days off in a 5-day timetable (regardless of which days), setting the desirable number of occupied days for that teacher to "3" effectively instructs the program to leave two days completely free.

Constraints occupied days teachers turbo8.png

Gap of Days

This constraint controls the number of free days (days on which nothing is scheduled) between any two occupied days in a resource's or activity's timetable. In other words, it defines the gap, in days, between any two workdays.

For example, suppose a group has two Physical Education cells during the week. If our goal is to ensure that these two cells are not scheduled on consecutive days, we can set the desirable gap of days for the subject to "1-4" (a gap of 1 to 4 days). By doing so, we instruct the program to leave one to four days between the two occurrences of the Physical Education activity. If we want an even larger gap of at least 2 days in between, we can set the desirable value to "2-4".

Constraints gap of days subjects turbo8.png

Entry of Constraints

To enter constraints, first switch to the Automatic mode by clicking the "Automatic" button at the bottom-right corner of the screen. Once you are in Automatic mode, you will see a tab named Constraints on the right-hand side of the workspace, next to the "Violations" tab. Clicking the "Constraints" tab will open the constraints entry pane.

How to select the type of the constraint?

At the top of the Constraints pane there is a navigation pane. The first selector is used to choose the type of the constraint, while the remaining buttons let you choose the type of the resources for which you want to enter constraint values.

After selecting the constraint type, a list of all resources of the selected type will be displayed. Four additional columns will appear on the left-hand side of the list: Min., Max., Desr. (short for "Desirable"), and Viol. (short for "Violation").

What are the Min, Max and Desirable columns?

As explained above, a constraint is essentially a mathematical formula that counts something. Therefore, when we look at a resource's timetable from the perspective of a specific type of constraint, the formula always produces a single number. For example, if we count the number of weekly gaps in a resource's timetable, we will get a numeric result. Naturally, different resources may produce different numbers. For this reason, when defining constraints, you can specify different limits for each resource.

Since every constraint formula produces a number, the remaining task is simply to define a limit for that number. Once such limits are defined, the program will attempt to generate a timetable that satisfies them all. Three types of limits can be defined: a minimum, a maximum, and one or more desirable values. The minimum and maximum values are hard limits (higher priority), while the desirable value is a soft limit (lower priority). You do not need to enter all three values unless necessary.

To enter a value, simply type it into the corresponding field. All fields are optional, so you may enter only a minimum value, only a maximum value, a minimum and a desirable value, or any other combination as needed.

How to enter several desirable values?

The Desr. column allows you to enter one or more desirable values. A desirable value has a lower priority than the limits defined by the Min/Max range. This means that if the program finds a way to improve the timetable in order to reach a desirable value, but doing so would violate another constraint's Min or Max limit, that option will not be applied.

However, desirable values do allow you to fine-tune the timetable quality by providing a way to define "nice to have" requirements.

The program supports not only a single desirable value, but also a range of desirable values. This is done by using a comma or a dash to specify multiple values. For example, suppose a certain subject should only be scheduled during periods 2–8, but periods 3, 4, 5, and 7 are preferred. In this case, you can set the "Period Range" constraint for that subject to a Min value of "2" and a Max value of "8" and then enter the following in the Desirable field: "3-5,7".

How to prioritize critical constraints?

There are three levels of constraint priority: critical, required, and desirable. By default, the only critical constraint is the scheduling constraint, meaning that the program considers it critical to schedule 100% of the activities. The required constraints are the Min/Max values entered in the constraints list, while the desirable constraints are the values entered in the Desirable column.

However, it is possible to turn any required constraint into a critical constraint. This tells the program that satisfying this constraint is absolutely essential — even more important than scheduling any remaining unscheduled activities.

This affects the program's decision-making process during the automatic phase, because the program will not even consider solutions that violate a critical constraint.

To turn a required constraint into a critical constraint, append an exclamation mark (!) to the value entered in the Min or Max column.

What does the Violation column mean?

The constraint list contains an additional column next to the Min/Max/Desirable columns named "Viol." (short for violation). A value appears in this column only for constraints that are currently unfulfilled (violated) in the timetable.

In such cases, the column displays either a negative or a positive number indicating the difference between the current value of the constraint and the nearest required (or desirable) value.

For example, suppose the maximum number of weekly gaps for a teacher is set to 3, but the current timetable contains 5 gaps. In this case, the violation column for that teacher will display "+2", meaning there are 2 more gaps than allowed.

Another example: suppose the minimum number of cells per day for a group is set to 5, but the current timetable contains only 4 cells per day across a 5-day week. The violation column will display the accumulated value "-5", because 1 cell is missing on each of the 5 days.

If the violation is related to the Min/Max range, it is displayed in red. If it relates only to the desirable value, it is displayed in orange.

Is it possible to modify constraints later?

It is important to emphasize that even if the timetable is already partially or almost fully constructed, you can always modify the existing constraints (or add new ones) and then continue running the automatic solver from that point onward.

The program is able to use the current timetable as a starting point and automatically make the necessary adjustments so that the modified constraints are satisfied.

In fact, this capability can be used as an effective technique for constructing the timetable gradually, since the automatic engine can be run multiple times throughout the process.

This approach is useful because it is often difficult to define all constraints correctly from the beginning. After reviewing the results of an initial automatic phase, you may realize that additional requirements are needed. In such cases, you can simply return to the constraints pane and add or modify constraints. Alternatively, you can make manual changes in Interactive mode, fixate them, and then run the automatic solver again.

Repeating this process several times is actually the recommended way to achieve the highest-quality timetable.

How to prevent over-constraining?

One final point that is important to understand about constraints is how to avoid misusing them. Constraints are a very delicate matter.

Imagine that you have entered many constraints into the program. Some may indeed be important, while others may be insignificant — or even unrealistic. If you were constructing the timetable manually and gradually, you would naturally make decisions that prioritize the truly important constraints first.

The automatic solver, however, does not possess human judgment. Its decision-making process is based entirely on the constraints you define.

Suppose the solver reaches a logical "junction" where satisfying one constraint would require making a change that violates another constraint. If both are defined as Min/Max constraints (meaning they have the same priority), the program will avoid making that change because, from its perspective, the change would not be beneficial.

If both constraints are genuinely required, this behavior is correct. However, if one of them is not truly necessary, the timetable becomes over-constrained, which reduces the program's ability to make good decisions on your behalf.

For this reason, when entering constraints, you should define only the truly required and realistic constraints as Min/Max values. Lower-priority or "nice to have" requirements should generally be entered as Desirable values instead.

The next chapter: Changes.

  Have a question? Email us at SUPPORT@LANTIV.COM