Skip to main content

How to determine the speed bottleneck of my Model?

Answered

Comments

4 comments

  • Official comment
    Simranjit Kaur
    Gurobi Staff Gurobi Staff
    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?.
  • Matthias Miltenberger
    Gurobi Staff Gurobi Staff

    Hi Jiangfei,

    You are trying to solve a model with quite a lot of nonlinear constraints - this can be pretty hard even if the number of variables is not very large.

    One crucial thing you can see from the log is that the dual bound is not moving from 0. This can make it harder for the solver to find a good search direction. You may be able to improve this by trying to use a different formulation of the problem.

    You also didn't show the final statistics that are printed at the end of the run. These show the number of cutting planes that have been added to the model during the optimization. You might want to try different settings for the Cuts parameter to influence this part of the solver.

    You can also see that the number of iterations to solve each node is pretty high (1000-2300) compared to the number of iterations necessary to solve the root relaxation (7333). You may want to try a different NodeMethod to check whether you can improve the time it takes to solve these node relaxations and hence to traverse the tree.

    Finally, you should try running our automated tuning tool. Just be sure to set the correct tuning target since you don't have a useful MIP gap or dual bound available.

    Best of luck with the tuning!
    Matthias

    0
  • Jiangfei DUAN
    Gurobi-versary
    Conversationalist
    Curious

    Hi, Matthias,

    Thanks a lot, I am trying to follow your advices. But I find, maybe the best way to speed up is to reformulate my model with linear constraints only...

    Besides, I have a question. I think quadratic constraint and general constraint are nonlinear constraints of different types. For these two type nonlinear constraints, which one is more difficult for solver to optimize?

    Best,

    Jiangfei

    0
  • Matthias Miltenberger
    Gurobi Staff Gurobi Staff

    Hi Jiangfei,

    Please excuse me for not coming back earlier.

    Probably the most important feature to determine the difficulty of a non-linear model is whether it is convex or not. You should always try to choose a convex formulation of your constraints, if possible.

    Cheers,
    Matthias

    0

Post is closed for comments.