Linear Programming Flashcards
What is the main method of solving linear programs?
The simplex algorithm. Begin at a random vertex, repeatedly look for an adjacent vertex connected by an edge of the feasible region of better value. A local optimum is guaranteed to be the global optimum.
What runtime is solving an ILP?
NP-Hard
What runtime is solving an LP?
Polynomial
What are the cases where you can’t solve a linear program?
- Infeasible. Constraints can’t be simultaneously satisfied.
- Unbounded. You can shoot endlessly for a higher number to maximize the objective.
What is the mathematical form of an LP (Primal)?
n variables, m constraints
max c^T x
Ax <= b
x >= 0
What’s the difference between LP and ILP?
Aside from runtime, ILPs are constrained by x must be integers.
How do solutions to LP and ILP relate?
ILP solutions are always a subset of LP solutions, but are not guaranteed to be optimal LP solutions.
How do you solve an ILP (approximation)?
- Take a problem and convert it into an ILP
- Remove the integer constraints of ILP to get an LP problem
- Solve the LP problem as you would normally using Simplex
- Take the optimal solution for the LP, and convert it to a feasible point for the ILP
Given a primal LP, how do you write the dual LP?
- Convert the Primal to Standard Form
- Dual LP is minimize
- Move terms around
a. Gather RHS of Primal as Dual minimization terms
b. Gather Primal x1 and put them as coefficients on the first row of Dual constraints, x2 as coefficients on the second row, etc.
c. Gather coefficients of Primal maximization as Dual RHS
What is the mathematical form of the Dual LP?
m variables, n constraints
min b^T y
A^T y >= c
y >= 0
How do you check if an LP has a solution?
Validate that it’s feasible and bounded by checking that the Primal and Dual LPs are feasible.
- If the Primal LP is not feasible, then there is no feasible solution.
- If the Dual LP is not feasible, then the problem is unbounded.
How do you check if an LP is feasible?
Add a new variable z and maximize it to see if it is positive.
max z
Ax + z <= b
x >= 0
If z >= 0, the LP is feasible. If z < 0, infeasible.
What is the weak duality theorem?
Feasible x for Primal LP <= Feasible y for Dual LP
c^T x <= b^T y
What is the strong duality theorem?
Primal LP is feasible and bounded iff Dual LP is feasible and bounded
Primal LP has an optimal x iff Dual LP has an optimal y
If the Primal LP is unbounded, what does that tell you about the Dual LP?
Infeasible