Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Problems with DARP-like formulation

    Posted Thu January 02, 2014 08:50 AM

    Originally posted by: MityaStiglitz


    Hi,

    I'm building my first bigger model and am having some problems (as expected). Attached the model and the data.

    The errors I get are:

    Impossible to load model.

    Name "j" does not exist.

    It appears there is a flaw here:

    //Pickup and delivery are performed by the same vehicle (5)
    forall(i in _N2: i<=N+Np)
      forall(k in _V)
        (sum(j in _N2: j<=N+Np)
        _X[i][j][k] - _X[j][i+N][k]) == 0;

    It is likely there will be more errors coming up when this is resolved. Help is deeply appreciated. Also, I would appreciate if anyone could point to further resources to learning OPL and use CPLEX. I am aware of the official reference manual and the instructor workbook. Still I find it quite hard to really start using this tool. What I would really value would be a resource that would explain more into details why e.g. some pre-processing or post-processing is done in the examples, etc. For instance, I am familiar with the basic LP formulation of the TSP, but what is done in the TSP example post-processing section and in the script provided with the suite is really hard to follow for me. In short - student-friendly textbook would make my day :)


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Problems with DARP-like formulation

    Posted Thu January 02, 2014 10:47 AM

    Originally posted by: davidoff


    Hi

    move the parenthesis that is before the sum to place it before the first _X

    Now, running the model, you will get "index ot ouf bound" : this is normal since i+N goes up to 2N+Np which is beyond the limit of N2

     

    David


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Problems with DARP-like formulation

    Posted Thu January 02, 2014 03:24 PM

    Originally posted by: MityaStiglitz


    Thank you David. Thanks also for pointing out the wrong range - it should be _N and not _N2.

    The last thing that is causing problems is this one:

    //Load constraints 1 (9)
    forall(i in _N2, j in _N2, k in _V)
         _X[i][j][k]*(Load[i][k]+LD[i]-Load[j][k])==0;

    "Cannot extract expression"

    Any ideas why this is happening? Thanks in advance.

    Mitya


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Problems with DARP-like formulation

    Posted Thu January 02, 2014 06:11 PM

    Originally posted by: davidoff


    You are using bilinear expressions in constraints, since all the terms here are decision variables

    this is not allowed in the current version of CPLEX. Check the manual for usage of quadratic expressions and limitations

    David


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: Problems with DARP-like formulation

    Posted Fri January 03, 2014 03:03 AM

    Originally posted by: MityaStiglitz


    OK. I will take a look at this. Thank you.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: Problems with DARP-like formulation

    Posted Fri January 03, 2014 11:55 AM

    Originally posted by: MityaStiglitz


    I know have the fully-fledged model up and running, but I still need to play with it to get some useful results.I resolved the "product of variables problem" by replacing the products of two variables by one new variable, on which a number of constraints is imposed, as explained here: http://www.aimms.com/aimms/download/manuals/aimms3om_integerprogrammingtricks.pdf [section 7.7]

    Do you (or anyone else) know if this is the most efficient way to do this or is there a better way to do this in CPLEX? If not, thanks anyway - it would have taken much longer to get to this point without you.

    Mitja

     

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 7.  Re: Problems with DARP-like formulation

    Posted Fri January 03, 2014 12:25 PM

    Originally posted by: davidoff


    Reformulation of product X.Y where X is binary is indeed a good trick, note that it enlarge the size of the problem.

    You may wonder also if these multiplications are absolutely necessary from the original formulation. I do not remember the use of bilinear formulas for vehicle routing so far


    #DecisionOptimization
    #OPLusingCPLEXOptimizer