Skip to main content

Model contains large quadratic objective coefficient range.

Comments

2 comments

  • Silke Horn
    Gurobi Staff Gurobi Staff

    Hi,

    Scaling a constraint by an arbitrary factor does not change the solution of your model. It may, however, change the numerical properties and -- especially for numerically challenging models -- this can also lead to slightly different solutions (e.g. due to different rounding errors). Also note that the absolute tolerances (such as FeasibilityTol or IntFeasTol) will stay unchanged with scaling. So e.g. multiplying a row by 1/2 will allow twice as big a violation. We usually recommend scaling your constraints so that a violation of about 1e-6 is negligible.

    The NumericFocus parameter lets Gurobi be more careful with numerical calculations. (E.g. it uses tighter tolerances such as the Markowitz tolerance, a smaller step length for barrier and less aggressive cuts.) Do higher values help?

    Did you switch of crossover for your run? What happens with crossover?

    The most reliable fix would be to revisit your model formulation and try to improve the numerics. Maybe our Numerics Guidelines contain some helpful information.

    Silke

    0
  • Soufyan Zayou
    Gurobi-versary
    Conversationalist
    Curious

    Hi Silke,

    Thanks for your response. I have still a couple of questions based on your answer.

    Which numerical properties may change when you use scaling? Could you give examples?

    Furthermore, you say: "We usually recommend scaling your constraints so that a violation of about 1e-6 is negligible". How could I check which scaling number leads to the fact that a violation of 1e-6 is neglible?

    A NumericFocus of 1 changes the solution slightly (and is still wrong), and a NumericFocus of 2 gives the same solution as the original solution. This seems strange to me. Is there an explanation why for a NumericFocus of 1 the solution is slightly different from the original solution and a NumericFocus of 2 gives the same solution as the original solution?

    Furthermore, I did not do anything with the parameter crossover (so it has its default value), because it is stated in the documentation that crossover is not available for QP models. However, I still tried it: With params.crossover =0 the solution does not change and when I set params.crossover = -1 the solution also does not change. So, it seems that crossover doesn't have an influence on the solution. What does that mean? 

    Finally, I changed FeasibilityTol and IntFeasTol from the default value, respectively 1e-6 and 1e-5, to the minimum and maximum value (1e-9 and 1-e2 for FeasibilityTol and 1e-9 and 1e-2 for IntFeasTol). These changes also did not change the original solution, but that also seems strange.

    Kind regards

     

    0

Please sign in to leave a comment.