Transforming binary variables into integer variables during presolve
AnsweredDear Gurobi-team,
I observed that Gurobi is transforming binary variables into integer variables during presolve, see the following log:
Optimize a model with 174435 rows, 134010 columns and 1311832 nonzeros
Model fingerprint: 0x382e469f
Model has 18 quadratic constraints
Variable types: 109998 continuous, 24012 integer (24012 binary)
Coefficient statistics:
Matrix range [1e-13, 1e+02]
QMatrix range [4e-06, 1e+00]
QLMatrix range [1e+00, 1e+00]
Objective range [3e-02, 1e+06]
Bounds range [1e+00, 1e+02]
RHS range [5e-18, 8e+01]
Warning: Model contains large matrix coefficient range
Consider reformulating model or setting NumericFocus parameter
to avoid numerical issues.
MIP start from previous solve did not produce a new incumbent solution
Presolve removed 126913 rows and 84118 columns (presolve time = 5s)...
Sparsify removed 53864 nonzeros (10%)
Presolve removed 128831 rows and 86041 columns
Presolve time: 8.83s
Presolved: 45622 rows, 50389 columns, 498606 nonzeros
Presolved model has 2420 quadratic constraint(s)
Variable types: 35813 continuous, 14576 integer (14518 binary)
Deterministic concurrent LP optimizer: primal and dual simplex
Showing primal log only...So after presolve there are (14576-14515=) 58 integer variables.
In principle, I am fine with Gurobi generating integer variables if it believes this to be appropriate.
I am also not surprised that Gurobi recognizes the integer variables, as I expressed all integer variables as binary variables in advance.
But what I don't understand is that the transformation into integer variables is possible, since all binary variables appear as bilinear products in quadratic constraints. The reason for my conversion of the integer variables into binary variables in advance was because I wanted to make it possible to linearize the bilinear products.
Can the latest version of Gurobi (I am using 12.0.1) also linearize bilinear products with integer variables? If so, how?
Or are integer variables generated in addition to the binary variables (e.g., i = b_1 + b_2 + ...)?
Thank you very much
Thomas
-
Hi Thomas,
I observed that Gurobi is transforming binary variables into integer variables during presolve
I don't think this can be deduced from the log. I think it is far more likely that what you are observing is a conversion of continuous variables to integer. For example if we have integer variables x and y, and continuous variable z, and we can deduce that x + y = z + 2 then we know that z is "implied integer", and changing it to be integer will help. There are of course other ways we could deduce a continuous variable is "implied integer".
Can the latest version of Gurobi (I am using 12.0.1) also linearize bilinear products with integer variables? If so, how?
It is possible to linearize products of integer variables, by using a transformation to binary variables - see this post https://support.gurobi.com/hc/en-us/community/posts/14379942279057-Linearizing-product-of-two-integer-variables
In saying that, I don't think Gurobi is doing this in general, but perhaps it might within certain heuristics.
- Riley
0 -
Hi Riley Clement and thanks for your help.
Even though I don't know where Gurobi found the implied integers in the model, that might be the case. Thanks for pointing that out - I hadn't thought of that at all.
I knew that bilinear products of integer variables can be linearized using binary transformation, but it might have been possible that Gurobi had found a way to linearize products of integer variables without that transformation.
0
Please sign in to leave a comment.
Comments
2 comments