Hello everyone
I am trying to build a route constraint for a Jobshop problem following a different formulation than the one available in the examples of ILOG CPLEX Optimization Studio.
For this purpose, in the .mod file I created a 2D array to represent the route of each job in each machine:
int R[j in Jobs][m in Mchs] = ...;
Where for an instance of 10 jobs and 10 machines the R array is as follows:
R = [
[0,1,2,3,4,5,6,7,8,9]
[0,2,4,9,3,1,6,5,7,8]
[1,0,3,2,8,5,7,6,9,4]
[1,2,0,4,6,8,7,3,9,5]
[2,0,1,5,3,4,8,7,9,6]
[2,1,5,3,8,9,0,6,4,7]
[1,0,3,2,6,5,9,8,7,4]
[2,0,1,5,4,6,8,9,7,3]
[0,1,3,5,2,9,6,7,4,8]
[1,0,2,6,8,9,5,3,4,7]];
Back in the .mod file, I added the following constraint:
forall (j in Jobs, m in 0..nbMchs-2)
endBeforeStart(itvs[j][R[j,m]],itvs[j][R[j,m+1]]);
But it seems that is not working as expected (the model is running, but the results are not the expected)
Basically, what I need to do is the following (i.e. Job 0 ==> first row of R matrix)
endBeforeStart(itvs[0][0],itvs[0][1]);
endBeforeStart(itvs[0][1],itvs[0][2]);
endBeforeStart(itvs[0][2],itvs[0][3]);
And so on…
For Job 1 ==> second row of the R matrix would be:
endBeforeStart(itvs[1][0],itvs[1][2]);
endBeforeStart(itvs[1][2],itvs[1][4]);
endBeforeStart(itvs[1][4],itvs[1][9]);
And so on…
Could you please indicate what is wrong with my constraint?
BTW would be helpful if some command could be used to print the instance that is being solved for checking this kind of trouble (I mean something equivalent that the command "display" in AMPL)
Thank you in advance
Francisco Yuraszeck
------------------------------
Francisco Yuraszeck
Yuraszeck
------------------------------
#DecisionOptimization