I add constraints to my model within the C++ API automatically based on user input.
I do not know in advance if the constraint given by the user will be linear or quadratic.
At the moment I will just build the model using GRBQuadExpr. I assumed that Gurobi would have a simple check to see if the objective and all constraints (even if given as GRBQuadExpr) are linear and call an LP algorithm. However, it seems that Gurobi is not doing that.
In my specific example, the model in the original .lp file can not be successfully solved (suboptimal termination) but when I remove all empty square brackets (" [ ] ") from the model and rename the constraints to, e.g., lc01, the model is optimized without a problem.
Is there already a way to enable the behavior that I want, or would this be a good candidate for a new feature?
Please sign in to leave a comment.