I'm working on an assignment problem that has a binary decision variable set with 4 indices: y,s,i,t, (assigning y to s,i,t) and unfortunately all y,s,i,t are large numbers. Therefore I'm currently working on speeding my existing model. To do so, I wanted to decrease the number of decision variables by creating separate "availability" lists for each y (e.g. y can be assigned to s[1,2,17] and i[2,4,33,56] and t[1:90]). So, I only created decision variables corresponding to that and haven't created: x[1,0,0,0] or x[1,1,2,91].
However, I'm having trouble with my constraints because currently I cannot sum all y from 0:Y for each s,i,t because some y within 0:Y do not exist, since their availability limits are different. (Showed an example constraint below.)
for s,i,t in zip(available_s, available_i, available_t):
m.addConstr(sum(x[y,s,i,t] for y in range(Y))<= c_si[s,i])
I was wondering if there's a way that I can say: sum all "existing y" within the 0:Y limit.
Thank you so much!
Please sign in to leave a comment.