Question: We say that a Boolean formula is in 2 - C N F if it is a conjunc - tion of clauses, each of which
We say that a Boolean formula is in if it is a conjunc
tion of clauses, each of which contains exactly two literals. In
class, we showed that the satisfiability problem for the formulas
in CNF is NPcomplete. In this problem, we will show that
the satisfiability problem for formulas is in P
First, we notice that any clause with two literals can be writ
ten as an implication in exactly two ways. For example,
is equivalent to both and notq while eg
is equivalent to both and
For any formula define the directed graph to
be the graph whose vertices are all literals that occur in and
in which there is an edge from literal to literal if and only
if the implication is equivalent to one of the clauses in
a If has variables and clauses, give an upper bound
on the number of vertices and edges in
b In Boolean logic, it can be proved that is unsatisfiable
if and only if there is a literal such that there is a
path in from to notx and a path from notx to Give
an algorithm for verifying that the graph satisfies this
property. What is the complexity of your algorithm?
c From b deduce that there is a polynomial time algorithm
for testing whether a CNF formula is satisfiable.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
