Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Callback functions to implement branch & check

    Posted 12/14/18 12:13 PM

    Originally posted by: vuducminh



    Dear all,

    I start learning to use callbacks to implement the following. Given a MIP P, I need to:

     

    1. I want to enumerate all feasible solutions. Then, for each feasible solution, I want to call a callback function to check whether this solution meets some conditions or not (***).  What should I do to achieve this goal? I have read about incumbent callback, cut callbacks, etc. but I need your advice since it is quite new to me. 

     

    2. I do not want to enumerate all feasible solutions. If the currently feasible solution of P also meets conditions (***), I want to add cuts eliminate all other solutions of P having worse objective value. How I could do that?  


    Thank you so much,

    M.


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Callback functions to implement branch & check

    Posted 12/15/18 04:06 PM

    Originally posted by: EdKlotz


    1.   Keep in mind that enumerating all feasible solutions can be extremely time consuming; basically the branch and cut algorithm can only prune infeasible nodes, making the search process potentially a lot slow.    So first, I would suggest you make sure that the conditions you want to assess cannot be added as constraints or lazy constraints into the model.   Keep in mind that CPLEX supports logical constraints, quadratic constraints, and piecewise linear functions, so you can model a lot of nonlinear conditions using some of these tools.    However, if you really need to check all solutions, you could try using CPLEX's solution pool/populate method to force CPLEX to do this, then use an incumbent callback function to test the conditions.  Specifically, you will not to set the solution pool intensity parameter to configure the populate method to enumerate all feasible solutions.   See the user manual on the solution pool for more information.

     

    2.  I think you need to use an incumbent callback and a lazy constraint callback to do this.  Take a look at some of the example programs that illustrate how these callbacks are used.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Callback functions to implement branch & check

    Posted 12/18/18 07:22 AM

    Originally posted by: Lessi



    Thank you, EdKlotz. Let me try your suggestion.

     

    M.

     

      


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Callback functions to implement branch & check

    Posted 12/19/18 01:30 PM

    Originally posted by: Lessi


    Based on your suggestion and do the goolge search, I have found the steps offered by CPLEX which details how to enumerate all solutions:

     

    https://www.hpc.science.unsw.edu.au/files/docs/ilog/cplex/12.1/html/Content/Optimization/Documentation/CPLEX/_pubskel/ps_usrmancplex614.html
    cplexMaster.setParam(IloCplex::Threads, 1);

    cplexMaster.setParam(IloCplex::SolnPoolGap, 1e75);

    cplexMaster.setParam(IloCplex::SolnPoolIntensity, 4);
    cplexMaster.setParam(IloCplex::PopulateLim, 1e9);
    cplexMaster.setParam(IloCplex::SolnPoolCapacity, 1e9);
     
    cplexMaster.use(incumbentCallback(env, -100000, 0, cplexMaster.getCplexTime(), cplexMaster.getDetTime())); //do something when find a new incumbent
    cout << "-------------------------------populate-------------------------------" << endl;

     

     
    //cplexMaster.solve();
    cplexMaster.populate(); //use this function instead of solve()

     


    #CPLEXOptimizers
    #DecisionOptimization