Assume that N=NP . Give a polynomial-time algorithm for finding a satisfying assignment for a boolean formula φ, if one exists.
The algorithm can be as follows:
A = “On input φ, where φ is a boolean formula of variables x1, x2, x3, ..., xk
1. Run D on φ. If φ is not satisfiable, reject. Otherwise
2. For i from 1 to k
3. Replace all the xis in φ with 1, and simulate D on that.
4. If D accepts, permanently overwrite xi with 1, otherwise overwrite xi with 0
Analysis of the algorithm:
This algorithm is definitely in P, since k (the number of variables) is ≤ n.
Also the algorithm is accurate. It only gets to the “for loop” if it knows that the formula is satisfiable.
Assume that N=NP . Give a polynomial-time algorithm for finding a satisfying assignment for a boolean...
(complexity) prove: if P=NP, then there's an algorithm with a polynomial running time for the following problem: input: a boolean formula φ output: a satisfying assignment of φ if φ satisfiable. if φ not satisfiable, a "no" will be returned. explanation: the algorithm accepts φ as an input (boolean formula). if φ doesn't have a satisfiable assignment, a "no" is returned. if φ does have a satisfiable assignment, one of the satisfying assignment is returned,. so we assign 0 or...
2. Describe why finding a polynomial-time algorithm for a NP-complete problem would answer the question if P = NP. What would the answer be? (7-10 sentences minimum)
(Q4 - 30 pts: 15, 15) a) Give an O (n) time algorithm for finding the longest (simple) path in a tree on n vertices. Prove the correctness of your algorithm. Give a polynomial time algorithm for finding the longest (simple) path in a graph whose blocks have size bounded by a constant. Prove the correctness of your algorithm. b)
4. a) Define the concept of NP-Completeness B) Show that there is a polynomial time algorithm that finds a longest path in a directed graph, under the condition that A is NP-complete and A has a polynomial time algorithm.
a. Find a satisfying assignment for the following boolean formula: (x y z') ( x y' z) (w' x y') (w' x' z) b. What is the number of satistifying assignments for the boolean formula listed above.
Claim: It is known that any NP-complete problem will require exponential time (that is, a polynomial time algorithm for it is known to be impossible). TRUE or FALSE?
Hi, I'm confused about how to do this, any help is appreciated thanks! Give the specifications of a pseudo-polynomial time algorithm for Galactic Shortest Path. Hint: Given an instance of GSP such that G has n vertices and m edges, you may want to use a 5 dimensional m by n by n by L by R array. Give the specifications of a pseudo-polynomial time algorithm for Galactic Shortest Path. Hint: Given an instance of GSP such that G has...
9. Identify which of these problems are NP-complete and which can be exactly solved using a polynomial time algorithm (a) Finding the vertex cover in a line graph (b) Finding the maximum clique in a tree (c) Finding the independent set in complete graph (d) Finding the Hamiltonian cycle in a graph that has exactly one cycle
Suppose a problem can be solved by an algorithm in O(n2) as well as another algorithm in O(2n). Will one algorithm always outperform the other? Give an example of a polynomial problem. Give an example of a nonpolynomial problem. Give an example of an NP problem that as yet has not been shown to be a polynomial problem. If the time complexity of algorithm X is greater than that of algorithm Y, is algorithm X necessarily harder to understand than...
10 points (bonus) A propositional formula on n variables, P(ri,2,... ,Tn) is satisfiable if there exists an assignment of truth values (true or false) to its variables such that it evaluates to true. (a) Give an algorithm (pseudocode) that, given a formula P determines if it is satisfiable or not. Analyze your algorithm. b) Suppose that we are given a free" algorithm A that, given P and a partial assignment of truth values (that is, some variables are set to...