Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

CPLEX 22.1 performance is slower than 20.1 (CP optimizer)

  • 1.  CPLEX 22.1 performance is slower than 20.1 (CP optimizer)

    Posted Wed August 03, 2022 08:07 AM
    Hi

    I have a model done with CP Optimizer API for c++ that runs 4 times faster with 20.1 than with 22.1. I dont think the solution proposed for the (Decision Optimization)   is valid in my case, right (IloCplex::Param::Emphasis::MIP) ?

    It's running with default parameters except for:
    cp.setParameter(IloCP::LogVerbosity, IloCP::Quiet);
    cp.setParameter(IloCP::SearchType, IloCP::Restart);
    cp.setParameter(IloCP::DynamicProbing, IloCP::Auto);
    cp.setParameter(IloCP::Workers, 8);

    Any ideas?

    Thanks


    ------------------------------
    javier rodrigo
    ------------------------------

    #DecisionOptimization


  • 2.  RE: CPLEX 22.1 performance is slower than 20.1 (CP optimizer)

    Posted Wed August 03, 2022 11:20 AM
    Dear Javier,

    You are right, changing a CPLEX engine parameter won't be of any use since you are using CP Optimizer.
    Can you confirm the slowdown by exporting the .cpo file, load it using the 'cpoptimizer' executable and by performing the 'tool run seeds' command?
    If the slowdown is confirmed, please let provide what a (minimal) model that demonstrates it.
    Cheers,



    ------------------------------
    Renaud Dumeur
    ------------------------------



  • 3.  RE: CPLEX 22.1 performance is slower than 20.1 (CP optimizer)

    Posted Wed August 03, 2022 01:35 PM
    Thanks for the quick answer. I have exported the .cpo with version 2010 so it does not give a warning when loading with cpoptimizer.exe version 2010 (if I do the export with 2210 when loading in 2010 cpoptimizer I get a warning saying unexpected results might be found).

    For a simpler model (model.cpo) that actually finds the optimum solution fast (few seconds), version 2210 is faster (see benchmark201 and benchmark221) in proving that an optimum solution is found, but slower in showing that solution.

    This behaviour is clearer for a more complex model (model2.cpo). According to the benchmark (see attached benchmark201_model2 and 221_model2) again it shows 2210 is faster than 2010. However, the time shown in the statistics I guess is when the optimizer proves it has found an optimum solution. In reality, running my program shows that for 2010 the best solution (an actually optimal) is found after 7s and with 2210 is found after 51s.

    When I mean simpler model, what I want to say is that the data (a two dimensional matrix) has less rows (11 vs 34).

    Let me know if you need futher details

    Thanks

    ------------------------------
    javier rodrigo
    ------------------------------



  • 4.  RE: CPLEX 22.1 performance is slower than 20.1 (CP optimizer)

    Posted Thu August 04, 2022 02:41 AM
    Dear Javier,

    So, to sum up, although using runseeds shows that solving both .cpo files is faster with version  221 than with 201, your application doesn't exhibit this behavior.
    This really surprising since all runseeds does is to show the solve-to-optimality duration after solve() ends and at that moment the solution is available.
    It would be interesting to see what log is produced when your model is solved by your application and compare it with what is produced by 'cpoptimizer' with the exact same seed.
    Cheers,


    ------------------------------
    Renaud Dumeur
    ------------------------------



  • 5.  RE: CPLEX 22.1 performance is slower than 20.1 (CP optimizer)

    Posted Thu August 04, 2022 12:07 PM
    Hi,

    My cpp application doesn't make anything weird except reading the data from .txt file, running the model, getting the intermediate solutions (using cp.next) and saving them in another .txt file.

    After doing several tests with both versions, the behaviour that is systematically repeating is the following:
    - Version 221: finds the last intermediate solution (which is the optimal one) in 56s; solver ends in 99,8s (no further solutions is found)
    - Version 201: finds the last intermediate solution (which is the optimal one) in 9s; solver ends in 164s (no further solutions is found)

    That's why according to runseeds 221 is better because it ends faster than 201. However, I am more interested in finding the solution than proving is the optimal one. I am not sure if now is clearer.

    ------------------------------
    javier rodrigo
    ------------------------------



  • 6.  RE: CPLEX 22.1 performance is slower than 20.1 (CP optimizer)

    Posted Thu August 04, 2022 01:44 PM
    Dear Javier,

    It is clearer now but there is no quick answer. 
    Thank you for providing the models I will do a few experiments with them to try mitigate this problem.
    Cheers,

    ------------------------------
    Renaud Dumeur
    ------------------------------



  • 7.  RE: CPLEX 22.1 performance is slower than 20.1 (CP optimizer)

    Posted Thu August 04, 2022 06:27 PM
    Dear Javier,

    I suggest you try  to set the 'MaxNoGoods' parameter to 0. It seems to improve things.
    Cheers,

    ------------------------------
    Renaud Dumeur
    ------------------------------



  • 8.  RE: CPLEX 22.1 performance is slower than 20.1 (CP optimizer)

    Posted Fri August 05, 2022 05:10 AM
    Thanks. I don't know what this parameter is doing (I cannot find an explanation in the documentation only that it's readonly??) but it has slightly improved the time to find the solution in both versions. So I still have the same issue making the 221 slower than 201 in fiding the best solution.

    ------------------------------
    javier rodrigo
    ------------------------------



  • 9.  RE: CPLEX 22.1 performance is slower than 20.1 (CP optimizer)

    Posted Fri August 05, 2022 06:19 AM
    Edited by System Admin Fri January 20, 2023 04:27 PM
    Dear Javier,

    It is an undocumented parameter that allows to disable nogoods (data that allow the solver to reenter fruitless search space regions).
    In the case of your model, the cost of maintaining this information prevents the quick generation of solutions.
    In my tests, on 30 seeds with a 20s time limit the number of times the optimum is reached is:
    - 221 & MaxNogoods=0  -> 11
    - 221                                     -> 5
    - 201                                     -> 13  
    So I'd say this undocumented parameter almost put 221 (11) almost on par with 201 (13) but it can only been seen by running multiple seeds.
    Cheers,


    ------------------------------
    Renaud Dumeur
    ------------------------------



  • 10.  RE: CPLEX 22.1 performance is slower than 20.1 (CP optimizer)

    Posted Fri August 05, 2022 07:01 AM
    Thanks Renaud. For the moment I will stick with the 201 for this particular project.

    ------------------------------
    javier rodrigo
    ------------------------------