Why _solve_elapsed_time is more than timelimit?

I have set the time limit to 30 seconds to solve my optimization problem but the AMPL _solve_elapsed_time is coming as 45 seconds. Below are the AMPL options I used.

option auxfiles ‘cr’;
option presolve 0;
option solution_precision 8;
option solution_round 6; # SOA: Adding to control solution precision
option display_precision 0;
option display_round 6;
option gentimes 0;
option log_file ‘ampl_log.txt’;
option cplex_options
‘ordertype = 2’
‘mipdisplay = 5’
‘scale = 1’
'mipgap = 0.0000010 ’
'timelimit = 30 ’
‘comptol = .000000001000’
‘rinsheur = 100’
‘mipstartvalue = 1’
‘memoryemphasis = 1’
‘workfilelim = 1000’
‘prestats = 1’
‘iisfind 1’
‘integrality = .00000000100’
‘threads = 1’

May I know why _solve_elapsed_time is more than the time-limit? your response will be a great help to me.

1 Like

The mipbasis setting works as follows: By default, after the CPLEX run is finished, all of the integer variables are fixed at the values that were returned, and CPLEX is called again to solve the resulting continuous LP; then basis statuses from that LP are returned to AMPL along with the solution. Setting mipbasis=0 causes this “LP solve” to be skipped. Instead the solution returned by CPLEX is sent directly back to AMPL, without any basis statuses. Except in rare applications, the basis statuses are not used for anything, and turning off the LP solve does not impact the solution in any significant way.

The time for the LP solve is included in _solve_elapsed_time, but not in the “Total (root+branch&cut)” time reported by the CPLEX log. Usually this only causes the _solve_elapsed_time to be slightly larger, because the time for the LP solve is very small. For the problem you are solving, however, it appears that the LP solve requires a lot of computational effort. So when you set mipbasis=0 the reported _solve_elapsed_time is reduced significantly.

Note: This had been answered by email by @AMPL and I am just copying the answer here.