Infeasibility when taking minimum of a term that include decision variables
Awaiting user inputWe have defined the following sets: set_customer_zones (i) and set_locker_locations (j). We have made a multidictionary of all possible pairs with their associated distance, which is called multi_dict: {(0, 0): 0.52, (0, 1): 0.96, (0, 2): 1.0, (0, 3): 1.08, (0, 4): 0.57, (1, 0): 0.69, (1, 1): 1.75, (1, 2): 0.76, (1, 3): 1.03, (1, 4): 0.43, (2, 0): 0.44, (2, 1): 0.69, (2, 2): 0.62, (2, 3): 0.53, (2, 4): 0.77, (3, 0): 0.76, (3, 1): 1.61, (3, 2): 0.32, (3, 3): 0.49, (3, 4): 0.85, (4, 0): 0.87, (4, 1): 1.27, (4, 2): 1.34, (4, 3): 1.47, (4, 4): 0.78}.
We would like to add the following constraints, where di*= shortest, Xij= assign and Yj= select
However, this code always gives an infeasible solution. Is there another way how to code the minimum constraint?
-
Hi Margot,
While I am still thinking about ways to formulate the minimum-constraint, I'm also wondering if x(i,k) + y(k) <= 1 is really what you want. My interpretation of the problem is that you want to guarantee that customers are not assigned to locker locations that are relatively far away (compared to the locker location that is most closeby and selected by the model). In that case, wouldn't you just require x(i,k)=0? You probably have another constraint that says x(i,k) <= y(k) for every combination (i,k) irrespective of distances. So constraint 3 maybe doesn't need to link x and y variables anymore.
Kind regards,
Ronald0
Please sign in to leave a comment.
Comments
1 comment