Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Issue with endBeforeStart constraint

    Posted 07/20/22 05:06 PM
    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


  • 2.  RE: Issue with endBeforeStart constraint

    Posted 07/21/22 02:31 PM
    Hello,
    you mean that instead of reading the data file to build the constraints, you read the data file to build an array and then build the constraint from the array, don't you?
    If the results are different, I suspect there is an inversion between rows an columns somewhere in your program. 

    If you mean something else, please provide some details and code sample to reproduce the case.

    ------------------------------
    Olivier Lhomme
    ------------------------------