Graph coloring is part of graph theory ,which has great practical importance. The default graph coloring, vertex coloring means coloring of vertices of a graph in such a way that , no adjacent vertices share same colour.
The problem of coloring of a graph has several application such as scheduling, register application in compilers, frequency assignment in mobile radios , etc.
How graph coloring is possible.
The problem of coloring of a graph has several application such as scheduling, register application in compilers, frequency assignment in mobile radios , etc.
How graph coloring is possible.
- Let G=(V,E) be the graph to be colored , where V and E are vertices set and edges set respectively
- Compute the degree of each vertices in
V - Make a list
uncoloredwhich holdsVin descending order of their degrees - Initialize
currentColorto zero - WHILE length of
uncoloredgreater than zero - Initialize
firstto the first element ofuncolored - Remove
firstfromuncolored - Initialize
color(first)tocurrentColor - Initialize
coloredWithCurrentto{first} - FOR each vertex
vinuncolored - IF adjacent list of
vandcoloredWithCurrent(currentColor)has no common elements - Set
color(v)tocurrentColor - Add
vtocoloredWithCurrent(currentColor) - Remove
vfromuncolored - ENDIF
- ENDFOR
- Increment
currentColor - ENDWHILE
I have implemented a web application based on above theory , in that we can create vertices and edges after that just click the button "color it". Click here to see my graph coloring application deployed on heroku. I used HTML 5, JavaScript and python-django for developing this. The source code link .
No comments:
Post a Comment