Graph Coloring
Graph Coloring
In this graph,
No two adjacent vertices are colored with the same color.
Therefore, it is a properly colored graph.
Chromatic Number-
Chromatic Number is the minimum number of colors required to properly color any graph.
OR
Chromatic Number is the minimum number of colors required to color any graph
such that no two adjacent vertices of it are assigned the same color.
In this graph,
No two adjacent vertices are colored with the same color.
Minimum number of colors required to properly color the vertices = 3.
Therefore, Chromatic number of this graph = 3.
We can not properly color this graph with less than 3 colors.
Chromatic Number Of Graphs-
Chromatic Number of some common types of graphs are as follows-
1. Cycle Graph-
A simple graph of ‘n’ vertices (n>=3) and ‘n’ edges forming a cycle of length ‘n’ is called as
a cycle graph.
In a cycle graph, all the vertices are of degree 2.
Chromatic Number
If number of vertices in cycle graph is even, then its chromatic number = 2.
If number of vertices in cycle graph is odd, then its chromatic number = 3.
Examples-
2. Planar Graphs-
A Planar Graph is a graph that can be drawn in a plane such that none of its edges cross
each other.
Chromatic Number
Chromatic Number of any Planar Graph
= Less than or equal to 4
Examples-
All the above cycle graphs are also planar graphs.
Chromatic number of each graph is less than or equal to 4.
3. Complete Graphs-
A complete graph is a graph in which every two distinct vertices are joined by exactly one
edge.
In a complete graph, each vertex is connected with every other vertex.
So to properly it, as many different colors are needed as there are number of vertices in
the given graph.
Chromatic Number
Chromatic Number of any Complete Graph
= Number of vertices in that Complete Graph
Examples-
4. Bipartite Graphs-
Chromatic Number
Chromatic Number of any Bipartite Graph
=2
Example-
5. Trees-
A Tree is a special type of connected graph in which there are no circuits.
Every tree is a bipartite graph.
So, chromatic number of a tree with any number of vertices = 2.
Chromatic Number
Chromatic Number of any tree
=2
Examples-
There exists no efficient algorithm for coloring a graph with minimum number of colors.
Graph Coloring is a NP complete problem.
However, a following greedy algorithm is known for finding the chromatic number of any
given graph.
Greedy Algorithm-
Step-01:
Step-02:
Now, consider the remaining (V-1) vertices one by one and do the following-
Color the currently picked vertex with the lowest numbered color if it has not been used to
color any of its adjacent vertices.
If it has been used, then choose the next least numbered color.
If all the previously used colors have been used, then assign a new color to the currently
picked vertex.
Problem-01:
Vertex a b c d e f
Color C1 C2 C1 C2 C1 C2
From here,
Minimum number of colors used to color the given graph are 2.
Therefore, Chromatic Number of the given graph = 2.
The given graph may be properly colored using 2 colors as shown below-
Problem-02:
Solution-
Color C1 C2 C2 C3 C3 C1
From here,
Minimum number of colors used to color the given graph are 3.
Therefore, Chromatic Number of the given graph = 3.
The given graph may be properly colored using 3 colors as shown below-
Problem-03:
Vertex a b c d e f g
Color C1 C2 C1 C3 C2 C3 C4
From here,
Minimum number of colors used to color the given graph are 4.
Therefore, Chromatic Number of the given graph = 4.
The given graph may be properly colored using 4 colors as shown below-
Problem-04:
Solution-
Vertex a b c d e f
Color C1 C2 C3 C1 C2 C3
From here,
Minimum number of colors used to color the given graph are 3.
Therefore, Chromatic Number of the given graph = 3.
The given graph may be properly colored using 3 colors as shown below-
Problem-05:
The given graph may be properly colored using 3 colors as shown below-