Decision Optimization

Decision Optimization

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

 View Only
  • 1.  VRP with one time window

    Posted Wed November 22, 2017 10:29 AM

    Originally posted by: AMM1


    Hello

    i am trying to solve VRP with one time window using CP

     my VRP problem is with one vehicle , distances between clients set to 0  also no depot to start and end at it.

    since the one vehicle cant serve all of the 300 client , my objective is to maximize the number of served clients using this vehicle

    how to write that? 


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: VRP with one time window

    Posted Wed November 22, 2017 11:20 AM


  • 3.  Re: VRP with one time window

    Posted Wed November 22, 2017 11:31 AM

    Originally posted by: AMM1


    good evening mr alex

    thank you for you reply 

    in the mentioned example , you are trying to minimize total traveled distance

    but in my case distances are considered zeros 

    (i have 300 clients,  set of them without violating constraint)


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: VRP with one time window

    Posted Wed November 22, 2017 11:56 AM

    Then you could start with

    using CP;

    int nbVisits=300;
    range Visits=1..nbVisits;


    int earliest[i in Visits]=rand(10);
    int latest[i in Visits]=earliest[i]+5+rand(20);   

    dvar interval itvs[v in Visits] optional in earliest[v]..latest[v] size 1;

    dvar int+ nbVisitsDone;

    maximize nbVisitsDone;
    subject to
    {
    nbVisitsDone==sum(v in Visits) presenceOf(itvs[v]);

    noOverlap(itvs);
    }

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: VRP with one time window

    Posted Wed November 22, 2017 04:33 PM

    Originally posted by: AMM1


    Thank mr Alex

    its a good starting point :) i appreciate your help


    #DecisionOptimization
    #OPLusingCPLEXOptimizer