Unit-5-Np Hard and NP Complete Problems-1
Unit-5-Np Hard and NP Complete Problems-1
Unit-5-Np Hard and NP Complete Problems-1
K. RAGHAVA RAO
Professor in CSE
KL University
[email protected]
http://mcadaa.blog.com
1
NP –HARD AND NP – COMPLETE PROBLEMS
Basic Concepts
NP –HARD AND NP – COMPLETE PROBLEMS
Basic Conepts
Decision Problems
To keep things simple, we will mainly concern ourselves with
decision problems. These problems only require a single bit output:
``yes'' and ``no''.
BASIC CONCEPTS
The guesser essentially picks the accepting certificate out of the air
(Non-deterministic Polynomial time). It can then convince itself
that
it is correct using a polynomial
time algorithm. (Like a right-brain, left-brain sort of thing.)
Exponential Upperbound
NP-hardness
NP-Complete
P
NP
DETERMINISTIC and NONDETERMINISTIC ALGORITHMS
j choice (1 :n )
complexity 0(1);
- Non-deterministic decision algorithms generate a zero or one
as their output.
- Deterministic search algorithm complexity. (n)
17
Deterministic and Nondeterministic algorithms
20
The satisfiability problem
• An unsatisfiable formula :
x1 v x2
& x1 v -x2
& -x1 v x2
& -x1 v -x2
8- 22
The satisfiability problem
• Definition of the satisfiability problem:
Given a Boolean formula, determine whether this
formula is satisfiable or not.
• A literal : xi or -xi
• A clause : x1 v x2 v -x3 Ci
25
NP-HARD GRAPH AND SCHEDULING PROBLEMS
1. Chromatic Number Decision Problem (CNP)
• The DHC is a cycle that goes through every vertex exactly once and then
returns to the starting vertex.
27
NP-HARD GRAPH AND SCHEDULING PROBLEMS
1. Sum of subsets
• For each job Ji ,S specifies the time intervals and the processors on
which this job is to be processed.
• A job can not be processed by more than one processor at any given
time.
• The problem is to find a minimum finish time non-preemptive
schedule.
30
SOME SIMPLIIFIED NP-HARD PROBLEMS
Examples.
(i) CNF- Satisfiability with at most three literals per clause is NP-hard.
(ii) If each clause is restricted to have at most two literals then CNF-
satisfiability is polynomial solvable.
31
SOME SIMPLIIFIED NP-HARD PROBLEMS