I have a model for the no-wait flow shop scheduling problem, that utilizes the linear ordering variables, and there is a constraint with big-M. When I implement the model in CPLEX OPL
, the model assigns zero to all linear ordering variables. I guess the problem is with the big-M constraint, but I don't know how to fix it.
Here is my implementation of the two main constraints in CPLEX OPL
. The variable X[i][j]
takes 1 if job j
is processed after job i
in the sequence. The variable C[i][k]
shows the completion time of job i
on machine k
.
In the second constraint (c2) I put 10000 as the big-M (the same value I use in other solvers). The answer turns out to be infeasible due to constraint 1 (c1), since the solver puts all X
variables equal to zero (hence violating c1 since 0 = 1).
int NumofJobs = 2;
int NumofMachines = 3;
range n = 1..NumofJobs;
range m = 1..NumofMachines;
dvar boolean X[n][n];
dvar int+ C[n][m];
int TaskTime[n][m] = [[5,6,3], [2,8,9]];;
minimize (sum (i in n) (C[i][NumofMachines]));
subject to {
forall (i in n)
forall (j in n: j > i)
c1: X[i][j] + X[j][i] == 1;
forall (i in n)
forall (j in n: j != i)
forall (k in m)
c2: C[i][k] + TaskTime[j][k] <= C[j][k] + 10000 * (1 - X[i][j]);
}
I have implemented the same model in other solvers and the problem is solved without any issue.