Skip to main content

Callback for nonconvex QCP/MIQCP

Answered

Comments

2 comments

  • Silke Horn
    Gurobi Staff Gurobi Staff

    Hi,

    There are two issues with your code:

    Firstly, because of Gurobi's lazy update approach, model.getVars() returns an empty list at this point. This is one of the rare occasions where you need to call model.update() first.

    Secondly, if you want to add lazy constraints through a callback, you need to set the LazyConstraints parameter to 1.

    1
  • Can Li
    Gurobi-versary
    First Comment
    First Question

    Thanks. It works

    0

Please sign in to leave a comment.