Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Use of sequence variable for specific VRP problem

    Posted 03/18/19 03:38 AM

    Originally posted by: MWojcicki001


    We have an initial model that we plan to expand in the future and we have some key questions:

    Assumptions of the initial model:

    • 1 truck with a certain capacity
    • 50 points
      • "0" - start point
      • "1" - end point
      • "2-49" - collection points with a load to pick up
    • Time-matrix - information about how much time(t) do we need to get from point(p1) to point(p2)

    The objective function is to minimize travel time (endOf interval of point "1").

     

    Questions:

    1. We've crated sequence variable for truck:

    dvar sequence sequence_truck[t in truck] in all (cp in collection_point) itvs[cp][t];

    1. Our end point "1" is also point for unloading truck. This means that after the full load has been reached, the truck should drive to the unloading point(end point - "1") and then leave the unloading point(end point -"1") and continue the sequence. The last point of the sequence should be end point -"1".
      1. Is the sequence variable appropriate in this case?
        1. If yes - how to model the sequence to visit unloading point(end point - "1") as many Times as needed and at the end of whole sequence finish in unloading point(end point "1")
        2. If no - what approach will be more appropriate?

     

    In the future, we plan to expand the model to:

    1. More trucks
    2. More collection points
    3. More types of a load to pick up - one truck can carry only one type of a load from the beginning to the end of the day
    4. Time windows for some points (e. g.  point 4 - a visit possible only after 1PM)
    5. Weekly schedule - some points have to be visited twice a week, rest of points only once
    6. Loading time for points - each point can have a different loading time

     

     


    #ConstraintProgramming-General
    #DecisionOptimization


  • 2.  Re: Use of sequence variable for specific VRP problem

    Posted 03/18/19 06:27 AM

    Originally posted by: PhilippeLaborie


    For modeling the unloading of the trucks, you should first compute an upper bound on the number of unloading activities that will be required for a truck. Let's call it NbUnloadMax.

    Then you would create, for each truck t, a chain of NbUnloadMax optional interval variables representing the unloading activity.

    dvar interval unloadingT[u in 1..NbUnloadMax][t in Trucks] optional size LoadDuration;
    
    forall(u in 2..NbUnloadMax) {
      endBeforeStart(unloadingT[u-1][t], unloadingT[u][t], 1);
      presenceOf(unloadingT[u][t]) => presenceOf(unloadingT[u-1][t]);
    }
    

    The loading interval variables will increase the cumul function that represents the load of the truck whereas the unloading will decrease it by a variable amount that depends on the current load of the truck.

    // Cummul function for getting loading level of a truck
    cumulFunction loading_level[t in Trucks] = 
        sum(c in collection_point: c>1) stepAtEnd(itvsT[c][t], weight[c])     // LOAD
      - sum(u in 1..NbUnloadMax) stepAtStart(unloadingT[u][t], 1, truckCapacity); // UNLOAD
    

    In the constraints of the model you need to state that after unload, the truck is empty. This constraint will ensure that the full content of the truck is unloaded:

    forall (t in Trucks){
     forall(u in 1..NbUnloadMax) {
      alwaysIn(loading_level[t], unloadingT[u][t],0,0);
     }
    }
    

    You also need to change your model around the "last" activity of the truck as now, you do not know which unlading activity (among the NbUnloadMax ones) will be the last one. I suggest using an additional interval variable that represents the interval of time during which a given truck is performing some unload operations, so this interval spans all the unloading activities of the truck and it will end at the end time of the last present unloading activity. All the loading activities of the truck must end before the end time of this interval:

    dvar interval truck[t in Trucks];
    
    forall (t in Trucks){
     span(truck[t], all(u in 1..NbUnloadMax) unloadingT[u][t]);
     forall(c in collection_point: c>1) {
       endBeforeEnd(itvsT[c][t], truck[t]);
     }
    

    And you can use the end of this interval in the objective function:

    minimize sum(t in Trucks) endOf(truck[t]);
    

    For the extension where you have several trucks, you should use some 'alternative' constraints. I attach the full model.

     


    #ConstraintProgramming-General
    #DecisionOptimization


  • 3.  Re: Use of sequence variable for specific VRP problem

    Posted 03/19/19 03:49 AM

    Originally posted by: MWojcicki001


    Thank you very much Philippe for a precise and quick answer   :)  


    #ConstraintProgramming-General
    #DecisionOptimization