22-intractability2
22-intractability2
Ghazaleh Parvini
▶ Reduction by equivalence
(Vertex-Cover ≤P Indept-Set and vice versa)
▶ Reduction by "gadgets"
Reduction by Gadgets: Satisfiability
▶ Terminology
Reduction by Gadgets: Satisfiability
▶ Terminology
Variables x1 , . . . , x n
Reduction by Gadgets: Satisfiability
▶ Terminology
Variables x1 , . . . , x n
Term xi or x̄i variable or its negation
Reduction by Gadgets: Satisfiability
▶ Terminology
Variables x1 , . . . , x n
Term xi or x̄i variable or its negation
Clause C = x̄1 ∨ x2 ∨ x̄3 “or” of terms
Reduction by Gadgets: Satisfiability
▶ Terminology
Variables x1 , . . . , x n
Term xi or x̄i variable or its negation
Clause C = x̄1 ∨ x2 ∨ x̄3 “or” of terms
Formula C1 ∧ C2 ∧ . . . ∧ Ck “and” of clauses
Reduction by Gadgets: Satisfiability
▶ Terminology
Variables x1 , . . . , x n
Term xi or x̄i variable or its negation
Clause C = x̄1 ∨ x2 ∨ x̄3 “or” of terms
Formula C1 ∧ C2 ∧ . . . ∧ Ck “and” of clauses
Assignment (x1 , x2 , x3 ) = (1, 0, 1) assign 0/1 to each variable
Reduction by Gadgets: Satisfiability
▶ Terminology
Variables x1 , . . . , x n
Term xi or x̄i variable or its negation
Clause C = x̄1 ∨ x2 ∨ x̄3 “or” of terms
Formula C1 ∧ C2 ∧ . . . ∧ Ck “and” of clauses
Assignment (x1 , x2 , x3 ) = (1, 0, 1) assign 0/1 to each variable
Satisfying assigment (x1 , x2 , x3 ) = (1, 1, 0) all clauses are “true”
Reduction by Gadgets: Satisfiability
▶ Terminology
Variables x1 , . . . , x n
Term xi or x̄i variable or its negation
Clause C = x̄1 ∨ x2 ∨ x̄3 “or” of terms
Formula C1 ∧ C2 ∧ . . . ∧ Ck “and” of clauses
Assignment (x1 , x2 , x3 ) = (1, 0, 1) assign 0/1 to each variable
Satisfying assigment (x1 , x2 , x3 ) = (1, 1, 0) all clauses are “true”
Reduction by Gadgets: Satisfiability
Reduction:
▶ Given 3-SAT instance Φ = ⟨C1 , . . . , Cm ⟩, we will construct an
independent set instance ⟨G, m⟩ such that G has an
independent set of size m iff Φ is satisfiable
▶ Return Yes if solveIS(⟨G, m⟩) = Yes
Reduction
x̅ 1 x1 x̅ 1
x2 x3 x̅ 2 x3 x̅ 2 x̅ 3
Reduction
x̅ 1 x1 x̅ 1
x2 x3 x̅ 2 x3 x̅ 2 x̅ 3
x̅ 1 x1 x̅ 1
x2 x3 x̅ 2 x3 x̅ 2 x̅ 3
x̅ 1 x1 x̅ 1
x2 x3 x̅ 2 x3 x̅ 2 x̅ 3
x̅ 1 x1 x̅ 1
x2 x3 x̅ 2 x3 x̅ 2 x̅ 3
x̅ 1 x1 x̅ 1
x2 x3 x̅ 2 x3 x̅ 2 x̅ 3
x̅ 1 x1 x̅ 1
x2 x3 x̅ 2 x3 x̅ 2 x̅ 3
x̅ 1 x1 x̅ 1
x2 x3 x̅ 2 x3 x̅ 2 x̅ 3
x̅ 1 x1 x̅ 1
x2 x3 x̅ 2 x3 x̅ 2 x̅ 3
x̅ 1 x1 x̅ 1
x2 x3 x̅ 2 x3 x̅ 2 x̅ 3
x̅ 1 x1 x̅ 1
x2 x3 x̅ 2 x3 x̅ 2 x̅ 3
x̅ 1 x1 x̅ 1
x2 x3 x̅ 2 x3 x̅ 2 x̅ 3
x̅ 1 x1 x̅ 1
x2 x3 x̅ 2 x3 x̅ 2 x̅ 3
x̅ 1 x1 x̅ 1
x2 x3 x̅ 2 x3 x̅ 2 x̅ 3
x̅ 1 x1 x̅ 1
x2 x3 x̅ 2 x3 x̅ 2 x̅ 3
3-SAT
Indept-Set SAT ▶ Y X
means Y ≤P X.
Vertex-Cover
Set-Cover
Toward a Definition of NP
EXP
NP
Poly-time solver. Algorithm A(s) such that A(s) = Yes iff correct
answer is Yes, and running time polynomial time in |s|
yes/no
s
Instance
Solver vs. Certifier
Let X be a decision problem and s be problem instance
(e.g., s = ⟨G, k⟩ for Independent Set)
Poly-time solver. Algorithm A(s) such that A(s) = Yes iff correct
answer is Yes, and running time polynomial time in |s|
yes/no yes/no
A C
s s t
Instance Instance Hint
Poly-time solver. Algorithm A(s) such that A(s) = Yes iff correct
answer is Yes, and running time polynomial time in |s|
yes/no yes/no
A C
s s t
Instance Instance Hint
Polynomial time?
Certifier Example: Independent Set
▶ Independent Set ∈ P?
Example: Independent Set
▶ Independent Set ∈ P?
▶ Unknown. No known polynomial time algorithm.
Example: Independent Set
▶ Independent Set ∈ P?
▶ Unknown. No known polynomial time algorithm.
▶ Independent Set ∈ P?
▶ Unknown. No known polynomial time algorithm.
Certify3SAT( ⟨Φ⟩, t)
▷ Check if t makes Φ true
P, NP, EXP
EXP
NP
EXP
NP
NP-
complete
NP
CIRCUIT-SAT
Problem: Given a circuit built of And, Or, and Not gates with
some hard-coded inputs, is there a way to set remaining inputs so
the output is 1?
Circuit-SAT
Problem: Given a circuit built of And, Or, and Not gates with
some hard-coded inputs, is there a way to set remaining inputs so
the output is 1?
s t
Instance Hint
Circuit-SAT
s t
Instance Hint
Circuit-SAT
s t
Instance Hint
s t
Instance Hint
s t
Instance Hint
s t
Instance Hint
v3 v4
v1 v2
A Circuit-SAT reduction
▶ Vertex Cover – Does G have VC of size at most k? (Counting
gadget is an example for v3 , v4 only)
v3 v4
2?
v1 v2
v4 ∧ ¬ ∧ 1?
v3 ∨ ¬ 0?
v2 ∨ ∧
v1 ∨ ∧ Cover?
∨ ∧
∨
Proving New Problems NP-Complete
Circuit-SAT
Constraint satisfaction
3-SAT
Packing
Indept-Set Ham-Cycle Graph-Coloring
Subset-Sum
Ham-Path
Partitioning
Vertex-Cover Traveling-Salesperson 0-1 Knapsack
Sequencing Numerical
Set-Cover
Covering