I have tried to add a soft constraint penalty to my objective function.
My soft constraint is this:
sum((i,j,p,t), x(i,j,p,t)-r(i,j,p,t)) =e= 6000
And then the penalty is added in my objective function like this at the end:
The x variable is an amount of product that is being transported. The soft constraint is going to add a penalty cost (penalty(p,j,i) if the amount of x goes above 6000.
How do I make sure that the subscripts (i,j,p,t) are equal to the same subscripts in in the x variable which is already determined by other hard constraints?
Problems with modeling
1 post • Page 1 of 1