A graph coloring is an assignment of labels, called colors, to the vertices of a graph such that no two adjacent vertices share the same color. The chromatic number χ(G) of a graph G is the minimal number of colors for which such an assignment is possible.
2. DECISION PROBLEM
CHROMATIC NUMBER
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.
PROBLEM STATEMENT
3. What are NP Problems?
NP is set of decision problems whose solutions are hard to find but easy to verify and
can be solved by a Non-deterministic Turing Machine in Polynomial time.
A Non-deterministic Turing Machine is a theoretical model of computation whose
governing rules specify more than one possible action when in some given situations i.e.
the set of rules of a Non-deterministic Turing Machine may prescribe more than one
action to be performed for any given situation.
A problem X is NP-Complete if there is an NP problem Y, such that Y is reducible to X in
polynomial time. NP-Complete problems can be solved by a Non-deterministic Turing
Machine in polynomial time.
What is a Non-deterministic Turing Machine?
What is a NP-Complete problem?
PROBLEM DEFINITION
4. What is a NP-Hard Problem?
Satisfiability with at most 3 literals per clause.
Reduction to NP-Hard problem is possible
It is a reduction from 3-SAT.
The complexity class of decision problems that are intrinsically harder than those that
can be solved by a nondeterministic Turing machine in polynomial time. When a decision
version of a combinatorial optimization problem is proved to belong to the class of NP-
complete problems, then the optimization version is NP-hard.
Therefore, it is a NP-Hard Problem.
Why is CNDP a NP-Hard Problem?
5. Graph Colouring: Graph Coloring is the process of assigning colors to the vertices of a
graph such that no two adjacent vertices of it are assigned the same
color.
THEORY
Chromatic number: 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.
Example:
6. ALGORITHM
Create a recursive function that takes current index, number of vertices and output
color array.
If the current index is equal to number of vertices. Check if the output color
configuration is safe.
If the conditions are met, print the configuration and break.
Assign color to a vertex (1 to m).
For every assigned color recursively call the function with next index and number of
vertices.
If any recursive function returns true break the loop and return true.
There are quite a few ways in which we can solve the Chromatic Number Decision
Problem (CNDP), backtracking and naive are two of them.
Naive:
1.
2.
3.
4.
5.
6.
7. Create a recursive function that takes the graph, current index, number of vertices
and output color array.
If the current index is equal to number of vertices. Print the color configuration in
output array.
Assign color to a vertex (1 to m).
For every assigned color, check if the configuration is safe, recursively call the
function with next index and number of vertices.
If any recursive function returns true break the loop and return true
If no recusive function returns true then return false.
Backtracking:
1.
2.
3.
4.
5.
6.
15. MAP COLOURING
Four colors are sufficient
to color any map
We place a vertex in each
region
4-coloring thereom
16. Fill in the blank
cells so that each
row, column and
box has the
characters 1 to 9
exactly once
SUDOKU
17. How do we schedule the
exam so that no two exams
with a common student
are scheduled at same
time?
How many minimum time
slots are needed to
schedule all exams?
TIMETABLE MAKING
18. CNDP is an np-hard problem
NP-hard are still under research,
so until these are found one will
have to use the algorithm with
exponential time complexity
(naive/backtracking)
CONCLUSION