Question

In: Computer Science

Show that the following problem is NP-hard. Input: A boolean function in CNF such that every...

Show that the following problem is NP-hard.

Input: A boolean function in CNF such that every clause has at most three literals and every variable appears in at most three clauses.

Output: An assignment that evaluates the given function TRUE.

Solutions

Expert Solution

Now consider the Almost-SAT problem which is defined below:
Input: A CNF formula F having m clauses in n variables x1, x2, . . . , xn. There is no
restriction on the number of variables in each clause.
• Output: YES if there is an assignment to the variables which satisfies exactly m − 1
clauses, and NO otherwise.
For example, given the boolean formula F to be
F = (x1 ∨ x2) ∧ (x1 ∨ x¯3 ∨ x¯4 ∨ x5) ∧ (¯x2) ∧ (x2 ∨ x5)
Here is one assignment to the variables which satisfies all four clauses: x1 = T, x2 = F, x3 =
F, x4 = T, x5 = T. So the expected output of SAT on this example will be YES.
This formula also has an assignment which satisfies exactly 3 of the 4 clauses: x1 = T, x2 =
T, x3 = F, x4 = T, x5 = T. So the expected output of Almost-SAT on F is also YES.
The goal of this problem is to show that Almost-SAT is NP-complete.
We will first prove that Almost-SAT is in NP. A problem is said to be in NP
if a solution to the problem can be verified in polynomial time. Give a polynomial time
algorithm which takes as input an assignment to each variable, and verifies whether it is a
solution to Almost-SAT or not.
SOLUTION:
Loop through all the clauses and check whether each of them is satisfied. Maintain a global
counter, and check whether it equals to m − 1 at the end.
This algorithm runs in poly time because there is at most m clauses.


Related Solutions

What is NP? What is P? What is NP-complete? What is NP- hard?
What is NP? What is P? What is NP-complete? What is NP- hard? Give brief definitions. Give an example of an NP- complete problem. Is P equal to NP?
Show that if P=NP then there is a polynomial-time algorithm for the following search problem: given...
Show that if P=NP then there is a polynomial-time algorithm for the following search problem: given a graph, find its largest clique.
Prove that the 0/1 KNAPSACK problem is NP-Hard. (One way to prove this is to prove...
Prove that the 0/1 KNAPSACK problem is NP-Hard. (One way to prove this is to prove the decision version of 0/1 KNAPSACK problem is NP-Complete. In this problem, we use PARTITION problem as the source problem.) (a) Give the decision version of the O/1 KNAPSACK problem, and name it as DK. (b) Show that DK is NP-complete (by reducing PARTITION problem to DK). (c) Explain why showing DK, the decision version of the O/1 KNAPSACK problem, is NP-Complete is good...
What is P-Problem? What is NP-Problem? What is NP-Complete problem?
What is P-Problem? What is NP-Problem? What is NP-Complete problem?
show that every function can be expressed as the sum of an even function and an...
show that every function can be expressed as the sum of an even function and an odd function and that there is only one way to do this.
Show Integer Programming is NP-complete.
Show Integer Programming is NP-complete.
For the Boolean function F = x + yz’+ x’z Show the truth table. Simplify F...
For the Boolean function F = x + yz’+ x’z Show the truth table. Simplify F by using k-map as SoP form.
computer organazation , Boolean algebra1. Show the Boolean algebra reduction to minimal form for each....
computer organazation , Boolean algebra1. Show the Boolean algebra reduction to minimal form for each. Show each step, and cite the rule number which allows it.a . (AB)’ (A’ + B) (B’ + B)b . A’(A+B) + (B + A)(A + B’)
(A) Minimize the following Boolean expression as much as possible and Design the obtained function with...
(A) Minimize the following Boolean expression as much as possible and Design the obtained function with NAND universal logic gates Y = AB + A(B+C) + B (B+C) (B) Design a logic gate circuit diagram ( combination circuit ) that accepts a 3 - bit BCD number and generates an output binary number equal to the square of input number.
Problem 3: A firm has the following production function: ?(?, ?) = √?√?. A) Show whether...
Problem 3: A firm has the following production function: ?(?, ?) = √?√?. A) Show whether this firm’s technology exhibits constant, increasing, or decreasing returns to scale. B) What is the firm’s Technical Rate of Substitution? C) What is the optimality condition that determines the firm’s optimal level of inputs? D) Is the marginal product of input ? increasing, constant, or decreasing in ?? E) Suppose the firm wants to produce exactly ? units and that input ? costs $??...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT