(20 pts.) 2SAT. In the 2SAT problem, you are given a set of clauses, where each...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
(20 pts.) 2SAT. In the 2SAT problem, you are given a set of clauses, where each clause is the disjunction (OR) of two literals (a literal is a Boolean variable or the negation of a Boolean variable). You are looking for a way to assign a value true or false to each of the variables so that all clauses are satisfied - that is, there is at least one true literal in each clause. For example, here's an instance of 2SAT with five clauses and four variables: (x₁ V₂) ^ (₁ Vŵ3) ^ (X1 V x₂) ^ (ŵ3 V X4) ^ (ŵ1 V x4). This instance has a satisfying assignment: set x₁, x2, x3, and x4 to true, false, false, and true, respectively. Given an instance of 2SAT with n variables and m clauses, construct a directed graph G = (V,E) as follows: ● Go has 2n nodes, one for each variable and one for its negation. Go has 2m edges: for each clause (a vß) of þ (where a and 3 are literals), Go has an edge from the negation of a to ß, and one from the negation of ß to a. (a) Show that if Go has a strongly connected component containing both x and its negation ✰ for some variable x, then o has no satisfying assignment. (b) Now show the converse of (a): namely, that if none of Go's strongly connected components contain both a literal and its negation, then the instance & must be satisfiable. To prove this, show that the following algorithm results in a satisfying assignment: repeatedly pick a sink strongly connected com- ponent of Go. Assign the value true to all literals in the sink and assign false to their negations, delete all of the nodes in the sink, and repeat. (Hint: Consider case analysis on when each literal of a clause is assigned a value.) (c) Starting from a given instance of 2SAT, use everything discussed above to show that it can be solved in linear time. (20 pts.) 2SAT. In the 2SAT problem, you are given a set of clauses, where each clause is the disjunction (OR) of two literals (a literal is a Boolean variable or the negation of a Boolean variable). You are looking for a way to assign a value true or false to each of the variables so that all clauses are satisfied - that is, there is at least one true literal in each clause. For example, here's an instance of 2SAT with five clauses and four variables: (x₁ V₂) ^ (₁ Vŵ3) ^ (X1 V x₂) ^ (ŵ3 V X4) ^ (ŵ1 V x4). This instance has a satisfying assignment: set x₁, x2, x3, and x4 to true, false, false, and true, respectively. Given an instance of 2SAT with n variables and m clauses, construct a directed graph G = (V,E) as follows: ● Go has 2n nodes, one for each variable and one for its negation. Go has 2m edges: for each clause (a vß) of þ (where a and 3 are literals), Go has an edge from the negation of a to ß, and one from the negation of ß to a. (a) Show that if Go has a strongly connected component containing both x and its negation ✰ for some variable x, then o has no satisfying assignment. (b) Now show the converse of (a): namely, that if none of Go's strongly connected components contain both a literal and its negation, then the instance & must be satisfiable. To prove this, show that the following algorithm results in a satisfying assignment: repeatedly pick a sink strongly connected com- ponent of Go. Assign the value true to all literals in the sink and assign false to their negations, delete all of the nodes in the sink, and repeat. (Hint: Consider case analysis on when each literal of a clause is assigned a value.) (c) Starting from a given instance of 2SAT, use everything discussed above to show that it can be solved in linear time.
Expert Answer:
Related Book For
Introduction to Algorithms
ISBN: 978-0262033848
3rd edition
Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest
Posted Date:
Students also viewed these programming questions
-
Maria has a bad eyesight and has to wear glasses ( minus ) 2 D . She tried to swim underwater wearing the glasses but the vision is not clear. She wiil buy underwater glasses. Compute the optical...
-
You are given a set of N sticks, which are lying on top of each other in some configuration. Each stick is specified by its two endpoints; each endpoint is an ordered triple giving its x, y, and z...
-
You are given a set of points S in Euclidean space, as well as the distance of each point in S to a point x. (It does not matter if x S.) (a) If the goal is to find all points within a specified...
-
A woman flies from Phoenix to Denver (a distance of 800 mi) at a rate 40 mph faster than on the return trip. If the total time of the trip is 9 hrs, what was her rate going to Denver, and what was...
-
A system consists of two springs connected in series and having the stiffness coefficients k1 and k2. Find the minimum work to be performed in order to stretch this system by 1
-
Today, you are purchasing a $85,000 20-year car loan at 6 percent. You will pay annually at the end of each year. What is the amount of each payment?
-
An experiment consists of five draws from a pack of cards. Denoting the outcomes BRRBR, BRRRB,..., for black and red cards and assuming that all 32 outcomes are equally likely, find the probability...
-
TechPro offers instructional courses in e-commerce website design. The company holds classes in a building that it owns. Classify each of TechPros costs below as (a) Variable or fixed (b) Direct or...
-
Question 1 Classic Sound is a start-up company that produces vinyl records for numerous record labels worldwide. The company has two full-time employees working in the production department while the...
-
A company wants to build a website where user can register themselves and buy/renew health insurance policies. Also, they can process claims from a separate section on the website. Once logged in,...
-
Prior to May 1, the Fortune Company had never had treasury stock transactions. A company repurchased 170 shares of common stock on May 1 for $8,500. On July 1, it reissued 85 of these shares at $53...
-
1. The dynamics of a fish population is described by the Richard's growth law dN = rN1. dt (1) where N = N(t) is the population size depending on the continuous time variable 1, and r and K are...
-
Let f(x) = A = -2 3x + 1 If h 0, then the difference quotient can be simplified as B = where A, B, C, and D are constants. (Note: It's possible for one or more of these constants to be 0.) Find the...
-
Consider the following system A11 0 2-422 = QA21 A22 [7]10-6 (S) where 21 R and 12 R2 are the states, y R2 is the output, and a is the positive parameter. (a) Determine if the matrix A is normal....
-
Your supervisor in the finance department at August Online Technology has asked you to create a worksheet for the flagship product that will project the annual gross margin, total expenses, operating...
-
(A) Consider any Mercer kernel defined by k(r.) = o(r) (2). o(r) (2). We are given a sample S = (21.22.) of n inputs. We can form the Kernel (Gram) matrix K as an n x n matrix of kernel evaluations...
-
CRITICAL REASON What is an argument from analogy? And why an argument fromanalogy is part of inductive reasoning? Give 1 example of each Argument from analogy 1) Argument from analogy support...
-
Time Solutions, Inc. is an employment services firm that places both temporary and permanent workers with a variety of clients. Temporary placements account for 70% of Time Solutions' revenue;...
-
Suppose that disk hardware allows us to choose the size of a disk page arbitrarily, but that the time it takes to read the disk page is a + bt, where a and b are specified constants and t is the...
-
Write an iterative version of RANDOMIZED-SELECT.
-
An n-input, m-output boolean function is a function from {TRUE, FALSE} n to {TRUE, FALSE} m . How many n-input, 1-output boolean functions are there? How many n-input, m-output boolean functions are...
-
An \(80 \mathrm{~kg}\) man standing on a frozen lake tosses a 0. 500 \(\mathrm{kg}\) football to his dog. (a) If the ball leaves his hands at \(15 \mathrm{~m} / \mathrm{s}\) relative to Earth, what...
-
A small block of wood of inertia \(m_{\text {block }}\) is released from rest a distance \(b\) above the ground, directly above your head. You decide to shoot it with your pellet gun, which fires a...
-
Draw before and after energy bars for the collision shown in Figure \(6.8 a\) and \(6.8 b\). Data from Figure 6.8 (a) Earth reference frame (b) Reference frame M (DEM == 0.20 m/s) = 0 FM2 ME NIZ E...
Study smarter with the SolutionInn App