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

Solver related questions
Post Reply
venkatachalam
User
User
Posts: 1
Joined: 3 years ago

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

Post 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
User avatar
bussieck
Moderator
Moderator
Posts: 1033
Joined: 7 years ago

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

Post 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
Post Reply