I am writing a Benders Decomposition type of algorithm where I need to modify some constraints. At the moment I remove and add contrarians with new values which doesn't make sense (It increases the computational time). I found GBRConstr.Set(GRB.DoubleAttr.RHS, newValue) to update the RHS but it doesn't work for me. Here is the code. I want to update the RHS of the these two sets of constraints (x_opt is input, which causes this change).
psp_constr1 = {}
psp_constr2 = {}
for i in stores:
for o in options:
for k in sizes:
psp_constr1[i,o,k] = psp.addConstr(z[(i,o,k)] <= sum(supply[(j,o,k)]*x_opt[(j,i,o)] for j in stores) )
for i in stores:
for j in stores:
for o in options:
if i!=j:
psp_constr2[i,j,o] = psp.addConstr(y[(i,j)] >= x_opt[(i,j,o)] )