Lecture 6 - Classes P and NP Flashcards
What does the class P contain?
All decision problems that can be solved in polynomial time.
What does the class NP contain?
decision problems solvable in non-deterministic polynomial time-
What is a non-determinisitc algorithm?
an algorithm that can make non-determinisic choices i.e. it can guess, hence it gives different answers every time it is run
Is P contained within NP?
Yes, deterministic is just a special case of non-deterministic
containment?
P within NP, but NP not in P
Is the relationship between P and NP solved?
NO
What is a non-deterministic algorithm?
an algorithm with a non-deterministic choice
Is each execution of a NDA the same?
no
When does an NDA solve a problem? IS it always?
if there is some execution that return yes
or there is no execution that returns yes (which is no)
doesn’t always solve
How do we know an NDA ‘solves’ a problem in poly-time?
some exection for the instance returns yes when the number of steps is bounded by a polynomial in the input
no execution for that instance return yes for no
Are NDAs useful in practice?
No
Example of when NDA can be used?
In graph colouring to randomly select colours for each vertex and then check if the solution is valid.
What are the stages of NDAs?
- make a guess (non deterministic)
- check (in poly time and deterministic)
- stop and return