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]
3. Show that there exists a polynomial time algorithm for deciding whether a 2-CNF formula is...
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...