Soft and hard constraints are fundamental elements behind not only creating a great timetable, but also a working one. The make up of a timetable (any timetable) consists of a variety of constraints that are either hard or a soft, but what are they? and what is the difference?
Let starts with hard constraints, these are the fundamental elements of a timetable that you and the software use to create the timetable and must be abided by. For example, the number of hours in the teaching day is likely to be a hard constraint. If you teach Monday – Friday 09-17:00, then the timetable must ensure that all timetable activities are placed within this time frame. A timetable booking placed on a Thursday at 18:00 or a Saturday at 12:00 will not be of any use, therefore the software and those who use it must abide by this constraint in order to create a working timetable i.e. a hard constraint.
Each hard constraint, is an element of the timetable that is equally weighted and must be abided by. Simply put – if they are broken, the timetable will not work. I have provided below the key hard constraints that typically make up a teaching timetable, although there can be more depending on how your institution works!
Number of Teaching Spaces/Rooms – You can only book as many rooms as you have available, if the number of timetable activities outstrips your teaching room availability then you have a problem!
The Teaching Week – As discussed, if you have a strict teaching week then there is no use timetabling outside of these times.
Number of Weeks in the Semester – As with the teaching week, there is no use timetabling activities outside of the institutions planned teaching weeks if all etaching actvities must take place within them.
Student Clash Checks – These can be a mixture of both hard and soft constraints, however if a student must attend two lectures then the timetable should recognise that they cannot happen at the same time – i.e. a hard constraint.
Staff Clash Checks – As with students, staff can’t be in two places at the same time therefore again the timetable must recognise this.
Teaching Room Capacity – If a room has a 100 capacity then only 100 students can fit into this room, therefore this is typically a hard constraint. However, there can be some flexibility with this if you can accurately predict a certain percentage will not attend and therefore are willing to allow for example a 5% margin, as this would allow an extra 5 students into this room.
Each of these hard constraints is built around the same principles that govern most aspects of our life – space and time. These hard constraints will allow you to create a timetable that works, providing you have resources available to enable you to accommodate the timetable activities within the hard constraints!
The soft constraints, are the other side of the coin and are made up of the elements which can turn your timetable from a working timetable into a great timetable. Of course, a “great” timetable is dependent on what you are looking to achieve and what resources you have available but the principle of a soft constraint is that you are putting a constraint into the timetable that will help to improve your timetable and isn’t a necessity.
For example, student feedback may indicate that the students want to have an hour lunch break within their timetable during each day of the teaching week. This request isn’t a necessity, but it is a want and therefore you can test to see whether this is feasible by building it into your timetable as a soft constraint. The difference between this soft constraint and a hard constraint, is that the timetabling software (and you) must be able to recognise that if there is no other option (or there is a better option) this constraint can be ignored.
What do I mean by a better option? Well, one of the fundamental issues with soft constraints is that you are likely to have more than one. For example, students may want to have a lunch hour, but also not have a teaching day exceeding 6 hours, or have more than 4 hours of lectures in a row, plus your staff also don’t want to teach more than three hours worth of activities in a row plus want to have a research day each week.
Each of these is a soft constraint, as if they are all ignored, then you still have a timetable that works – just not one that makes very many people happy! However, you may well not be able to accommodate all of these requests without running out of space and time. Therefore, these soft constraints are typically put into timetabling software and ranked according to their importance.
By ranking the soft constraints you are telling the software how important each of these soft constraints are in comparison to each other. In doing so the timetabling software will try to abide by all the hard and soft constraints when creating a timetable, but if they cannot all be fulfilled the software will try to satisfy as many of the higher ranked soft constraints as possible whilst also abiding by the hard constraints – the hard constraint must also be abided by!
Using the same example, you could rank the soft constraints as shown below:
- Student Lunch Hour – 1 hour between 12-14:00 – Rank 7
- Student Teaching Day – Max 6 Hours – Rank 8
- Student Consecutive Teaching Hours – Max 4 Hours – Rank 4
- Staff Consecutive Teaching Hours – Max 3 hours – Rank 5
- Staff Teaching Week – Max 4 days – Rank 6
By ranking these soft constraints, the timetabling software will recognise what you perceive to be the order of importance (i.e. how they are ranked) and ensure that timetable activities are booked at times and in spaces that reflect the best option available. If not all the constraints can be met, those with lowest rank will be ignored until a suitable time/space can be timetabled.
The types of soft constraints that make up a timetable are completely dependent upon what you are trying to achieve and what resources you have available, therefore there are a huge number of permeations that you can build into a timetable that creates a great timetable for your institution. Some other examples of soft constraints include:
Teaching Space Capacity – Timetable activities into rooms that closely match their class size
A Preferred Teaching Week – Restrict the number of bookings at certain times or on certain days.
Maximum Gap Between Lectures – Limit the number of free hours students (and staff) have between lectures.
Teaching Room Zoning – Concentrate certain departments bookings within specific areas of an estate. For example Department A would prefer to have their teaching in the 3 buildings the department is based in.
Typically each of these soft constraints can be set up against the whole institution, different sub sections of students or even individual staff. Each with their own soft constraint permeation that reflects their requests. The timetable’s ability to meet these demands and create a great timetable, relies on you ability to accurately interpret their importance and rank them accordingly in the software and also the timetables ability to accommodate these soft constraints in the software given the hard constraints.
If you don’t currently use soft constraints within your timetable then I would certainly advise taking a look at them and running some models with different soft constraints built in. Even by only including one or two soft constraints based on staff and student feedback/requests you are sure to see some improvements, helping to create a better timetable.
If you are interested in finding out how to define, put together and set-up hard and soft constraints within you timetable, I would be very happy to discuss this further with you so please don’t hesitate to contact me.
I hope you have enjoyed this article and found it useful, I would be very interested to hear your thoughts on hard and soft constraints and how you use them to create a great timetable. Please feel free to add your thoughts in the comments section below, any experience, suggestions, ideas or questions you share help to continue the discussions and explore this subject in further detail – I always reply to all comments, so fire away!
All the best
Ben Moreland