Is there a simple way to reduce the value of positive slack variables in MILP?

290 Views Asked by At

Recently, I have been learning optimization, and my optimization problem, (minimization), is encoded in a MILP solver which tells me it's infeasible for my model. Hence, I introduced a few positive/negative slack variables. Now, I get a feasible solution, but the positive slack variables are way bigger than what I can accept. So, I gave penalties/weights to those variables (multiplied by large numbers), hoping that the MILP solver would reduce the variables, but that didn't work (I got the same solution) Is there any approach to follow, in general, when the slack is too large? Is there a better way to pick the slack variables, in general?

2

There are 2 best solutions below

1
On BEST ANSWER

A common pitfall for people new to mathematical programming/optimization is that variables are non-negative by default, that is, they always have an implied lower bound of 0. Your mathematical model may not specify this explicitly, so those variables might need to be declared as free (with a lower bound of -infinity).

In general, you should double-check your model (as LP file) and compare it to the mathematical formulation.

3
On
  1. Add both to the objective with a penalty coefficient.
  2. Or add some upper bounds to the slacks.