Scaling variable in MIP
AnsweredI came across this article https://www.gurobi.com/documentation/current/refman/advanced_user_scaling.html when learning how to better scale the variables. I'm working on a MIP model and trying to scale down the righthand sides of inequalities but it makes the coefficients of constraints very small. How small is too small compared to the default tolerances setting?
The advanced_user_scaling mention to also scale the x coefficient. Is this possible in a MIP problem? I can't think of how it can be done when the x can only be 0 or 1. Would it be like if I want to scale it up by 100 I would create a variable that can only be 0 or 0.01?

Hi Bryan,
When scaling the model, we propose to consider the following steps
 Scale your variables and constraints to get reasonable coefficients
 First, consider the units of your variables:
For example: If you deal with millions of dollars, do not use cents or dollars as a unit. Instead use thousands or millions. (Tons instead of grams, kilometers instead of meters, ...)  If you deal with millions of dollars, do you need exact integral cent values?
 Scale constraints so that coefficients get closer to 1
 Use integral data wherever possible, e.g. 1*x + 2*y = 3 better than 0.3333333*x + 0.66666666*y = 1
As mentioned in https://www.gurobi.com/documentation/current/refman/advanced_user_scaling.html the variable coefficients should not be smaller than 10e3.
If your model only contains binary variables, this is fine. But also here the range of the coefficients should not be larger than 10e6 and also within [10e3, 10e6].
I hope this helps,
Marika0 
Hi Marika,
Thanks for the response. I understand the part of scaling the coefficient of all variables together for one constraint. My question is that how we can scale one variable for all the constraints like the article but in a MIP model where the variable should be binary. In the article it replace the x with x' where x=10^5x' for all the constraints.
Bryan
0 
Hi Bryan,
You are right. The substitution discussed in the article can be done with continuous variables but not with binary (or integer) variables. In this case, it might help to rethink the unit of the variable or if the constraint can be modeled differently.
I think you have a commercial license with us. You are welcome to create a support request via the Gurobi Help Center, share the model with us, and discuss scaling or numerics in more detail.Best regards,
Marika0
Please sign in to leave a comment.
Comments
3 comments