X≤PY: Problem X polynomial reduces to problem Y if arbitrary instances of problem X can be solved using:
Polynomial number of computational steps
then polynomial number of calls to oracle that solves problem Y
We pay for time to write down instances sent to black box → instances of Y must be of polynomial size
If we have problem G, we can turn it to another problem G′ with polynomial time
example: graph G is maximum matching problem, add a source node and link to all nodes from A and all nodes from be link to a sink, therefore reduce to polynomial complexity of G′
Purpose. Classify problems according to relative difficulty.
Designing algorithms. If X≤PY and Y can be solved in polynomial-time, then X can also be solved in polynomial time.
Proving intractability. If X≤PY and X cannot be solved in polynomial-time, then Y cannot be solved in polynomial time.
Establishing equivalence. If X≤PY and Y≤PX, then X≡PY
Vertex Cover: Given a graph G=(V,E) and an integer k,
is there a subset of vertices S⊆V such that ∣S∣≤k, and for each edge, at least one of its endpoints is in S?
Claim: Vertex coverd ≡P Independent set
proof: we show S is an independent set iff V\S
- Let S be any independent set, consider an arbitrary edge $(u,v)$
- S is independent $\to u\not \in S$ or $v\not \in S\to u \in V\backslash S$ or $v\in V\backslash S$
- Thus $V\backslash S$ covers edge $(u,v)$
-
- Let V\S be any vertex cover, consider 2 nodes u∈S and v∈S
- Observe that (u,v)∈E since V\S is a vertex cover
- Thus, 2 nodes in S are joined by an edge →S is an independent set
Reduction from special case to general case
Set cover: Given a set U of elements, a collection S1,S2,...,Sm of subsets of U, and an integer k, does there exist a collection of ≤k of these sets whose union is equal to U?
Claim: Vertex-cover ≤P Set-cover
Proof: Given a VERTEX-COVER instance G=(V,E),k, we construct a set cover instance whose size equals the size of the vertex cover instance
Construction: Create SET-COVER instance: k=k,U=E,Sv={e∈E:e incident to v}
Certifier. Check that the permutation contains each node in V exactly once, and that there is an edge between each pair of adjacent nodes in the permutation