Skip to main content

Objective Q not PSD

Answered

Comments

2 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?.
  • Eli Towle
    Gurobi Staff Gurobi Staff

    Hi Lei,

    This error means that your quadratic objective function is not convex. In other words, the \( Q \) matrix in your objective function \( x^\top Q x + c^\top x \) is not positive semi-definite (PSD).

    Gurobi 9.0 is able to solve problems with non-convex quadratic constraints and objectives. To enable this, set the NonConvex parameter to 2.

    Also, note that you can iterate over multiple indices within a single quicksum() function. E.g.:

    m = Model()
    x = m.addVars(5, 10, vtype=GRB.BINARY, name="x")
    m.addConstr(quicksum(x[i,j] for i in range(5) for j in range(10)) >= 1)

    I hope this helps. Thanks!

    Eli

    1

Post is closed for comments.