Sie sind auf Seite 1von 4

Complexity Theory 1 Complexity Theory 2

Reductions
Complexity Theory
Lecture 5 Given two languages L1 ⊆ Σ⋆1 , and L2 ⊆ Σ⋆2 ,

A reduction of L1 to L2 is a computable function

f : Σ⋆1 → Σ⋆2
Anuj Dawar such that for every string x ∈ Σ⋆1 ,

University of Cambridge Computer Laboratory f (x) ∈ L2 if, and only if, x ∈ L1


Easter Term 2011

http://www.cl.cam.ac.uk/teaching/1011/Complexity/

Anuj Dawar May 16, 2011 Anuj Dawar May 16, 2011

Complexity Theory 3 Complexity Theory 4

Resource Bounded Reductions Reductions 2

If f is computable by a polynomial time algorithm, we say that L1 If L1 ≤P L2 we understand that L1 is no more difficult to solve
is polynomial time reducible to L2 . than L2 , at least as far as polynomial time computation is
concerned.
L1 ≤P L2
That is to say,
If L1 ≤P L2 and L2 ∈ P, then L1 ∈ P
If f is also computable in SPACE(log n), we write
We can get an algorithm to decide L1 by first computing f , and
then using the polynomial time algorithm for L2 .
L1 ≤L L2

Anuj Dawar May 16, 2011 Anuj Dawar May 16, 2011
Complexity Theory 5 Complexity Theory 6

Completeness SAT is NP-complete

The usefulness of reductions is that they allow us to establish the Cook showed that the language SAT of satisfiable Boolean
relative complexity of problems, even when we cannot prove expressions is NP-complete.
absolute lower bounds.
To establish this, we need to show that for every language L in NP,
Cook (1972) first showed that there are problems in NP that are there is a polynomial time reduction from L to SAT.
maximally difficult.
Since L is in NP, there is a nondeterministic Turing machine
A language L is said to be NP-hard if for every language A ∈ NP,
A ≤P L.
M = (Q, Σ, s, δ)

A language L is NP-complete if it is in NP and it is NP-hard.


and a bound nk such that a string x is in L if, and only if, it is
accepted by M within nk steps.

Anuj Dawar May 16, 2011 Anuj Dawar May 16, 2011

Complexity Theory 7 Complexity Theory 8

Boolean Formula

We need to give, for each x ∈ Σ⋆ , a Boolean expression f (x) which Intuitively, these variables are intended to mean:
is satisfiable if, and only if, there is an accepting computation of M
• Si,q – the state of the machine at time i is q.
on input x.
• Ti,j,σ – at time i, the symbol at position j of the tape is σ.
f (x) has the following variables: • Hi,j – at time i, the tape head is pointing at tape cell j.

Si,q for each i ≤ nk and q ∈ Q


Ti,j,σ for each i, j ≤ nk and σ ∈ Σ We now have to see how to write the formula f (x), so that it
Hi,j k
for each i, j ≤ n enforces these meanings.

Anuj Dawar May 16, 2011 Anuj Dawar May 16, 2011
Complexity Theory 9 Complexity Theory 10

Initial state is s and the head is initially at the beginning of the The initial tape contents are x
tape. ^ ^
T1,j,xj ∧ T1,j,⊔
S1,s ∧ H1,1 j≤n n<j

The head is never in two places at once


^^ ^ The tape does not change except under the head
(Hi,j → (¬Hi,j ′ ))
^^ ^ ^
i j j ′ 6=j
(Hi,j ∧ Ti,j ′ ,σ ) → Ti+1,j ′ ,σ
The machine is never in two states at once i j j ′ 6=j σ

^^ ^
(Si,q → (¬Si,q′ ))
Each step is according to δ.
q i q ′ 6=q
^^^^
Each tape cell contains only one symbol (Hi,j ∧ Si,q ∧ Ti,j,σ )
^^^ ^ i j σ q
(Ti,j,σ → (¬Ti,j,σ′ ))
_
→ (Hi+1,j ′ ∧ Si+1,q′ ∧ Ti+1,j,σ′ )
i j σ σ ′ 6=σ ∆

Anuj Dawar May 16, 2011 Anuj Dawar May 16, 2011

Complexity Theory 11 Complexity Theory 12

CNF

where ∆ is the set of all triples (q ′ , σ ′ , D) such that A Boolean expression is in conjunctive normal form if it is the
((q, σ), (q ′ , σ ′ , D)) ∈ δ and conjunction of a set of clauses, each of which is the disjunction of a
set of literals, each of these being either a variable or the negation

if D = S of a variable.
 j



j = j − 1 if D = L
For any Boolean expression φ, there is an equivalent expression ψ


j + 1 if D = R

in conjunctive normal form.

Finally, the accepting state is reached


ψ can be exponentially longer than φ.
_
Si,acc
i However, CNF-SAT, the collection of satisfiable CNF expressions, is
NP-complete.

Anuj Dawar May 16, 2011 Anuj Dawar May 16, 2011
Complexity Theory 13 Complexity Theory 14

3SAT Composing Reductions

A Boolean expression is in 3CNF if it is in conjunctive normal form Polynomial time reductions are clearly closed under composition.
and each clause contains at most 3 literals. So, if L1 ≤P L2 and L2 ≤P L3 , then we also have L1 ≤P L3 .

3SAT is defined as the language consisting of those expressions in


Note, this is also true of ≤L , though less obvious.
3CNF that are satisfiable.

If we show, for some problem A in NP that


3SAT is NP-complete, as there is a polynomial time reduction from
CNF-SAT to 3SAT. SAT ≤P A

or
3SAT ≤P A
it follows that A is also NP-complete.

Anuj Dawar May 16, 2011 Anuj Dawar May 16, 2011

Das könnte Ihnen auch gefallen