Question

Assume that N=NP . Give a polynomial-time algorithm for finding a satisfying assignment for a boolean...

Assume that N=NP . Give a polynomial-time algorithm for finding a satisfying assignment for a boolean formula φ, if one exists.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
  • If P = NP, then there is a deterministic Turing Machine D that solves SAT in polynomial time.

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.

  • Thus the “for loop” and D make it O(k)*O(time of D) => P * P = P (polynomial)

Also the algorithm is accurate. It only gets to the “for loop” if it knows that the formula is satisfiable.

Add a comment
Know the answer?
Add Answer to:
Assume that N=NP . Give a polynomial-time algorithm for finding a satisfying assignment for a boolean...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT