Skip to main content
Solved

How to retrieve MIP Optimality Gap an Solving Time into a Parameter

  • January 4, 2020
  • 4 replies
  • 479 views

rahmat
Forum|alt.badge.img+4

Dear All,

Is possible to retrieve MIP optimalilty gap and Solving Time for each solve in to a parameter?

If so, how to do this?

Thank you very much.

Best answer by deannezhang

You can use the “Incumbent” and “Incumbent” suffix to retrieve the best known solution and the  LP bound, then use them to calculate the GAP and assign it to a parameter.

MpGap :=(abs(MathProgram.Incumbent - MathProgram.bestbound)/$abs(MathProgram.Incumbent)) * 100;

 

4 replies

deannezhang
AIMMS Champ
Forum|alt.badge.img+3
  • AIMMS Champ
  • 61 replies
  • Answer
  • January 5, 2020

You can use the “Incumbent” and “Incumbent” suffix to retrieve the best known solution and the  LP bound, then use them to calculate the GAP and assign it to a parameter.

MpGap :=(abs(MathProgram.Incumbent - MathProgram.bestbound)/$abs(MathProgram.Incumbent)) * 100;

 


rahmat
Forum|alt.badge.img+4
  • Author
  • Ace
  • 33 replies
  • January 6, 2020

Hello @deannezhang,

Thank you for the method to calculate the gap. For solving time, is there a way to retrieve it?

Thank you.


deannezhang
AIMMS Champ
Forum|alt.badge.img+3
  • AIMMS Champ
  • 61 replies
  • January 6, 2020

Yes, you can use the “SolutionTime” suffix. For other suffix and callback functions, you can refer to the AIMMS Language reference, part “Suffices and Callbacks”.


rahmat
Forum|alt.badge.img+4
  • Author
  • Ace
  • 33 replies
  • January 7, 2020

Hi @deannezhang,

Thanks a lot….



Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator