Originally posted by: PhilippeLaborie
Hello,
The model seems to create a long propagation soon after the beginning of the search. I had a look at the model and my feeling is that you probably could formulate the problem in a way that results in stronger propagation in the engine. I see that there are two types of interval variables:
- present interval variables for each task i: CP_taskk[i]
- optional interval variables for each task i / machine j: CP_x[i][j]
What I do not understand is the relation you want to express between those interval variables. In your model there is:
1- a span constraint between CP_taskk[i] and all the optional intervals of task i on machines (all(j ...) CP_x[i][j])
2- constraints CPamountofprocessed[i][j]==IloEndOf(CP_x[i][j])-IloStartOf(CP_x[i][j]))
3- constraints CPamountofprocessed[i][j]==IloSizeOf(CP_taskk[i])*IloPresenceOf(env,CP_x[i][j])
Constraint 3 seems to suggest that only one machine j can be selected for a given task i. Is it right? If this is the case, you should use an IloAlternative constraint instead of a span constraint in 1. You will just write:
> Alternative(env,CP_taskk[i],disjunctive2[i]);
> Constraints CPamountofprocessed[i][j]==IloLengthOf(CP_x[i][j],0)
The alternative constraint synchronizes the start/end/length of the selected interval variable CP_x[i][j] with the master CP_taskk[i]. And in case CP_x[i][j] is not selected, thus is absent, IloLengthOf(CP_x[i][j],0)=0. But unless used elsewhere, variables CPamountofprocessed[i][j] are not necessary here so the alternative constraint should be enough here.
If the length of the task depends on the selected machine, you can directly constrain the lengthof interval variables CP_x[i][j], for instance: CP_x[i][j].setLengthMin(CP_P[i][j]).
Modeling this type of problem is illustrated in distributed example sched_jobshopflex.cpp (Flexible JobShop Scheduling Problem).
Is it really an alternative selection of machines by tasks that you want to model here or is it something more complex?
Philippe
#DecisionOptimization#OPLusingCPOptimizer