Scaling can have a huge impact on the model's numerical properties, which can, in turn, affect both solution time and quality.
Gurobi does some scaling automatically (which can be controlled via the ScaleFlag parameter). However, only the linear programming (LP) part is scaled to improve the LU factorizations and the resulting linear systems' solvability. The mixed-integer programming (MIP) part is not scaled. So, it is beneficial to apply additional scaling when creating your model.
Recommendations for Scaling Models
With your understanding of the underlying model, you can probably find better ways to scale it than solely relying on the ScaleFlag mechanism. Specifically, you can scale the MIP part of the model directly.
Column Scaling: Start by scaling the columns (by choosing appropriate units) so that the values fall within a reasonable range.
Row Scaling: Next, scale the rows so that a violation of the corresponding constraint by 1e-6 (our default feasibility tolerance) is negligible.
Additionally, it may be practical, especially with large values, to reconsider the integrality of variables or to use proportions of a budget instead of absolute numbers.
Comments
0 comments
Article is closed for comments.