Specifying datatype in JuMP expressions and constraints to save memory

You may be able to reformulate as a linear program, or at least a linearly-constrained one. This may not help the memory by added even more objects, but it may help the solver.

Since r_i_j and y_i_k are binary variables, their product can be replaced with an additional variable and four sparse inequalities. This is the McCormick envelope, but enforcing binary variables means it is an exact reformulation (e.g. cf. https://optimization.mccormick.northwestern.edu/index.php/McCormick_envelopes).

Setting x = ry, with r and y binary variables, we can replace any instance of ry with x and add the following:

x \geq 0 \\ x \geq r + y -1 \\ x \leq r \\ x \leq y \\

Also, I may be missing something, but could you not cancel or remove y_i_k[i, k] in the above constraint anyway since it does not depend on the index of summation?

1 Like