Gurobi python change value of the defined value
问题 I have a question about how to change a coefficient in the constraint. For example, I have the following constraint: lhs.addTerms(temp, x[i]) model.addConstr(cost, GRB.EQUAL, 1.0/a*lhs, 'cost_cons') If I want change "temp" in the next iteration, how to modify the model? Thanks very much 回答1: Could you give a little more information? What I think you want to do is change the coefficients of x[i] in that particular constraint. If that's it, then you should save the constraint by assigned it to