Highly increased generation time of the same model solved subsequently

Hi all,

I have a QP model I built in GAMSPy that is large, but relatively simple. With CPLEX barrier solves within the couple of seconds. However, I noticed unexpected decrease in performance when I try to solve the same model once again, i.e. I run something like:

m.solve(solver="cplex")
m.solve(solver="cplex")

Two solve statements one after another. What it noticed, is that the generation time during the second statement is extremally high. While for the first one it is 0.360s, for a second one it might be over a minute. I experimented with various GAMS options but couldn’t find the solution for it, and I also have a hard time understanding this behaviour. Again, this is the same model, without any changes.

I cannot post the entire model at this time, but I attach the log file that illustrates this problem

QP.log (25.3 KB)

Would be grateful for your help as this has been giving me hard time. If the log is not sufficient, I will try to provide representative example.

Best,

Adam

It would be nice if you can share a representative example so that we can reproduce it.

Thanks, Muhammet.

I couldn’t reproduce the problem to the extreme I have with my model, but I see similar behaviour with the modified model of DED from example library.

In the attached log you can see that I solve the same model 7 times in a row, and the model generation time for the first iteration is around 5s and for the last one over 20s.

QP_test.zip (85.7 KB)

Thank you Adam. I was able to reproduce it on my machine as well but one interesting observation is that it stabilizes after around 5 iterations. I just print the model generation time after each solve with print(f"{DEDcostbased.model_generation_time=}") and here is what I get:

DEDcostbased.model_generation_time=4.88
DEDcostbased.model_generation_time=6.985
DEDcostbased.model_generation_time=9.077
DEDcostbased.model_generation_time=10.607000000000001
DEDcostbased.model_generation_time=11.179
DEDcostbased.model_generation_time=11.193999999999999
DEDcostbased.model_generation_time=11.325000000000001
DEDcostbased.model_generation_time=11.196
DEDcostbased.model_generation_time=11.238
DEDcostbased.model_generation_time=11.579
DEDcostbased.model_generation_time=11.35
DEDcostbased.model_generation_time=11.402999999999999
DEDcostbased.model_generation_time=11.325
DEDcostbased.model_generation_time=11.205
DEDcostbased.model_generation_time=11.308
DEDcostbased.model_generation_time=11.284
DEDcostbased.model_generation_time=11.755
DEDcostbased.model_generation_time=11.722
DEDcostbased.model_generation_time=11.335
DEDcostbased.model_generation_time=11.375

I will investigate this issue with my colleagues that work on the GAMS side. Thanks for reporting!