Decision Optimization

Decision Optimization

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

 View Only
  • 1.  about the computation time using CPLEX

    Posted Sat June 25, 2011 11:29 PM

    Originally posted by: SystemAdmin


    Dear All,

    I am running a heuristic where I call CPLEX 12.2 to solve many LPs at each iteration. I have the following question about computation time.

    Suppose I want to solve one instance 10 times and evaluate the average performance. After I successfully solve the instance one time, I used routines below to free all LPs and close the CPLEX environment.

    if ( lp != NULL ) {
    status = CPXfreeprob (env, &lp);
    if ( status ) {
    fprintf (stderr, "CPXfreeprob failed, error code %d.\n", status);
    }
    }

    if ( env != NULL )
    status = CPXcloseCPLEX (&env);

    Note that no problem of "out of memory".
    In the heuristic, I define "solving a LP at each iteration" as a basic computation.
    Now I found that there is a significant difference between time required by basic computations in different tries. Namely, the time of basic computation is increasing. For example, If I keep running the heuristic for 10 tries, I have

    In try 1, the computation time of each basic computation is about 5 seconds
    In try 2, the computation time of each basic computation is about 8 seconds
    In try 3, the computation time of each basic computation is about 11 seconds
    In try 4, the computation time of each basic computation is about 15 seconds
    In try 5, the computation time of each basic computation is about 16 seconds
    .......
    But if I run these 10 tries separately, then the computation time of each basic computation is stable at about 5 seconds in each try.

    I guess the above problem is due to the frequent opening/closing CPLEX.
    Thanks.
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: about the computation time using CPLEX

    Posted Sun June 26, 2011 05:48 PM

    Originally posted by: SystemAdmin


    If you turn off the advanced start indicator, does this still happen?

    Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: about the computation time using CPLEX

    Posted Sun June 26, 2011 09:01 PM

    Originally posted by: SystemAdmin


    Thanks Paul.
    The problem still happens.

    After I create an CPLEX environment, we set CPX_PARAM_ADVIND to zero. Since many different LPs are solved in my algorithm, CPLEX will not use advanced starting informantion.
    Leo
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: about the computation time using CPLEX

    Posted Mon June 27, 2011 04:51 AM

    Originally posted by: SystemAdmin


    Are you sure that in each try you solve the exact same LP? Can you export each LP solved to a .sav file and compare these files?
    Does the problem persist if you set CPX_PARAM_THREADS to 1 before solving the LP?
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: about the computation time using CPLEX

    Posted Wed June 29, 2011 10:10 PM

    Originally posted by: SystemAdmin


    I am sure that the same LPs are solved. For example, I check the first iteration of my heuristic where the same LPs (many LPs) are solved. There will be big difference between the computation time.

    With setting "CPX_PARAM_THREADS" to one, the problem still happened. Furthermore, I found that this parameter make sensences for one computer with multiple cores.
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: about the computation time using CPLEX

    Posted Mon July 04, 2011 02:00 PM

    Originally posted by: SystemAdmin


    I don't see a reason why the solution times should vary that much if you repeatedly solve the same problem. Are you using deterministic or opportunistic multi-threading? Which parameters did you change to non-default values? Is there other stuff running on your machine? Or do you have other threads running in your program while CPLEX solves the LP?
    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: about the computation time using CPLEX

    Posted Tue July 05, 2011 11:40 AM

    Originally posted by: SystemAdmin


    I just change the following parameters to non-default values

    status = CPXsetintparam(env1, CPX_PARAM_ADVIND, 0);
    status = CPXsetintparam(env1, CPX_PARAM_THREADS, 1);

    I did not change default values associated with "deterministic or opportunistic multi-threading". No other stuff were running on my machine.
    #CPLEXOptimizers
    #DecisionOptimization