Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Complexity problem with CPLEX

    Posted 12/08/08 06:23 PM

    Originally posted by: SystemAdmin


    [jp.dubus said:]

    Hi everybody,

    I use CPLEX in a C++ application (with concert technology), during an execution, CPLEX seems to take more time than GLPK to solve a problem, so i think i'm doing bad things in my codesource, but i don't know what. I must solve thousand of linear programs, so i create a class (cplexwrapper) containing IloEnv environnement and IloCplex cplex. When i want to compute a linear program, i create an IloModel, i set the constraints and objective in the model, and i use cplex.extract(model) before solving.
    At the end of the execution (a thousand of linear programs with the same IloEnv and IloCplex, but one IloModel for each LP), GLPK takes 0.5 second and cplex 2 seconds, it semms stange, so i use gprof and the problem seems to be localized in the memory gestion of CPLEX :

    IloLPExtractorManager::clear() takes 64.27 % of time of my application
    and IloAlgorithmI::clear() takes 7.53 % of time of my application

    how can i improve the performance of my application ?

    Thank you very much,

    Jean-Philippe Dubus,
    PhD student at LIP6
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Complexity problem with CPLEX

    Posted 12/08/08 09:52 PM

    Originally posted by: SystemAdmin


    [EdKlotz said:]

    I use CPLEX in a C++ application (with concert technology), during an execution, CPLEX seems to take more time than GLPK to solve a problem, so i think i'm doing bad things in my codesource, but i don't know what. I must solve thousand of linear programs, so i create a class (cplexwrapper) containing IloEnv environnement and IloCplex cplex. When i want to compute a linear program, i create an IloModel, i set the constraints and objective in the model, and i use cplex.extract(model) before solving.
    At the end of the execution (a thousand of linear programs with the same IloEnv and IloCplex, but one IloModel for each LP), GLPK takes 0.5 second and cplex 2 seconds, it semms stange, so i use gprof and the problem seems to be localized in the memory gestion of CPLEX :

    IloLPExtractorManager::clear() takes 64.27 % of time of my application
    and IloAlgorithmI::clear() takes 7.53 % of time of my application


    How do your models relate?  All CPLEX APIs support problem modifications, so if each model in your sequence can be obtained from the previous one by just adding a few constraints or variables, or changing some matrix coefficients, that might improve performance.  That way, you would not need to extract each model.

    Also, you might experiment with turning CPLEX's presolve off, as it may be overkill
    on models like this where each solve takes less than one hundredth of a second on
    average.  Still, that won't address any of the time in the clear() functions you mention above.

    Finally, doesn't the GLPK API involve C functions?  If so, a more accurate comparison would involving writing code with CPLEX's C API, which doesn't have to perform the extraction step that appears to dominate the run time.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Complexity problem with CPLEX

    Posted 12/09/08 05:13 PM

    Originally posted by: SystemAdmin


    [jp.dubus said:]

    Thank you very much, i switch from concert technology to C Callable Library, and it works perfectly (and better than glpk) !
    #CPLEXOptimizers
    #DecisionOptimization