Continuity Problem
OngoingHi, I need to model the following constraint:
The constraint basically ensures that a surgery must be done continuous over time. The variable x is BINARY and models if the surgery is been developed in a certain instant of time. Ther variable y is BINARY and models if a surgery starts in a certain instant of time. And t is the time of the surgery. I tried to put the constraint in code like this:
m.addConstrs((gp.quicksum(z[i,j,k,a] for a in range(l,l+tiempo[i]1))==y[i,j,k,l]*tiempo[i] for i,j,k,l in pacientes_salas_cirujano_hora if l <=num_horastiempo[i]+1),name="c1")
However, in my results I'm obtaining values of 1 in y, but all my z are 0 and I don't understand why. I hope you can help me.
Thanks,
Sergio.

Hi Sergio,
could you generate an LP file by using the write() function to double check whether the constraints you construct are correct? I would recommend to reduce the number of elements in the sets \(P,S,C,H\) to keep the file manageable.
In case you need further help, feel free to share constraint lines of you LP file.
Best regards,
Jaromił0
Please sign in to leave a comment.
Comments
1 comment