Page 1 of 1

Set optimal solution

Posted: Sat Apr 13, 2019 10:50 am
by Faustino
Is there a way to set an optimal solution in my model, so GAMS won't try to find a better solution for hours if it already finds what I know to be the best solution in 15 Minutes?

I am using GAMS to create league schedules with varying constraints. One optimisation is to minimise the so-called carry-over effect (COE). But in this case, I already know the theoretical optimal solution. I just need GAMS to find one possible way to construct the schedule with the minimal COE value, but as GAMS doesn't know the minimal possible number. It keeps searching for hours without finishing, but if I interrupt it after 15 Minutes it already found a solution that I know is the minimal possible number.

I tried setting optca to the optimal number (48 in this example) which allows the Model to finish, but I don't think that is the correct way for larger models where I am uncertain if the theoretical optimal solution can be reached.

Re: Set optimal solution

Posted: Sat Jun 15, 2019 5:04 pm
by bussieck
Unfortunately, there is no simple way to do that, but a complicated one with GAMS/Cplex. You need to tell GAMS/Cplex to report all solutions found and to be reported to a "callback" program (userincbicall). This GAMS program can check if the stopping criterion is met (e.g. if the solution value is small/big enough) and if that is the case to tell GAMS/Cplex to read another option file in which you set a very large absolute gap which will make GAMS/Cplex terminate. This makes use of some undocumented options (iatrigger*). I have attached an example that shows how to do this.

-Michael