Time Table Problem Solving Using Graph Coloring
Time Table Problem Solving Using Graph Coloring
Timetable problem can be seen as a form of scheduling where the task is to allocate
activities to available slots within resources respecting some constraints.
There has been a lot of algorithms developed for this particular problem using different
techniques like Graph Coloring, Tabu Search, Genetic Algorithm, Optimization problem
and so on..
This is a problem with so many variations due to various constraints that can be tied to it.
Problem Statement.
Design a simple class schedule with no conflict between a set of teachers and a set of
courses with the following set of constraints:
1. No same courses can be taken by any teacher or batch for a given time slot.
2. Minimize the number of time slots required and prove that it is optimum.
How to construct a Graph for this RW
Problem..?
For example, let us consider 5 courses needed to be scheduled without any conflicts. Then how we can
represent them in a graph is as shown below
Graph representation
Vertices: represents courses
Edges: represents a pair of courses that conflict, and a
Color: represents the period in which that particular course is to be scheduled.
What is Graph Coloring..?
Vertex coloring :
It is a way of coloring the vertices of a graph such that no two adjacent vertices share the same color.
Edge coloring :
An edge-coloring of G is a mapping f : E(G)→S. The element of S are colors; the edges of one color
form a color class. If |S| = k, then f is a k-edge coloring.
We shall show yet another way of solving the problem using the vertex coloring
algorithm.
Recall that the line graph L(G) of G has as vertices the edges of G and two vertices
in L(G) are connected by an edge if and only if the corresponding edges in G have a
vertex in common.
The line graph L(G) is a simple graph and a proper vertex coloring of L(G) yields a proper
edge coloring of G using the same number of colors.
Thus, to solve the timetabling problem, it needs to find a minimum proper vertex coloring
of L(G).We demonstrate the solution with a small example.
Suppose there are four professors x1, x2, x3, x4 and five subjects y1, y2, y3, y4, y5 to be taught.
The teaching requirement matrix p = [ pij ] is as shown:
p y1 y2 y3 y4 y5
x1 2 0 1 1 0
x2 0 1 0 1 0
x3 0 1 1 1 0
x4 0 0 0 1 1
This, in turn, yields a minimum proper vertex 4-coloring of the bipartite multigraph G:
3
2
4
11
10
7
8 9
Edge Coloring:
({x1, y1}, green), ({x1, y1}, red), ({x1, y3}, blue), ({x1, y4}, yellow),
({x2, y2}, yellow), ({x2, y4}, green),
({x3, y2}, green), ({x3, y3}, yellow), ({x3, y4}, red),
({x4, y4}, blue), ({x4, y5}, yellow).
Then, from the edge coloring of G, we obtain a solution of the given timetabling problem as shown below:
- 1 2 3 4
x1 y1 y1 y3 y4
x2 y4 - - y2
x3 y2 y4 - y3
x4 - - y4 y5
Timetable problem solving has many variations due to various constraints that can be tied
to it.
i.e. it does not have any polynomial time bound. However, approximate algorithm or
heuristic approach can be taken to attain solution in a feasible time bound
References.
http://www.iro.umontreal.ca/~hahn/IFT3545/GTWA.pdf
http://www.hoonzis.com/applications-of-graph-theory/
http://www.cs.xu.edu/csci390/12s/IJEST10-02-09-124.pdf