Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


Problem with speed of tomlab_cplex?

  • Xiaojing Ren
    Xiaojing Ren

    The problem is that the speed of solver 'gurobi' is almost 5 times faster than solver 'tomlab_cplex' when deal with optknock problem. I have checked the CPU usage of my computer and found that matlab takes up whole CPU when use solver 'gurobi' while 'tomlab_cplex' only occupies 25% CPU.
    Is there any method that I can improve the calculation speed of optknock with solver 'tomlab_cplex'?
    Could anyone help me out? Thanks a lot.

  • Daniel Hyduke
    Daniel Hyduke

    Speed issues like this are often related to parameter tuning for the solvers.  If you're interested in improving performance of one solver vs another for a problem then it'd be a good idea to read through the solver's manual and then benchmark tweaks that you think will help.

    You can always e-mail the support for the vendor's that develop the software and ask them for suggestions, but before following that route I'd develop a small test script that illustrates the performance difference to send to the solver support team.  To get the fastest response, it would probably be best to the test script without using the cobra toolbox.  if you don't see a difference in performance for the two solvers with your simple script then you can start using tic / toc or other debugging tools in matlab to pinpoint the problem and provide feedback on how you tuning the solver parameters alters performance.

    P.S.  Sometimes this is related to tolerances.  A solver may seem faster but that is just because the default tolerance is set to a higher value which results in a faster, but less accurate and potentially incorrect, run.

  • Xiaojing Ren
    Xiaojing Ren

    So kind of you to help me. Considering the results of optknock, it is true that solver 'tomlab_cplex' is more accurate than solver 'gurobi' though it is slower. Thanks a lot!!!