How to change the RHS for a set of constraints and solve the problem iteratively using JuMP?

Please try to format your code to make it more readable. This is explained in PSA: make it easier to help you.

It looks like you are create many constraints in nested loops, but always reuse the same identifier Demandsconst. You can not refer to all of these constraints with a single name.

Try moving the loops “into” the @constraint macro call and storing the constraint references in an array, like @constraint(IMTLP, Demandsconst[t in 1:n_echelons, ...], ...) as described in the JuMP docs.

Later you will have to update the right-hand side of all these constraints individually, I guess.

1 Like