exam 3 Flashcards
what does NP stand for?
nondeterministic polynomial time
What is a search problem?
a problem where we can efficiently verify solutions (in polynomial time)
What is NP?
class of all search problems
What is P?
class of all search problems that can be solved in polynomial time (subset of NP)
Knapsack search
- Just like Knapsack, but you have a minimum (goal) as well as a max (B)
- Solutions just needs to have weights <= B and values >= goal
Examples of P problems
MST, LP
NP-Complete
NP problems that cannot be solved in polynomial time
IS Problem
NP-Complete. A set of vertices S of a graph is an independent set if there are no edges connecting any two vertices in the set. Have goal for minimum
What is NP-Hard
Problems at least as hard as NP-Complete, but not necessarily in the class NP. Must reduce NP-Complete to NP-Hard
Clique
A set of vertices such that for any pair of vertices in the set, there is an edge between them. Have goal.
How to reduce IS->Clique
Reverse the graph
Vertex Cover
A set of vertices is a vertex cover if for every edge at least one vertex is in the cover. Have budget b and want |S| <= b
Property of a vertex cover
S is a vertex cover if and only if !S (all vertices not in S) is an independent set
What problems do we have for NP-Complete proof?
SAT, 3SAT, Clique, Vertex Cover, IS, Subset Sum, Knapsack
Is LP in P or NP?
It’s in P
Is ILP in P or NP?
NP-Complete
what is a Vertex Corner?
one of the vertices in the LP graph is an optimum solution
How do we know if we’ve found the optimal solution in an LP?
If a vertex is better than its neighbors, then it’s a global optimal point (assuming bounded and feasible)
How to check if there is a feasible area in an LP?
Start at x = 0 and check all remaining constraints, if none are satisfied, there is no solution
Are strict inequalities (< or >) allowed in LP?
No
Max-Flow as an LP
f(e) for every edge objective function: max(sum of all flows out of s) subject to: for every edge 0<= f <= c for every vertex v except for s,t: incoming flow == outgoing flow
LP Standard Form
Max C^T(x) such that Ax <= b and x >= 0