TimeLimit behavior with subproblems in callback
AnsweredDear community,
I have a Benders-like setup. That is, I have a (master) model in which I add lazy constraints using a callback. The lazy constraint depends on the solution of several subproblems. Each subproblem is a model created and solved inside the callback.
By means of example, I set Threads=1 and I defined the TimeLimit to be 25 seconds for the master problem and the TimeLimit of 10 seconds for each subproblem. The total Runtime of the solution procedure was ~420 seconds.
Is this the expected behavior?
Is the Runtime of each subproblem added to the total Runtime?
Is there a way to enforce a global time limit?
Thanks in advance (=
-
Hi Pedro Castellucci, probably you resolved this issue already. However, here the answer to your question since very likely other people have the same question.
You can enforce a global time limit as follows:
1: In the callback query the current runtime of your master problem: model.cbGet(GRB.Callback.RUNTIME)
2: Set the run time for your subproblems: min{max time limit per subproblem , (global time limit - current runtime)}
0
Please sign in to leave a comment.
Comments
1 comment