About the calculation speed

Answered

Comments

6 comments

  • Jaromił Najman

    Hi,

    The coefficient values in the first model are way below Gurobi's tolerances. This then very likely leads to numerical difficulties such as decisions made based on round-off errors, (almost) wrong cuts, too many / too few cuts, and more... We recommend to keep the coefficient range as small as possible, especially for quadratic problems. You can learn more about tackling numerics in our Guidelines for Numerical Issues.

    Best regards,
    Jaromił

    0
    Comment actions Permalink
  • Yanbo Fan

    Hi Jaromił, 

    Thank you very much for your answer. Because of your answer, I already know the reason of the problem. Do I have any other methods besides manual control of the calculation accuracy in the calculation process?

    Best regards,
    Yanbo

     

    0
    Comment actions Permalink
  • Jaromił Najman

    Hi Yanbo,

    Do I have any other methods besides manual control of the calculation accuracy in the calculation process?

    It is best to control the scaling of coefficient manually as far as possible. Obviously, this is not always possible. In this case, you might want to experiment with the NumericFocus parameter, which controls the effort put into numerical accuracy during algorithmic computations.

    Best regards,
    Jaromił

    0
    Comment actions Permalink
  • Yanbo Fan

    Hi Jaromił,

    Thank you again for your help.

    Best regards,

    Yanbo

     

    0
    Comment actions Permalink
  • Yanbo Fan

    Hi Jaromił,

    I'm sorry to trouble you again. I used numericfocus parameter, but the problem of slow solving speed has not been improved. Solver shows parameter numericfocus unchanged. 

    Is it the wrong way I use it?

     

    0
    Comment actions Permalink
  • Jaromił Najman

    Hi Yanbo,

    You have set the NumericFocus parameter to 0, which is the default value for this parameter. Thus, Gurobi reports "unchanged". You can see all available values and the default value for the parameter in its documentation and reported by Gurobi as

    Parameter NumericFocus unchanged
    Value: 0 Min: 0 Max: 3 Default: 0

    So in your case you should try something like

    model.setParam("NumericFocus", 3) # or 1 or 2

    The higher you set the value of the parameter the more effort does Gurobi spend to tackle numerical issues. Please note that just setting the parameter may not be enough to help with severe numerical issues. Additionally, increasing the NumericFocus usually results in a performance decrease. Thus, it is always best to improve the numerics manually before experimenting with parameters.

    Best regards,
    Jaromił

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk