Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

?? 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

More Books

Students also viewed these Databases questions

Question

How would you measure your carbon footprint?

Answered: 1 week ago

Question

Discuss the states of accounting

Answered: 1 week ago

Question

Use a three-step process to develop effective business messages.

Answered: 1 week ago