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

Solver related questions
Post Reply
venkatachalam
User
User
Posts: 1
Joined: 7 months ago

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

Post by venkatachalam » 7 months ago

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: 617
Joined: 4 years ago

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

Post by bussieck » 7 months ago

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