DM Presentation
DM Presentation
Graph coloring is the procedure of assignment of colors to each vertex of a graph G such
that no adjacent vertices get same color. The objective is to minimize the number of
colors while coloring a graph. The smallest number of colors required to color a graph G
is called its chromatic number of that graph. Graph coloring problem is a NP Complete
problem.
Method to Color a Graph
• The steps required to color a graph G with n number of vertices are as follows
−
• Step 1 − Arrange the vertices of the graph in some order.
• Step 2 − Choose the first vertex and color it with the first color.
• Step 3 − Choose the next vertex and color it with the lowest numbered color
that has not been colored on any vertices adjacent to it. If all the adjacent
vertices are colored with this color, assign a new color to it. Repeat this step
until all the vertices are colored
In the below figure, at first vertex a is colored red. As the adjacent vertices of
vertex a are again adjacent, vertex b and vertex d are colored with different
color, green and blue respectively. Then vertex c is colored as red as no adjacent
vertex of c is colored red. Hence, we could color the graph by 3 colors. Hence,
the chromatic number of the graph is 3.
Applications of Graph Coloring
• Some applications of graph coloring include −
• Register Allocation
• Map Coloring
• Bipartite Graph Checking
• Mobile Radio Frequency Assignment
• Making time table, etc.
Example:-
How can the final exams at a university be
scheduled so that no student has two
exams at the same time?
Solution:-This scheduling problem can be solved using a graph model, vertices
representing courses and with an edge between two vertices if there is a
common student in the courses they represent . Each time slot for final exam
is represented by a different colour. A scheduling of the exams corresponds to
a colouring of graph
for instance, suppose there are seven finals to be scheduled. Suppose the
courses are numbers 1 through 7 suppose that the following pairs of the
courses have common students:1 and 2,1and 3,1 and 4,1 and7, 2 and3, 2 and 4,
2 and 5, 2 and 7,3 and 4, 3 and6 ,3 and 7 ,4 and 5, 4 and6, 5 and6, 5 and 7, 6
and7. In fig given below the graph associated with this set of classes is shown.
A scheduling consist of colouring of graph. Because the chromatic number of
this graph is 4, four times slots are needed. A colouring of the graph using four
colour and the associated schedule are shown in figure given below
conclusion
Graph colouring has a variety of applications to
problems involving scheduling and assignments.
Because no efficient algorithms is known for graph
colouring, this does not lead to efficient algorithms
for scheduling and assignments.