I'm new to CPLEX, and I'm doing a project using CP.
I have a multilist A that has 4 arguments : one Operation o, one Surgeon s, one Room r and one Time t
A[o,s,r,t] == 1
if and only if the operation o is done by the surgeon s in the room r and starts at time t
and I want to say that each operation can only be done once, so in the constraints, I wrote :
forall(o in Operations,s in Surgeons,r in Rooms,t in Times,s2 in Surgeons,r2 in Rooms,t2 in Times){
((s!=s2 || r!=r2 || t!=t2) && A[o,s,r,t] == 1) => A[o,s2,r2,t2]==0;
//if an operation is done with some settings, it can't be done with any other settings
}
The logic is there but I feel like I'm asking CPLEX to do 7 nested loops, how to do that more efficiently ?
Instead of logical constraints
you could use slicing