Nondeterminism - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

Nondeterminism

Description:

... Form (CNF) Conjunction of disjunctions of variables or their ... clause: disjunction of literals. CNF: conjunction of clauses. Every has an equivalent CNF ... – PowerPoint PPT presentation

Number of Views:34
Avg rating:3.0/5.0
Slides: 16
Provided by: toshi155
Category:

less

Transcript and Presenter's Notes

Title: Nondeterminism


1
Non-determinism
? Multiple possible moves at each step.
? As long as one path (sequence of moves) says
yes, answer yes.
(imagine always guessing the right choice each
step.)
In other words, answer no only when no path
answers yes.
time taken by the algorithm
N Y N Y
2
Non-deterministic Solution to HC
certificate
Step 2 in deterministic polynomial
time check if
3
Components of a Non-deterministic Polynomial-time
Algorithm
? Non-deterministic guess (create certificate)
Polynomial time
? Deterministic check (verify certificate)
Polynomial time
4
Class NP
Set of all problems solvable in non-deterministic
polynomial time.
Subset-Sum ? NP
A non-deterministic algorithm
5
Polynomial Reduction
Problem A is polynomial-time reducible to problem
B if there exists
function f all inputs of A ? all inputs
of B
input of A
input of B
such that
? f is computable in polynomial time.
6
NP-complete
If A B, then A is no harder than B.
P
Proof Suppose g is a polynomial time algorithm
for B.
To solve an instance of A. We first reduce it to
an instance of B, which is then solved using g.
Since the reduction f and g both take polynomial
time,
f g is a polynomial time algorithm for A.
A problem B is NP-complete if
? B ? NP
Class NPC includes all NP-complete problems.
7
Sufficient Condition for NPC
Theorem 2 B ? NPC if
? B ? NP
? C B for some C ? NPC
P
8
Satisfiability Problem (SAT)
The first NP-complete problem!
9
Conjunctive Normal Form (CNF)
Conjunction of disjunctions of variables or their
negations.
clause disjunction of literals
CNF conjunction of clauses
Every ? has an equivalent CNF ?'.
3CNF each clause has exactly 3 literals.
10
Converting to CNF
a?b ? ?a ? b
a ? (b ? c) ? (a ? b) ? (a ? c)
T
(a ? b) ? c ? (a ? c) ? (b ? c)
11
SAT Is NP-complete
Input a boolean formula ? in CNF.
Q Is ? satisfiable?
Cooks Theorem SAT ? NPC.
Proof (1) SAT ? NP.
Very complicated! Omitted. // single abstract
transformation //
involving the simulation of a non-deterministic
// Turing Machine with
CNFs.
12
How to Prove NP-completeness?
To prove a problem B is NP-complete
? Show that B ? NP.
? Select some A ? NPC.
? Construct a transformation f from A to B.
? Prove that f can be carried out in polynomial
time.
13
3SAT is NPC
3SAT
Input a boolean formula ? in 3CNF.
Q Is ? satisfiable?
Proof (1) 3SAT ? NP (same as the proof for SAT
? NP).

14
SAT 3SAT
P
15
Proof (contd)
Write a Comment
User Comments (0)
About PowerShow.com