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