Answered step by step
Verified Expert Solution
Question
1 Approved Answer
?? Recall that a 2-SAT Instance ? consists of n variables x1xn and m clauses C1 where each clause Ci-li vli2 ?s the disjunction of
?? Recall that a 2-SAT Instance ? consists of n variables x1xn and m clauses C1 where each clause Ci-li vli2 ?s the disjunction of two distinct literals. In this problem you will develop a linear time algorithm to solve the problem by reducing the 2-SAT instance to a directed graph Go defined as follows Nodes: For each literal we add a node ve (2n nodes total) Notation: Given a node ve we use v7 to denote the node corresponding to L. For example Edges: For each clause C-IV 1, we add two directed edges (Unvo) and (vT've) Part 0 Suppose that we have a directed path P -v,v2 P-ve' . . . , , vey is a valid directed path in Part 1: Suppose that for some literal there is directed path from node ve to v in Go anad that there is also a directed path from vi to v1 in Gd. Show that the 2-SAT instance ? is not satisfiable. Part 2: Suppose that for every literal l the nodes ve and v7 are in separate connected components in Gl. Show that the 2-SAT instance ? is satisfiable. Part 3: Describe an O(n+m) time algorithm which solves the 2-SAT problem. If the 2- SAT formula ? is not satisfiable then the algorithm should output no-solution otherwise the algorithm should output a satisfying assignment. (Hint: You may use algorithms from previous homework sets as a blackbox) ?? Recall that a 2-SAT Instance ? consists of n variables x1xn and m clauses C1 where each clause Ci-li vli2 ?s the disjunction of two distinct literals. In this problem you will develop a linear time algorithm to solve the problem by reducing the 2-SAT instance to a directed graph Go defined as follows Nodes: For each literal we add a node ve (2n nodes total) Notation: Given a node ve we use v7 to denote the node corresponding to L. For example Edges: For each clause C-IV 1, we add two directed edges (Unvo) and (vT've) Part 0 Suppose that we have a directed path P -v,v2 P-ve' . . . , , vey is a valid directed path in Part 1: Suppose that for some literal there is directed path from node ve to v in Go anad that there is also a directed path from vi to v1 in Gd. Show that the 2-SAT instance ? is not satisfiable. Part 2: Suppose that for every literal l the nodes ve and v7 are in separate connected components in Gl. Show that the 2-SAT instance ? is satisfiable. Part 3: Describe an O(n+m) time algorithm which solves the 2-SAT problem. If the 2- SAT formula ? is not satisfiable then the algorithm should output no-solution otherwise the algorithm should output a satisfying assignment. (Hint: You may use algorithms from previous homework sets as a blackbox)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started