Originally posted by: sana_
Hi,
I have a problem when I call the setParam(IloCplex::TiLim, <>) many times in the optimizing process.
I have an IP to solve. I use a column generation to solve the LP, convert all variables and use Cplex to solve the IP.
cplex.setParam(IloCplex::TiLim, 600); //I use a column generation but I not necessary wait it to converge to the LP optimal solution. I set the problem to terminate if an elapsed time is reached.
clock_t start = clock(); // In the same time I use the clock library c++ to compute the time elapsed to run the column generation.
run_gencol();
time_gencol += (clock() - start)/(double)CLOCKS_PER_SEC;
for(IloInt i=0; i<varX.getSize(); ++i) // I convert all variables considered in the master problem.
{
model.add(IloConversion(env, varX[i], ILOBOOL));
}
cplex.setParam(IloCplex::TiLim, 1200-time_gencol ); //I set the time limit at 1200-time_gencol (I want to limit the total time (time of column generation+time of BB at root node) at 1220 seconds)
cplex.solve(); //I optimize the IP
The problem that when I check the file log I see that the time elapsed exceeds the time limit :(
For example, for a specific instance I get
Total (root+branch&cut) = 3273.73 sec. (848714.01 ticks)
First, the 3273.73 includes the column generation run or only the last call to cplex.solve();
Second, when I set the time limit at 600 second for the column generation, Cplex applies this time limit to each call of the LP optimization call in each iteration ''cplex.solve();'' or it cumulates all the calls. I think that I did a mistake here and that the time limit is considered in each call :(
Third, I want to know what Cplex does if the time limit is negative ?
Last, any suggestion to allow me to implement my procedure? A column generation then a BB at the root node with time_limit(column generation)=600 seconds and time_limit(column generation + BB at the root node)=1200
Thanks a lot for your reply!
SD
#CPLEXOptimizers#DecisionOptimization