P, NP, NP-Completeness, NP-Hardness, Undecidability Flashcards
Are all P problems NP?
Yes
What is NP?
Problems for which solutions can be verified in polynomial time
If a problem is in NP, and can’t be proven to be P, what do we say about it?
It’s not known to be P.
What is P?
NP problems that have polynomial time solutions.
What is polynomial time?
Complexity that varies entirely as a function of the input size.
What is the significance of P=NP?
It would mean all algorithms with polynomial time verification (NP) can also be solved in polynomial time (P), which would be huge.
What is NP-Hard?
Problems with no known polynomial solutions.
How are the difficulties of NP-Hard and NP problems related?
An NP-Hard problem is at least as hard as the hardest NP problems.
How are NP-Hard and NP related?
NP-Hard problems can be in NP, but also can be outside NP. If outside NP, we can’t verify it in polynomial time. The hardest NP problems are also NP-Hard.
How do you prove that a problem is NP-Complete?
- Prove it’s in NP by showing that it has a polynomial time verification
- Prove it’s NP-Hard by reducing a known-NP-Complete problem to it in polynomial time (inputs and outputs)
What must you cover when proving that an unknown problem is NP-Complete by reducing a known-NP-Complete problem to it?
- Inputs to the known-NPC can be converted to the unknown problem in polynomial time
- Solution to the unknown problem can be converted back to the known-NPC in polynomial time
- If there is a solution to the unknown problem, there is a solution to the known-NPC
- If there is no solution to the unknown problem, there is no solution to the known-NPC
How do you prove that a problem is NP-Hard?
Prove that a known NP-Hard or NP-Complete problem can be reduced to it. (Does not require proof of being in NP)
How are the difficulty of NP-Complete and NP related?
NP-Complete problems are the hardest NP problems.
What is Undecidable?
No algorithm can solve the problem for every input (but maybe some), even with unlimited time and space.
What is the Halting Problem?
An Undecidable problem built on a contradiction which proves that Undecidable problems exist. It is not possible to solve the Halting Problem.
What is the idea behind the Halting Problem?
Suppose we have an algorithm Terminator(P, I) that solves the Halting Problem for every input. We recursively call it in the Halting Problem to show that it can’t terminate: Harmful(J): (1) If Terminator(J, J): Goto (1) Else Return()
If a problem is P, is it NP, NP-Hard, NP-Complete, Undecidable?
NP