Complexity Theory: Reductions
Complexity Theory: Reductions
Reductions
Complexity Theory
Lecture 5 Given two languages L1 ⊆ Σ⋆1 , and L2 ⊆ Σ⋆2 ,
f : Σ⋆1 → Σ⋆2
Anuj Dawar such that for every string x ∈ Σ⋆1 ,
http://www.cl.cam.ac.uk/teaching/1011/Complexity/
Anuj Dawar May 16, 2011 Anuj Dawar May 16, 2011
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
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, δ)
Anuj Dawar May 16, 2011 Anuj Dawar May 16, 2011
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.
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
^^ ^
(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
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.
Anuj Dawar May 16, 2011 Anuj Dawar May 16, 2011
Complexity Theory 13 Complexity Theory 14
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 .
or
3SAT ≤P A
it follows that A is also NP-complete.
Anuj Dawar May 16, 2011 Anuj Dawar May 16, 2011