Get rhs and objective coefficients [python]
AnsweredI know gurobi have a getA() method to get constraint matrix. But how to get the rhs of all constraints and the objective coefficient vector?
0
-
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.
Comments
1 comment