AnsweredAssumed Answered

How to stop a MIP when time limit hit - Even with no solutions.

Question asked by scchew@student.unimelb.edu.au on Apr 13, 2016
Latest reply on Apr 14, 2016 by scchew@student.unimelb.edu.au

Hi there,

 

I programmed my MIP to stop when time limit hit by using the following:

 

-----------------------------------------------------------------------------------------------------------------------------------------

declarations

     MAXTIME = 100     !Set time limit to 100 seconds

     StopS: real

end-declarations

 

setparam("XPRS_MAXTIME", MAXTIME)

SolveMIP

StopS := getparam("XPRS_STOPSTATUS")

writeln("Stop Status: ",if(StopS=XPRS_STOP_TIMELIMIT,"Time Limit Hit",""))

-----------------------------------------------------------------------------------------------------------------------------------------

 

The program works fine if at least an integer solution is found.

However, if no integer solution is found within the time limit (100 secs), the program will continue to run and stop only when the first integer solution is found, and return the message of 'Time Limit Hit'.

 

How can I ask the program to stop strictly at the time limit even if no solution is found?

 

Thank you in advance!

Outcomes