L14 - Problems in NP Flashcards
What does NP stand for?
Non-deterministic Polynomial Time
What does it mean if a problem is in NP?
A problem for which an algorithm doesn’t exist to generate a solution in polynomial time, but a solution verifier program exists that operates in polynomial time.
Explain how we know all P is in NP…
Since all problems in P can generate solutions in polynomial time, they can also verify solutions in polynomial time. Thus all P is in NP.
Explain how the TSP is a problem in NP…
TSP can generate solutions in EXP time. But solutions (paths) can be verified in P time.
What does it mean if a problem is NP-Hard?
- The problem is at least as hard as any problem in NP.
- If the problem is solved in polynomial time, all problems in NP can also be solved in polynomial time.
Doe NP-Hard problems have to be in NP?
No, but they have to be at least as hard as all problems in NP.
Define NP-Complete…
- Problems that are NP-Hard as well as in NP.
- If a solution to an NP-Complete problem is found in Polynomial time, all NP problems can be solved in Polynomial time.
What was the first problem that was proven to be NP-Complete?
SAT -> Satisfying assignment
- Assign boolean values to formula such that the formula is true.
How do we solve NP-Complete algorithms?
- Approximation algorithms -> Good enough solutions E.g ACO.
- Probabilistic algorithms -> Provide solution based on probable outcome.
- Exact algorithms -> For small inputs