Temporal hard constraints can be mapped onto the graph coloring problem as follows. Let each course be represented by a vertex. Attach two vertices by an edge if and only if there is a reason that the courses they represent may not be offered at the same time. Initially, there are two such reasons for vertices to be linked: either they are taught by the same instructor, or they are required by the same set of students. Upon adding in the links, color the graph. Each color represents a different time slot, so every vertex with the same color will be offered at the same time.
For example, suppose four physics courses must be scheduled: PHY 101, PHY 234, PHY 300, and PHY 300 LAB. The same instructor teaches all three lectures, and a second instructor teaches PHY 300 LAB. Additionally, students enrolled in PHY 300 are required to enroll in PHY 300 LAB concurrently, and vice versa. The graph shown in Figure 4 represents these temporal hard constraints. An edge exists between each of the pairs of courses taught by the same instructor, since these courses may not be offered at the same time. An edge exists between PHY 300 and PHY 300 LAB, because the same set of students must enroll in both courses. Figure 4 also shows a proper coloring of the graph. Each color represents a different time slot, so only three different time slots are needed to properly schedule these four courses. PHY 101 and PHY 300 LAB will be offered during the same time slot, PHY 234 will be in a second time slot, and PHY 300 in a third time slot. Note that this system only partitions the courses into groups which will be offered at the same time; it does not assign the actual time of day.
Figure 4: A graph representing temporal hard constraints.