1. Made By: - Chetan Malviya
Graph Coloring
Introduction: -
In old days there is a problem for that problem that
a solution is built and that problem is for finding the no of color can
be filled in a map that it take less no of reputation for coloring a map
for that its cost is not increase much or in between their no error occur
between the process of printing the map.
For that a solution is introduced that is called as graph coloring.
In graph coloring we need to find out the chromatic number of a
graph. The chromatic number of graphs is called the number of color
can be filled in the vertex of graph that the adjacent vertex color
cannot be common in that the minimum no cover that graph is called
the chromatic no of graph. By that chromatic number we can perform
the method graph coloring.
Adjacent vertices: If two vertices of a graph are joined by an edge
then these vertices called adjacent vertices.
Problem: -
In the coloring of map that in old days there for printing a map is very
difficult in old days the printer can only print one color at a time and
also in the map do not want to fill same color in the adjacent country
for that the country is connected to other country. That occur a error if
that happen than the map has no use. Let me demonstrate the use
Suppose: -
In map
N= no of counties
For one time printing it cost =r
For no of countries it cost =n*r
2. Made By: - Chetan Malviya
If there an error occurs in it then the cost is increase. For that the
solution is created. That is known as graph coloring. That is done by
graph coloring.
Process: - In the we consider the countries as a no of nodes like
No of countries =No of nodes in graph
In this the graph is arrange in such manner that the countries are
adjacent to each other. On that the node is also adjacent in the graph.
Let consider A B C D are nodes Some are adjacent to each other In
this There are some adjacent vertices that is
{(A, B), (B, C), (C, D), (D, A)}
Let in this we have to find out how much no of color required it for
coloring we take minimum 2 colors and maximum 3. That colors is
{R, G, B}. Now Look toward this graph.
We will apply an algorithm in graph:
1. Color first vertex with
first color.
2. Do following for remaining V-
1 vertices.
Check that their adjacent vertex has not
same color.
repeat this algo to n no of vertex an at the end
we get result.
4. Made By: - Chetan Malviya
Their also can be n no of solutions we can find like
In normal way for solving it and for that taking a three nodes graph.In
this we do not apply any condition for checking the color of the
adjacent vertex.
There is a limit for graph coloring method in case of very limited
nodes.
5. Made By: - Chetan Malviya
Time Complexity: -
In this the no of nodes increasing level by level therefore
For total no of nodes
1 + 3 + 32
+ 33
= (33+1
-1)/3-1
3n+1=Cn+1
3 is the chromatic number of the graph
By Backtracking:-
This is work in following way:-
Example:-
There is a graph we want to color it for that we need
perform an algorithm to find out chromatic number. And the optimal
way for graph coloring.
First we start from one root then after completing a chain then start
backtracking and always check that we do not put same color in the
adjacent vertices. When all the colors has been filled in the vertices
then we get all the no of solution can be done with the possible color
manner and this is a good way for finding a optimal solution for the
less no of vertices for graph coloring.
6. Made By: - Chetan Malviya
The solution for graph by backtracking is
Like This its two combination is more possible Because of this this
problem comes under the NP hard problems. In this we can consider
the edges in the place of vertices.
Now A days these methods are used for some Applications like
• Making Schedule or Time Table
• Mobile Radio Frequency Assignment
• Sudoku
• Register Allocation Bipartite Graphs
• Map Coloring, and more.