About the calculation speed
AnsweredHi,
I'm solving a maximum concave problem. It's calculation speed is very slow. This is the LP file of my model.
When I simplify the model, the solution model contains the part about the decision variables, and the optimal solution can be obtained after four iterations. This is the LP file for the simplified model.
There is no difference between the two models except the coefficients of decision variables in the objective function. Why are their computing speeds so different?
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
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 -
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,
Yanbo0 -
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 -
Hi Jaromił,
Thank you again for your help.
Best regards,
Yanbo
0 -
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 -
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: 0So 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
Post is closed for comments.
Comments
7 comments