0% found this document useful (0 votes)
2 views12 pages

Graph Coloring

The Graph Coloring Problem involves coloring the vertices of a graph using m colors such that no two adjacent vertices share the same color, with the goal of finding the smallest integer m, known as the chromatic number. The problem can be represented using an adjacency matrix and solved through a state space tree, where each node corresponds to a possible color assignment. Historically, it was proven that four colors are sufficient to color any map, reducing the previously believed requirement of five colors.

Uploaded by

yashaswimannem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views12 pages

Graph Coloring

The Graph Coloring Problem involves coloring the vertices of a graph using m colors such that no two adjacent vertices share the same color, with the goal of finding the smallest integer m, known as the chromatic number. The problem can be represented using an adjacency matrix and solved through a state space tree, where each node corresponds to a possible color assignment. Historically, it was proven that four colors are sufficient to color any map, reducing the previously believed requirement of five colors.

Uploaded by

yashaswimannem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Graph Coloring Problem

using Backtracking
GRAPH COLOURING PROBLEM
Let G be a graph and m be a positive integer .

The problem is to color the vertices of G using


only m colors in such a way that no two adjacent
nodes / vertices have the same color.

It is necessary to find the smallest integer m. m is


referred to as the chromatic number of G.
GRAPH COLOURING PROBLEM (Contd..)

A map can be transformed into a graph by representing


each region of map into a node and if two regions are
adjacent, then the corresponding nodes are joined by an
edge.

For many years it was known that 5 colors are required


to color any map.

After a several hundred years, mathematicians with the


help of a computer showed that 4 colours are sufficient.
Solving the Graph Colouring Problems

The graph is represented by its adjacency


matrix Graph (1:n,1:n) where GRAPH (i,j) =
true if <i,j> is an edge and Graph (i,j) = false
otherwise.

The colours will be represented by the


integers 1,2….m and the solution with n–
tuple (X(1),….X(n)), where X(i) is the colour
of node i.
Solving the Graph Colouring Problems
(Contd..)

The solution can be represented as a state


space tree.

Each node at level i has m children


corresponding to m possible assignments to X(i)
1≤i≤m.

Nodes at level n+1, are leaf nodes. The tree has


degree m with height n+1.
Graph Coloring
A
• As an example:
• The vertices are
B F
enumerated in order A-F
• The 3 colors to be used.

C E

D
A

Graph Coloring
B F

C E

D
State space tree for m colouring
problem with n = 4 and m = 3

1
X(1)=1 X(1)=3
X(1)=2
2
X(2)=1
2 3
3
X(3)=1
2

4 53 6
Graph Colouring Problem- Algorithm
Graph Colouring Problem- Algorithm
(Cont…)
Time complexity

You might also like