MIT 6.1220 — Lecture 13
Intractability (Part I)
§ Problem Types
We need to distinguish problems from instances.
The minimum cut problem asks for a minimal cut in any instance of a graph .
The shortest path problem asks for a shortest path on any instance of a graph .
The size of an instance is the number of bits needed to encode it.
The size of a graph is , roughly.
But actually, it's more like because each edge needs labels…
But actually, it's more complicated because it depends on the size of the edge weights, and so on…
We say an algorithm runs in time if it can solve any instance of size in time .
Remark. Instead of time, we could also consider space, or in-place-ness, or randomness as limited resources…
A problem is tractable if it has an algorithm with runtime for some constant , and intractable otherwise.
From lecture, we know MST, min-cut, and shortest-path are all tractable.
But max-cut and longest-path are not known to be tractable.
Max-cut can be approximated easily, though! But not longest-path…
There are many variants of problems.
Decision: Instances have YES / NO solutions.
Search: Instances have solutions of a certain quality or weight.
Optimization: Instances have solutions of a maximal quality or weight.
So the MST problem can have the following variants:
Decision: Does have a spanning tree of weight at most ?
Search: Find a spanning tree of of weight at most , if it exists.
Optimization: Find a minimum spanning tree of .
§ P, NP, coNP, EXP, and R
Only consider problems that are decision variants.
Definition (P). A problem is solvable in (deterministic) polynomial time iff there exists a (deterministic) algorithm and a constant such that for every instance , we have:
Definition (NP). A problem is solvable in non-deterministic polynomial time iff there exists a (deterministic) verifier algorithm and constants such that for every instance of size , we have:
All of min-cut, max-cut, min-path, and max-path are NP, with the desired being the cut / path itself.
Remark. Reminder that we're considering the decision variants of min-cut, max-cut, min-path, and max-path.
Definition (coNP). A problem is solvable in co-non-deterministic polynomial time iff there exists a (deterministic) verifier algorithm and constants such that for every instance of size , we have:
It's easy to find coNP problems by negating NP problems; “are all paths of weight ?”, for example.
Claim. If , then and .
Proof: The desired NP and coNP algorithms just run the P algorithm (negated, for coNP).
These are the possible relationships between P, NP, and coNP.

Claim. It is not possible that .
Proof: The intuition is that if a problem is in P, then NP and coNP are equally easy.
Formally, take any . Then , so . But then , done.
Definition (EXP). A problem is solvable in (deterministic) exponential time iff there exists a (deterministic) algorithm and a constant such that for every instance , we have:
Claim. All of P, NP, and coNP are in EXP.
Proof: Obviously because polynomial-time is faster than exponential-time.
For any (or ), we can solve by checking all possible certificates.
Remark. We know that . This is the Deterministic Time Hierarchy Theorem.
The reason why we care about EXP is because it's a “higher level” of difficulty than NP and coNP.
Definition (R). A problem is solvable iff there exists a (deterministic) algorithm such that for every instance , we have:
Remark. Primality testing is in P, which means it is solvable in time for some constant .
CYU: Why is here? This also implies primality testing is in NP; isn't that surprising?