Exam 3 - NP Reductions Problems Flashcards
If I want to assign bits to objects, choose a subset of objects, or partition objects into two different subsets, what problems might I reduce from?
SAT
k-SAT where k > 2
If I want to assign labels to objects from a small fixed set or partition objects into a small number of subsets, what problems might I reduce from?
k-Colorings
If I want to find a small subset satisfying some constraints, what problems might I reduce from?
Vertex Cover
If I want to find a large subset satisfying some constraints, what problems might I reduce from?
Independent Sets
Clique
If the number 3 naturally appears in the problem, what problems might I reduce from?
3SAT
If all else fails, what problems might I reduce from?
Knapsack search
3SAT
Subset sum
What contradiction proves that it’s impossible to have an algorithm that solves the halting problem?
Assume we have a halting algorithm H, such that
H(Program, Input)
returns true or false depending on whether the program would halt
We write program
D(Program):
if H(P,P):
# infinite loop
else:
return # halts here
Which shows us a contradiction if we run D(D)
What is the input of the SAT problem?
boolean formula f in CNF, with n variables and m clauses
What is the output of the SAT problem?
A satisfying assignment if one exists, NO otherwise
What is the input of the colorings problem?
undirected G = (V,E) and integer k > 0
What is the output of the colorings problem?
Assign each vertex a color in {1 , 2 , … , k} so that adjacent vertices get different colors, and NO if no such k-coloring exists for G
What is a solution for the Vertex Cover problem?
For a given G = (V,E), the vertices in S, a subset of V, is a vertex cover if they “cover every edge”, for every (x,y) in E either x and/or y is in S
What is a solution for the Independent Set problem?
For a given G = (V,E) subset of vertices S from V is an independent set if no edges are contained in S – for any two vertices x and y in S, there is no edge (x,y)
What is a solution for the Clique problem?
A clique is a fully connected subgraph – every vertex in the clique is connected to every other vertex
What is the knapsack-search problem?
Given input weights {w_1 , … , w_n} and values {v_1 , … , v_n} find a combination of items with weight less than B and value greater than g