Using GRBQuadExpr without quadratic terms
AnsweredHello,
I'm solving a model that sometimes generates quadratic terms for the objective function, but sometimes only linear terms. Is there any performance penalty (wrt solve time, memory, etc) if I add a GRBQuadExpr object to the objective function that doesn't contain any quadratic terms? I.e. in those situations where I don't have any quadratic terms am I better off using a GRBLinExpr object instead?
I am using the Java API on top of Gurobi v9.5. Thanks!
0
-
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 try Gurobot, our chatbot interface offering instant, expert-level support. -
Hi Daniel,
In general, there should be no performance penalty when you use GRBQuadExpr in this case. To be 100% certain, you could test the performance for a bigger model of yours which does not have a quadratic objective.
Best regards,
Jaromił0
Post is closed for comments.
Comments
2 comments