Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Sequencing problem

    Posted 06/18/16 02:21 PM

    Originally posted by: ClemsonTiger


    Hi 

    I am having trouble modelling a sequencing problem, I don't know if recursion is the reason. 

    Problem statement:

    a number of product to be placed on a moving production line that runs through different stations. Each station has a worker that perform the jobs needed for each product. Job duration are different for each product/station. There is a cycle time (c )that is defined by the speed of the line and there is a length (l) for stations that is bigger than the cycle time. If a job took a worker the full length of the station he will not be able to start working on the next product in the sequence  until (l-c) . Each worker position for each period/station is denoted by variable (s). If a job will take an amount over the length of the station another worker is called to take care of that job and the original worker move to work on the next product in the sequence.  A flag variable indicates if an additional worker is needed (u), The objective is to find a sequence that will minimize the need for additional workers.

    here is my small model.

    using CP;
    int nbrProds=...;
    range Products=1..nbrProds;
    int nbrPeriods=nbrProds;
    range Periods=1..nbrPeriods;
    range PeriodsP=1..nbrPeriods+1;
    int nbrStations=...;
    range Stations=1..nbrStations;
    int c=...;
    int l=...;
    int duration[Products][Stations]=...;
    dvar int seq[Periods] in Products;
    dvar int s[Stations][PeriodsP] in 0..c;
    dvar int f[Stations][PeriodsP] in 0..2*c;
    dvar boolean u[k in Stations][t in Periods];

    minimize sum(k in Stations, t in Periods) u[k][t];
    subject to {
    forall (k in Stations)
      s[k][1]==0;
    forall (k in Stations)
      forall (t in Periods) f[k][t]==s[k][t]+duration[seq[t]][k];
    forall (k in Stations)
      forall (t in PeriodsP:t<=nbrPeriods)
        if (f[k][t]>l){
        s[k][t+1]==maxl(0,s[k][t]-c);
        u[k][t]==true;   
      }    
        else{
        s[k][t+1]==maxl(0,f[k][t]-c);
        u[k][t]==false;
        }
    allDifferent(all (t in Periods) seq[t]);
    }

     

    example data:

     

    nbrProds=5;
    nbrStations=2;
    c=10;
    l=15;
    duration=[
    [11,6]
    [12,9]
    [10,15]
    [5,14]
    [13,14]];

     

    I am trying to avoid the use of if else function but the dexpr will not work here since recursion is not supported.

    Any help is appreciated.

    Thanks

     


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: Sequencing problem

    Posted 06/19/16 03:23 PM

    Hi,

    you may replace the if then else by logical constraints in your .mod:

     using CP;
    int nbrProds=...;
    range Products=1..nbrProds;
    int nbrPeriods=nbrProds;
    range Periods=1..nbrPeriods;
    range PeriodsP=1..nbrPeriods+1;
    int nbrStations=...;
    range Stations=1..nbrStations;
    int c=...;
    int l=...;
    int duration[Products][Stations]=...;
    dvar int seq[Periods] in Products;
    dvar int s[Stations][PeriodsP] in 0..c;
    dvar int f[Stations][PeriodsP] in 0..2*c;
    dvar boolean u[k in Stations][t in Periods];

    minimize sum(k in Stations, t in Periods) u[k][t];
    subject to {
    forall (k in Stations)
      s[k][1]==0;
    forall (k in Stations)
      forall (t in Periods) f[k][t]==s[k][t]+duration[seq[t]][k];
    forall (k in Stations)
      forall (t in PeriodsP:t<=nbrPeriods)
         (f[k][t]>l) =>
         (
        (s[k][t+1]==maxl(0,s[k][t]-c))
        &&
        (u[k][t]==true)
        );   
     forall (k in Stations)   
      forall (t in PeriodsP:t<=nbrPeriods)
         !(f[k][t]>l) =>
        (
        (s[k][t+1]==maxl(0,f[k][t]-c)) &&
        (u[k][t]==false)
        );
    allDifferent(all (t in Periods) seq[t]);
    }

    For schedling problems do not hesitate to use scheduling concepts as described in http://fr.slideshare.net/PhilippeLaborie/ibm-ilog-cp-optimizer-for-detailed-scheduling-illustrated-on-three-problems

    regards


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 3.  Re: Sequencing problem

    Posted 06/19/16 06:15 PM

    Originally posted by: ClemsonTiger


    Thanks for your help,

    I love to use the scheduling concepts but I can't seem to find any use to the interval variables in a sequencing problem like this.


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 4.  Re: Sequencing problem

    Posted 06/20/16 02:43 AM

    Hi,

    as a start you could replace

    dvar int s[Stations][PeriodsP] in 0..c;
    dvar int f[Stations][PeriodsP] in 0..2*c;
    dvar boolean u[k in Stations][t in Periods];

    by

    an array of optional intervals

    regards


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 5.  Re: Sequencing problem

    Posted 10/19/16 10:32 AM

    Originally posted by: ClemsonTiger


    hi , sorry to revive an old thread. I am trying to model the problem to be solved by the CP scheduler but I am really having some hard time in finding the most efficient way to model it since I will be comparing it to other techniques. Is using optional intervals costly in terms of processing time when I already have a huge number of intervals?

    I started another thread trying to model it without optional interval but it seems to be hard to do so.

    I saw your post about the TSP solved by the CP scheduler and thought you might have a good idea.

    https://www.ibm.com/developerworks/community/forums/html/topic?id=d9bb773c-228e-44e1-b1f2-b4d713eefe83#42e1a382-57cf-426c-b79b-25341d079aa7 


    #DecisionOptimization
    #OPLusingCPOptimizer