0% found this document useful (0 votes)
22 views

Where Can We Draw The Line?: On The Hardness of Satisfiability Problems

The document discusses the complexity of various satisfiability problems. It begins by introducing the objectives and known results. It then shows that 2SAT can be solved in polynomial time by reducing it to a graph reachability problem. However, Max2SAT is NP-complete as 3SAT can be reduced to a special case of Max2SAT.
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Where Can We Draw The Line?: On The Hardness of Satisfiability Problems

The document discusses the complexity of various satisfiability problems. It begins by introducing the objectives and known results. It then shows that 2SAT can be solved in polynomial time by reducing it to a graph reachability problem. However, Max2SAT is NP-complete as 3SAT can be reduced to a special case of Max2SAT.
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 25

Where Can We Draw The Line?

On the Hardness of
Satisfiability Problems

Complexity 1
©D.Moshkovits
Introduction
• Objectives:
– To show variants of SAT and check if
they are NP-hard
• Overview:
– Known results
– 2SAT
– Max2SAT

Complexity 2
©D.Moshkovits
What Do We Know?
• Checking if a propositional calculus
formula is satisfiable (SAT) is NP-
hard.

Example: propositional calculus formula

(xz(wx))(xy)y

Complexity 3
©D.Moshkovits
What Do We Know?
• We concentrated on a special case:
CNF formulas.

structure of CNF formulas

(...........)…(...........)

Complexity 4
©D.Moshkovits
What Do We Know?
maximal P
number of NP-hard
literals per
clause

4
We’ll
3 explore this!

2
1

Complexity 5
©D.Moshkovits
2SAT
• Instance: A 2-CNF formula 
• Problem: To decide if  is satisfiable

Example: a 2CNF formula

(xy)(yz)(xz)(zy)

Complexity 6
©D.Moshkovits
PAP 184-185

2SAT is in P
Theorem: 2SAT is polynomial-time
decidable.
Proof: We’ll show how to solve this
problem efficiently using path
searches in graphs…

Complexity 7
©D.Moshkovits
Searching in Graphs
Theorem: Given a graph G=(V,E) and
two vertices s,tV, finding if there is
a path from s to t in G is polynomial-
time decidable.
Proof: Use some search algorithm
(DFS/BFS). 

Complexity 8
©D.Moshkovits
Graph Construction
• Vertex for each variable and a
negation of a variable
• Edge (,) iff there exists a clause
equivalent to ()

Complexity 9
©D.Moshkovits
Graph Construction: Example
(xy)(yz)(xz)(zy)

x
y
x

y
z
z

Complexity 10
©D.Moshkovits
Observation
Claim: If the graph contains a path
from  to , it also contains a path
from  to .
Proof: If there’s an edge (,), then
there’s also an edge (,).

Complexity 11
©D.Moshkovits
Correctness
Claim:
a 2-CNF formula  is unsatisfiable iff
there exists a variable x, such that:
1. there is a path from x to x in the
graph
2. there is a path from x to x in the
graph

Complexity 12
©D.Moshkovits
Correctness (1)
• Suppose there are paths x..x and
x..x for some variable x, but there’s
also a satisfying assignment .
• If (x)=T (similarly for (x)=F):

() is false!

x  . . . x

T T F F
Complexity 13
©D.Moshkovits
Correctness (2)
• Suppose there are no such paths.
• Construct an assignment as follows:
 2. assign T to
x
1. pick an x all reachable
unassigned y vertices
literal , with x
no path from  3. assign F to
to , and  their negations
y
assign it T  y
z 4. Repeat until all
z
z vertices are assigned
Complexity 14
©D.Moshkovits
Correctness (2)
Claim: The algorithm is well defined.
Proof: If there were a path from x to
both y and y,
then there would have been a path
from x to y and from y to x.

Complexity 15
©D.Moshkovits
Correctness
A formula is unsatisfiable iff there are
no paths of the form x..x and x..x.

Complexity 16
©D.Moshkovits
2SAT is in P
We get the following efficient
algorithm for 2SAT:
– For each variable x find if there is a
path from x to x and vice-versa.
– Reject if any of these tests succeeded.
– Accept otherwise
 2SATP. 

Complexity 17
©D.Moshkovits
Max2SAT
• Instance: A 2-CNF formula  and a
goal K.
• Problem: To decide if there is an
assignment satisfying at least K of ’s
clauses.
Example: a 2CNF formula

(xy)
(yz)
(xz)
(zy)
Complexity 18
©D.Moshkovits
PAP 186-187

Max2SAT is in NPC
Theorem: Max2SAT is NP-Complete.
Proof: Max2SAT is clearly in NP.
We’ll show 3SATpMax2SAT.

(......)…(......) p (....)…(....)

Complexity 19
©D.Moshkovits
Gadgets 

Proof: By checking.
Claim: Let
(x,y,z,w) = (x)(y)(z)(w)
(xy)(yz)(zx)
(xw)(yw)(zw).
• Every satisfying assignment for (xyz)
can be extended into an assignment that
satisfies exactly 7 of the clauses.
• Other assignments can satisfy at most 6 of
the clauses.
Complexity 20
©D.Moshkovits
The Construction
• For each 1im, replace the i-th
clause of the 3-CNF formula ()
with a corresponding (,,,wi) to
get a 2-CNF formula.
• Fix K=7m.
Make sure this
construction is
poly-time

Complexity 21
©D.Moshkovits
Correctness
• Every satisfying assignment for the
3-CNF formula can be extended into
an assignment that satisfies 7m
clauses.
• If 7m clauses of the 2-CNF formula
are satisfied, each  has 7 satisfied
clauses, so the original formula is
satisfied.
Complexity 22
©D.Moshkovits
Corollary
 3SATpMax2SAT and Max2SATNP
 Max2SAT is NP-Complete. 

Complexity 23
©D.Moshkovits
Summary 
• We’ve seen that checking if a given CNF
formula is satisfiable is:
– Polynomial-time decidable, if every clause
contains up to 2 literals.
– NP-hard, if each clause may contain more than
2 literals.
• We’ve also seen Max2SAT is NP-hard.

Complexity 24
©D.Moshkovits
Conclusions 
• A special case of a NP-hard problem may
be polynomial time decidable.
• The optimization version of a polynomial-
time decidable problem may be NP-hard.

Complexity 25
©D.Moshkovits

You might also like