Skip to main content

Get rhs and objective coefficients [python]

Answered

Comments

1 comment

  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    You can use the getAttr() method.

    m.update()

    A = m.getA()
    rhs = m.getAttr("RHS",m.getConstrs())
    obj = m.getAttr("Obj",m.getVars())

    print(A)
    print(rhs)
    print(obj)

    Best regards, 
    Jaromił

    0

Please sign in to leave a comment.