0% found this document useful (0 votes)
87 views15 pages

Time Table Problem Solving Using Graph Coloring

This document discusses using graph coloring to solve timetable problems. It defines the timetable problem as allocating activities to time slots while respecting constraints. It presents an example problem of scheduling courses without conflicts. It describes constructing a graph to represent the problem and coloring the graph to find a solution. Graph coloring aims to color vertices/edges so that adjacent ones have different colors, representing allocation to different time slots. The document shows how this approach can solve the example timetable problem in an optimal way.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
0% found this document useful (0 votes)
87 views15 pages

Time Table Problem Solving Using Graph Coloring

This document discusses using graph coloring to solve timetable problems. It defines the timetable problem as allocating activities to time slots while respecting constraints. It presents an example problem of scheduling courses without conflicts. It describes constructing a graph to represent the problem and coloring the graph to find a solution. Graph coloring aims to color vertices/edges so that adjacent ones have different colors, representing allocation to different time slots. The document shows how this approach can solve the example timetable problem in an optimal way.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 15

Timetable Problem solving

using Graph Coloring


BY,
VENKATESWARA REDDY. TALLAPU REDDY
Outline

 What is Timetable problem..?


 Problem Statement.
 How to construct a graph for this Real-World problem..?
 What is Graph Coloring..?
 How graph coloring can solve this RW problem..?
 Is it NP-hard or not..?
 References.
What is Timetable Problem..?

 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.

 Chromatic Number: χ = least number of colors needed to color a graph.


How graph coloring can solve this RW
problem..?

 Let us consider an example, In a college there are m professors x1, x2, …, xm and n subjects y1, y2, …, yn to be


taught.
 Given that professor xi is required to teach subject yj for pij periods.
 Construct a bipartite multigraph G with vertices x1, x2, …, xm, and  y1, y2, …, yn such that vertices xi and yj are
connected by pij edges.
 Initially consider a single period. The timetable for this single period corresponds to a matching in the graph
and, conversely, each matching corresponds to a possible assignment of professors to subjects taught during
this period.
 Thus, the solution to the timetabling problem consists of partitioning the edges of G into the minimum
number of matching's. Equivalently, we must properly color the edges of G with the minimum number of
colors.
Contd….

 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

The bipartite multi graph G


Vertex Coloring: 
(1, green), (2, red), (3, blue), (4, yellow), (5, yellow), (6, green), (7, green), (8, yellow), (9, red), (10,
blue), (11, yellow).

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

Consider green, red, blue, yellow as periods 1, 2, 3, 4 respectively.


Contd..
Is it NP-hard or not..?

 Timetable problem solving has many variations due to various constraints that can be tied
to it.

 That is why it is so hard and is considered as NP(Non-Polynomial) complete.

 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

You might also like