Gurobi exceeded the time limit in clean environment
Awaiting user inputHi
I used a loop in main to loop over each instance in my dataset and I used an environment so the runtime does not overlap between each iteration of the loop (to ensure clean start for each iteration). Also, I set a timelimit (600 s), however, for some instances the runtime far exceeded 600, what can cause this behavior? I googled it but I cannoot find accuarte answer.
This is a sample of my code:
in main file:
for each instance n: 1 to 20
call function VRPF(instance n).
in VRP file:
function VRPF:
env = gp.Env(empty=True)
env.setParam("TimeLimit", 600)
env.start()
model = gp.Model(env=env, name="MIP-VRP")
#set obj and constraints
...............
model.optimize()
runTime = model.Runtime
# Clean up model and environment
model.dispose()
env.dispose()
return solution, runTime
Also, I noticed that if I run those instances (that exceeded 600s) alone without being in a loop, they do not exceed 600, why?
Regards,
-
Hi Eman,
How much is the time limit exceeded? If it is a lot, can you provide some code for us to run?
Cheers,
David0 -
one instance is 1443 s
the other one is 2537 s
is that a lot?
0 -
That is a lot indeed! Please provide a way for us to reproduce this. Does it happen when you run the MPS file? Or only in your code?
Cheers,
David0
Please sign in to leave a comment.
Comments
3 comments