• Daniel Espinoza

Hi Gabriel,

Indicator constraints must use binary variables and values to set a condition. In your case they are integer, hence the error

Hi Daniel,

Thank you for the quick response. I am aware of this binary restriction. This is why I added the dummy variables but it still doesn't work. Do you know any other way around this issue?

• Daniel Espinoza

I would guess that this does not work:

as the difference should be a general integer.... probably you want to to say something like

T[t]-at[j] <= Max(T[t]-at[j]:t,j)*(1-dummy311[j,t])

at[j]-T[t] <= Max(T[t]-at[j]:t,j)*(1-dummy311[j,t])

the maximum you should compute. Those constraint force that T[t] == at[j] whenever dummy311[j,t]=1

Hi Daniel,

thank you again for your input. It was very helpful. I managed to create an alternative and my model runs perfectly now. Just in case you are interested the code that I implemented is the following:

# Constraint 31for j in VN:  for t in T:    for k in K:      m.addConstr((dummy312[j,t] == 1) >> (at[j] == T[t]),                 "constraint31a[%s,%s]" % (j,t))      m.addConstr((dummy312[j,t] == 1) >> ((quicksum(x[i,j,k] for i in Vk)) <= z[g[f[j]],k,t]),                 "constraint31b[%s,%s,%s]" % (j,t,k))for j in VN:  m.addConstr(quicksum(dummy312[j,t] for t in T) == 1,            "constraint31c[%s,%s]" % (j,t))