EXAM3 Flashcards
A List of Hard problems(NP COmplete)
3SAT
TSP
LOngest Path
3D Matching
Knapsack
IS
Integer Linear Programming
Rudrata Path
Balanced Cut
A list of Easy Problems
2SAT, HORN SAT
MST
Shortest Path
Bipartite Matching
Unary Knapsack
Independent set on trees
linear programing
euler path
min cut
SAT(C)
Input:C is a CNF with any number of variables and clauses
Output: Assignment of each variable such that the CNF is true
3SAT(C)
Input: C is a CNF whose clauses have at most 3 literals
Output: assignment of each variable such that the expression is true
CLique(G,k)
Input: G is an undirected unweighted graoh. k is the target size of the IS
Output: CLiquewith >= k vertices
Independent Set(G,k)
Input: G is an undirected unweighted graph. is the target size of the IS
Output: IS with >= k vertices
Vertex Cover(G,b)
Input: G is an undirected unweighted graph. b in the budget size of the vertex cover
Rudrata Path(G)
Input: G is an undirected, unweighted graph
Output: A cycle that visits each vertex in the grph just once
TSPSearch(G,b)
Input: G is an undirected weighted graph. b is the budget cost of the path
Output: A cycle that visits each vertex in the graph exactly once and returns to the original vertex and has a total cost <= b
SubsetSum(A, t)
Input: A is an array of integers. t is the target integer sum
Output: An array of integers which is a subset from A that sum to t
Knapsack search(W,V, B, g)
Input:W is the array of weights. V is the array of values. B is the capacity of the knapsack. g is the target value
Output: Array of items of total weight <= B and total value >= g
ZOE(A)
Input: An mxn matrix A all of whose entries are 0 or 1 such as Ax=1 where 1 denotes the all-ones vector
3D Matching(X,Y,Z)
Input:disjoint sets X,Y,Z of things to be matched. Collection of ordered triples X,Y,Z
Output: Macthes set of triples
Difference between IS and CLique
CLique is connected(all edges within S) and IS is disconnected(no edges within S)
SAT->3SAT
NP Proof
GIven an input we look for a solution if it exsits and return NO if it doesn’t
Given an input I to 3SAT and a solution S, we can tale each T/F assignent from S and check them in each clause of I. It is O(1) to check each clause. m clauses results in O(m)