Question

3. Show that there exists a polynomial time algorithm for deciding whether a 2-CNF formula is satisfiable. Hint Note that any

0 0
Add a comment Improve this question Transcribed image text
Answer #1

let us consider a 2-CNF formula:-

(¬x∨y) ∧(¬y∨z)∧(x∨¬z)∧(z∨y)

where x and y are boolean variables.

and corresponding directed graph is:-

graph consists of 2n (n=number of variables) nodes, "one node for variable and one for negation of that variable" for each distinct variable in formula.

there exists a directed edge (α,β) in G iff there exists a clause ( α V β) in Formula.

we will show how to solve this problem using path searching algos in graph(e.g. breadth first search , depth first search),

since BFS and DFS algos are polynomially bounded.

We have the following efficient polynomial time algorithm for 2-CNF to decide satisfiability:-


1=> For each variable x find if there is a
path from x to ¬x and vice-versa (you are searching for cycle between variable x and its negation ¬x here actually).


2=>if any of these test cases(in first step) gets succeeded (means you hit the cycle), reject it as it then won't be satisfiable.

(hope you know what satisfiability and unsatisfiability is,if not comment out).


3=>Accept otherwise(means you did not get even a single cycle in your graph).

[and hence you get to conclusion whether that your formula is satisfiable in polynomial time as you are using BFS and DFS searching algos to find path in your first step of this algo which are polynomially bounded]

  • [A formula is unsatisfiable iff there exists a paths( or you can say cycle between x and ¬x) of the form x..¬x and ¬x..x]
Add a comment
Know the answer?
Add Answer to:
3. Show that there exists a polynomial time algorithm for deciding whether a 2-CNF formula is...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 4. The NOT-ALL-EQUAL 3SAT problem is defined as follows: Given a 3-CNF formula F, is there...

    4. The NOT-ALL-EQUAL 3SAT problem is defined as follows: Given a 3-CNF formula F, is there a truth assignment for the variables such that each clause has at least one true literal and at least one false literal? The NOT-ALL-EQUAL 3SAT problem is NP-complete. This question is about trying to reduce the NOT-ALL-EQUAL 3SAT problem to the MAX-CUT problem defined below to show the latter to be NP-complete. A cut in an undirected graph G=(V.E) is a partitioning of the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT