Skip to main content

Nonconvex problem considered convex by Pyomo/ Gurobi solver ! Weird?

Awaiting user input

Comments

1 comment

  • Jaromił Najman
    • Gurobi Staff Gurobi Staff

    All other constraints are convex / linear in this optimization problem, and so the gurobi solver will solve it without issues.
    Agree?

    Yes.

    The above is a NONCONVEX constraint and I see that Gurobi can only solve it by having :
    solver.options['NonConvex'] = 2.
    Do you agree with the above observations?

    Yes.

    Is there a way by pyomo / gurobi to tell us quickly if an objective function or if a constraint is convex or non convex? 

    I don't know about Pyomo but there is currently no way to ask Gurobi whether an objective function or a constraint is convex or nonconvex. One way would be to solve a model \(\min f(x)\) without constraints and check whether the NonConvex parameter has to be set. If not, then function \(f\) is convex or Gurobi has found a way to turn the optimization problem into a convex one. This can happen if, e.g., you have binary variables and one can add diagonal terms to make the \(Q\) matrix PSD by exploiting the property that \(b = b^2\) if \(b\) is binary.

    The title of you post states

    Nonconvex problem considered convex by Pyomo / Gurobi. Weird?

    Could you please elaborate what exactly is weird? Do you have a case where you think that a function is nonconvex but then you don't have to set the NonConvex parameter?

    Best regards, 
    Jaromił

    0

Please sign in to leave a comment.