Skip to main content

Unsupported MQuadExpr addition- error in setting objective function

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?.
  • Jaromił Najman
    • Gurobi Staff Gurobi Staff

    Hi,

    Currently, binary operations for MQuadExpr and QuadExpr objects are not supported. One way to make your code work would be to work with addVars instead of addMVar

    s1=m.addVars(3,N)
    obj1=0
    for k in range(0,N):
    for i in range(0,3):
    obj1=obj1+s1[i,k]*s1[i,k]

    Best regards,
    Jaromił

     

    0

Post is closed for comments.