I'm working on a routing and scheduling problem in the home care services context. I consider a break as a dummy patient, so routing and scheduling are also implemented for the break node (with some conditions). For some reason, I need to determine whether a visit occurs before or after a break. I defined two binary variables "Zikt" which means if patient i is visited by doctor k on shift t before the break, and "Z'ikt" for after the break. I added 2 new constraints as follows:
S(b,k,t)-S(i,k,t) =l= M* Z(i,k,t)
Z(i,k,t) + Z'(i,k,t) =l= sum((j), X(i,j,k,t))
P.s: S(b,k,t) is the starting time of break by doctor k on shift t
S(i,k,t) is the starting time of visiting patient i by doctor k on shift t
X(i,j,k,t) is if doctor k on shift t goes from node i to node j (binary variable)
In the first constraint, if the left-hand side becomes positive, Z(i,k,t) will be 1.
The second one is guaranteeing that Z and Z' could get value if patient i was visited by doctor k on shift t.
By adding these 2 constraints to my model, the result of my S variables get wrong.
I think it's better to rewrite the first constraint so that it becomes related somehow to X(i,j,k,t), but I can not figure out how to do it.
I'd appreciate it if anyone could help me.
Thanks