Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Feed a feasible solution to OPL

    Posted Fri December 28, 2018 05:46 PM

    Originally posted by: 88Simon88


    Hello everybody,

    Merry Christmas.

    I am running a model, but it takes a lot of time. So, I use an algorithm to find a feasible solution to the problem. Now I am going to feed it to the OPL and run the model and see how much the feasible solution can reduce the runtime. Could you please explain me how can I do that? I would appreciate you if you could provide a sample code.

    Best regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Feed a feasible solution to OPL



  • 3.  Re: Feed a feasible solution to OPL

    Posted Sat December 29, 2018 11:37 AM

    Originally posted by: 88Simon88


    Thanks Alex for your reply.

    I read the example which you have provided and I somehow got the method, but I am not still sure. Please put me right if I am wrong: 

    In order to provide a solution for CPLEX, first I have to provide the decision variables to the model and then solve it. right?

     

    What are the arguments of the below code? decision variables? 

    cplex.addMIPStart(thisOplModel.nbBus,thisOplModel.naiveSolution);

     

    If yes, Can I only provide the decision variable (for example just to mention the number of buses with 30 and 40 seats) to the model instead of solving it (instead of below code) and then feed it to the CPLEX?

     

    regards

     


    #DecisionOptimization


  • 4.  Re: Feed a feasible solution to OPL

    Posted Sat December 29, 2018 12:25 PM

    Hi,

    you do not need to solve before. You just need to provide values.

    See https://www.ibm.com/support/knowledgecenter/ru/SSSA5P_12.8.0/ilog.odms.ide.help/refjsopl/html/IloCplex.html#addMIPStart

    for the parameters for addMiIPStart

    You may also find a warmstart example in CPLEX_Studio128\opl\examples\opl\warmstart

    And also have a look at https://www.ibm.com/developerworks/community/forums/html/topic?id=c3f299b6-46d5-4d52-8371-d8cd81ecbd4e&ps=25

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: Feed a feasible solution to OPL

    Posted Sat December 29, 2018 05:03 PM

    Originally posted by: 88Simon88


    Hi,

    I read the example for a warm start and a question came up to my mind, If I have 4 decision variables, Is it enough to provide only one decision variable for the warm start? For example, in the OPL example for the warm start, if you write "y" instead of "x" in the following line, the result is the same.

    vectors.attach(opl2.y,opl2.values);

    best regards

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: Feed a feasible solution to OPL

    Posted Wed January 02, 2019 02:45 AM

    Hi,

    in the example warmstart, if you write

     vectors.attach(opl2.y,opl2.values);

    instead of

     vectors.attach(opl2.x,opl2.values);

    Then nothing much happens since y values are set by

    forall( j in r )
        ctEqual:
          y[j] == j;

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer