Computing Time

19 views
Skip to first unread message

Lia Clarke

unread,
Nov 17, 2022, 12:36:23 PM11/17/22
to AMPL Modeling Language
Hello,
I have implemented a model in Ampl and would like to limit it in time. If no solution is found after 120 seconds, the calculation should be aborted.
How can I specify this? Do I set it in the settings or can I insert a command before the solve comment?

Thanks for helpful answers

AMPL Google Group

unread,
Nov 18, 2022, 2:16:25 AM11/18/22
to AMPL Modeling Language
When you say "no solution is found after 120 seconds" do you mean that optimality has not been proved (to within the specified tolerances) after 120 seconds? All solvers have some way of saying that if they are still running after a specified number of seconds, then they should stop and return the best solution found so far. But the details of this option vary between solvers. Options for many solvers are given at https://dev.ampl.com/solvers/index.html. Or to get more help, reply with a list of solvers that you are planning to use.

Or do you mean something else -- for example that if the solver has not found a feasible solution after 120 seconds, it should stop, but otherwise it should continue until optimality is proved? In general, specialized stopping criteria can be defined only for some solvers, and only by implementing a specialized callback function. So it would be important to know exactly what you want to do, in order to give appropriate advice.


--
Robert Fourer
am...@googlegroups.com
{#HS:2071079577-112844#}
Reply all
Reply to author
Forward
0 new messages