A Scheduling Problem: 1. Variables and Domains
A Scheduling Problem: 1. Variables and Domains
The committees must all meet during the first week of classes, but there are only three time
slots available. The aim is to find a schedule that will allow all lecturers to attend the meetings
of all committees on which they serve. Answer the following questions.
1. Define the variables and their domains for this scheduling problem.
3. Find a schedule that will allow all lecturers to attend the meetings of all committees on
which they serve.
Solution
1. Variables and domains
Choosing variables and domains in CSP problems can be somewhat tricky. You have to consider
the goal you are working towards. However, the best place to start is normally to regard the
limited resource as the starting point for the domains (and thus the thing needing the resource
as the variables). Another way of thinking about this is to say the items we are contending
for would be the domains, the items that would like to make use of them (contend for them)
would be the variables.
In the given problem, time slots are limited: the committees are contending for their use – so
we regard the time slots as the domain. Therefore the variables are the six committees.
2. Constraint graph
The nodes of the graph represent the variables, thus the committees. The constraints of the
graph represent the overlaps between committee members. So we draw an edge between two
committees if at least one lecturer is a member of both committees, as shown in the graph in
Figure 1.
1
UE GE
• •
P • • L
S • • C
UE GE
P L
S C
In Figure 2, we have a colouring of the constraint graph that satisfies the requirement we set.
That is, no two nodes that are linked by an edge have the same colour. In this colouring, we
have used three colours, which means we can hold the committee meetings in three time slots
so that there are no conflicts. Specifically we have:
• S = T1 , (yellow)
• UE = C = P = T2 , (red)
• GE = L = T3 , (blue).
Note that the order of assigning time slots to the committees does not really matter as long as
meetings with different colours are held at different times.