Page 1 of 1

How to get relative optimality gap after the solve statement in GAMS

Posted: Thu Dec 10, 2020 9:30 pm
by venkatachalam
Hi there,
I want to extract and display the relative optimality gap of the solution found by the solver in GAMS after the solve statement. How do I do that
Note that this is different from specifying optcr before the solve statement

Re: How to get relative optimality gap after the solve statement in GAMS

Posted: Fri Dec 11, 2020 8:55 am
by bussieck
After the solve you have access to `modelname.objest` (dual bound) and the objective value `modelname.objval` now you can calculate the relative gap yourself using your favorite formula. Note that different solvers use different formulas to determine the gap: https://www.gams.com/latest/docs/UG_Gam ... AMSAOoptcr

Hope this helps,
-Michael