Suppose we are dealing with a large scale CSP problem with 100 machines and 1000 jobs with lots of precedency constraints so the goal is to generate a feasible solution. Due to heavily interwoven constraints, a problem instance often has infeasible jobs, which cannot be checked in advance. In this case, what I hope to accomplish is to automatically remove the minimum number of jobs by using Conflict Refiner.
In the following code, I would like to screen out jobs 5, 7 and 9. Surely, we can turn the interval into "Optional" and maximize the present job count. But, I would like to see if we can utilize Conflict Refiner to remove the minimum number of jobs, for my large-scale CSP problem.
using CP;
tuple t_Job {
key int j;
int sz;
int grp;
int loc;
} {t_Job} Jobs = {
<1, 1, 100, 80>,
<2, 2, 100, 40>,
<3, 3, 100, 80>,
<4, 4, 200, 40>,
<5, 5, 200, 40>,
<6, 6, 200, 80>,
<7, 7, 200, 40>,
<8, 8, 300, 80>,
<9, 9, 300, 40>,
<10,10,300, 80>};
dvar interval itvj[j in Jobs] size j.sz;
dvar sequence Mch in all(j in Jobs) itvj[j];
minimize max(j in Jobs)endOf(itvj[j]);
subject to {
forall(j in Jobs)
if(j.sz >=5 && j.loc==40) presenceOf(itvj[j])==0;
noOverlap(Mch);
}
#DecisionOptimization