IP bank Flashcards
elaborate on how we can model a non convex feasible region
The thing about non convex regions is that we cannot formulate a feasible region that is “either in this or in this etc” using regular LP. However, with IP, we can.
WE think of as “either we force set A of constraints to hold, or set B to hold”. We can also generalize it further.
The typical to do this is to add M(1-indicatorVariable) to the constraints. In the case where we have only two regions, this is fine.
the indicator variable will be set to choose one of them.
If we have many regions, where one of them must be chosen, we can do this:
for each region, we have an indicator variable.
Then we have a constraint that say that the sum of hte indicator variables MUST be equal to 1. This force one set of constraints to apply.
elaborate on how we can model a non convex function using IP
Assume it is piecewise linear. If not, we assume that we can appxoimate it using a piecewise linear approach.
Then we need a set of weights, and a set of indicator variables. We also need slopes/coefficients that will be the A-matrix.
and some pmore idk
Elaborate on knapsack problems
Extremely important: the knapsack problem is differnet for min and max problems.
For max, all the constraints must be <=.
for min problems, all constraints must be >=.
This allows us to make use of the knapsack property of the ratio between objective function coeffciients and corresponding technology coeffcients ot make greedy decisions.
The problem is generally defined as selecitng a set of objects, with the aim of maximizng value, subject to capacity constraints.
Elaborate on assignment problem
There are two braod classes:
1) Specific
2) General
THe specific assignment problem is concerned by using sets of equal size.
The general assignment problem has a different structure as it has typically different sized sets.
The regular specific assignment problem minimize cost, but probably could maximize something instead.
There are 2 constraints, which looks identical to each other, except for the fact that one of them sum over j, and the other over i. One for each set.
The generalized assignment problem is better described as “We have a set of machines that can do tasks, and we have many tasks. These tasks needs to be solved by the machines”.
Fun fact: If we take the generalized assignment problem, and remove the constraint that enforce each “task” to be assigned a machine, and also swap the objective to be maximization rather than minimization, we actually get a so-called “Multi-knapsack problem”. IMPORTANT: We must add a constraint that force each item to only be legally placed in ONE knapsack, so that the solver dont put the best object in each pack. This is done byt instead of removing the ∑xij=1 constraint, we make it an inequality: ∑xij<=1. Now, when summing over all the packs, a specific item is not required to be placed in a pack, but if it is, it can only be placed in one pack.
elaborate on the matching problem
THe matching problem is about making pairwise connections between elements in a single set. Each element MUST be connected to one, and only one, other element.
The matching problem is really about understanding how the objective function play along with the constraints. Because of this relation, there is not need to enforce symmetry or something similar. If we pick (i,j) to be an arc we set to 1, adding (j,i)
min z = ∑∑cij xij
s.t.
∑xij = 1, for all nodes
xij in {0,1}
elaborate on TSP
We are looking for a hamiltonian cycle.
We have n nodes, and we must visit all of them, and only once each.
there are two versions of this problem:
1) Symmetric
2) Asymmetric
The difference is whether they are having the same cost for arcs in oppåosite directions or not.
There are 3 constriant types:
1) Enforce that the leaving arc from each node is equal to 1
2) Enforce that the entering arc into each node is equal to 1
3) Enforce that there are no sub-tours allowed
The idea of the sub-tour elimination constraints is that in a set of n nodes, there can only be at most n-1 arcs. If there are more arcs than n-1, then there is a sub-tour in it.
IMPORTANT: These constraints apply only for proper subsets of N. This means that the subset of the entire set is not included here.
In real life, there will be a shit load of constraints for this problem.
elaborate on the symmetric TSP
since no direction is needed now, we drop an index.
xk represent arc k.
∑xk = 2
Elaborate on VRP
Vehicle Route planning
We care about the classical VRP problem.
We want to determine a set of routes for a set of vehicles so that given demands are satisfied.
There is a number of custoemrs, and they have demands.
We have a depot, which is where we have to return to each time we “use up” our vehicle capacity.
There is a cost in using an arc.
If we have only one vehicle, and the vehicle has basically unlimited capacity, the VRP can be solved as TSP.
There are many versions of VRP, but the classical one assumes that all vahivles have the same capacity.
We assume K vehicles.
We denote the demand of customer “i” as di.
cij represnet the cost of travelling from customer i to j.
We use i=0 to indicate depot.
we have variables:
yik = 1 if customer i is visited by vehicle k.
xijk = 1 if vehicle k go from i to j directly.
The problem is a nightmare to set up due to its many constraints.
For simplicity, it is often assumed that we have already made a number of subsets of possible routes. When doing this, we remove the capacity from consideration.
So, we just want to find a number of routes (routes are specified) so that we cover each customer.
This problem now becomes a set partitioning problem.
min z = ∑cjxj
s.t.
∑aij xj [j]= 1, for each i in I
∑xj = K
So, set partitioning + the number of routes must be equal to the number of vehicles we have.
why are there so many different ways to solve IP problems?
They all have differnet characteristics. The point is that the structure of an IP problem is important in terms of how easy or hard it is to solve. Some problems simply do not converge fast enough with the most general methods like branch and bound. Therefore, there is a real need of methods that can be used in various scenarios.
what are the most important strategies for solving IP problems?
1) enumeration
2) Relaxation and decomposition
3) Cutting plane methods
4) Heuristics
When are we considering heuristics?
If the problem is very difficult to solve, and we need a solution. With heuristics, there is no guarantee that the solution is optimal. This means that such methods are only viable if we can guarantee that the error is small enough
Is the number of variables important in IP?
Yes. but the problem structure is as well. One typically say that the number of integer variables and the problem structure determine the difficulty in solving it.
In comparison, LP problems are typically restricted in their number of constraints.
elaborate on constraints in IP
Consrtraints doesnt always make the solution time longer. This is because of the thing called valid inequalities that works very well with the relaxed problem, and reduce running time.
Elaborate on optimality conditions
In LP, we have KKT conditions that basiclaly guarantee optimality.
No such conditions exists for IP.
The best way to discuss optimality for IP, is to define a certain error that we are happy with, and continuously find pessimistic and optimistic bounds that grow towards each other (converge). The gap is the error.
Why do we care about models in IP? Why is it not enough that they describe the correct constraints? given the same feasible region, each solver will find the same solution?
The reason is because different model formulations will affect the LP relaxation. We use the LP relaxation as a tool to solve for optimistic bounds. in order to get more realistic optimistic bounds, we benefit from having a strong formulation of the model.
The question is then, what is a strong model?
What is a strong or a weak model+
We say that a model’s strenght depends on the gap between the feasible region of the LP relaxation and the convex hull.
Elaborate on the convex hull
The convex hull is the entire region/area/set of points that are defined as all convex combinations of a set of points.
In IP, we consider the set of feasible points, and use them to find all convex combinations. The area of all these points is the convex hull.
If we have a problem whose convex hull was available as linear constraints, we’d be able to run simplex (regular LP) and guarantee an Integer solution. Since we’d get a feasible pessimistic solution, and an optimistic solution at the same time that are equal, we know that we are done.
Define a valid inequality
A valid inequality is an inequality that is satisfied for all x in X. In other words, the inequality doesnt cut away any of the feasible points (feasible points that are obviously the integer soluitions).
What is hte point of valid inequalities
Get a better approximation of the convex hull. this in turn will make our solvers run faster.
when we consider a valid inequality, what is the goal of it?
It should be as strong as possible.
To relate strength to valid inequalities, we use the mathematical concept of a “face”. The goal is to generate valid inequalities that defines a face to the convex hull with the largest possible dimension. A face is a surface of the convex hull. The more surface we can cover with one valid inequality, the better our approximation will be.
Define a face
F = {x | x in X_c, ∑ajxj = b}
In other words, a face is defined as the set of points that are in the convex hull’s points AND are in the hyperplane of the constraint.
What are the strongest valid inequalities?
Facets. These have dimensions of n-1 when the convex hull has dimension n.
aim of the cutting plane methods
To approximate the convex hull better and better. if we systematically add valid inequalities, we know that if we find a solution that is integer feasible, it will be optimal (in regards to the LP relaxation).
In an iterative cutting plane method approach, what is “important”?
We want the cutting plane to cut away the current LP optimal solution. If we do not do this, the solution will not change in the next iteration
There are typically two ways to add cuts to a solution. Name em
Use a specified cutting plane method, like Gomory.
Or we can use problem specific cuts, like solving the separation problem.
elaborate on Gomorys
Gomory’s method gollow the general outline of a cutting plane method.
Start by solving LP relaxation. if Integer, we’re good.
if not, we must add a valid ineuqality that removes the current LP optimal solution.
Gomory use only the informaiton provided in the simplex tableau of hte optimal tableau.
Consider the current basic solution. for those basic variables that have a fractional solution, we can consider them. Typically, we take the one with the largest fractional value.
We take this constraint as it is specified in the final tableau.
xi + ∑aijxj = bi
We separate the integer part and fractional part. this is equivalent to taking a floor operation and storing the remainder as well.
xi + ∑(int(aij) + frac(aij))xj = int(bi)+frac(bi)
Re-allocate
xi - int(bi) + ∑int(aij)xj = frac(bi) - ∑frac(aij)xj
LHS consists of purely integers. Therefore LHS is integer. Therefore, RHS is integer.
frac(bi) can never be larger than or equal to 1. Same with frac(aij).
At the same time, they can never be negative.
Therefor,e the LHS is smaller than, or equal to 0.
this gives us:
xi - int(bi) + ∑int(aij)xj <= 0
relocate
xi + ∑int(aij)xj <= int(bi)
This is a valid inequality. It removes the fractional part of a solution (single basic variable) by only using logic in terms of what values it can be.
IMPORTANT: Recall that this will give is an equality that use slack variables. We dont want this. Therefore, we must perform a sutiable substitution by using the ORIGINAL problem formulation.