IBM Support

Accessing the MIP relative optimality gap programmatically

Question & Answer


Question

How do I access the MIP relative optimality gap programmatically?

Answer

Starting version ILOG CPLEX 11.2 you can query the MIP relative optimality gap using one of the following methods based on the CPLEX API used:

* C Callable Library, CPXgetmiprelgap

* C++ API, IloCplex::getMIPRelativeGap

* Java API, IloCplex.getMIPRelativeGap

* .NET API, Cplex.MIPRelativeGap, this is Cplex class property

You can also query the value using callbacks:

* C Callable Library, use .CPXgetcallbackinfo with the symbolic value CPX_CALLBACK_INFO_MIP_REL_GAP as its argument for "whichinfo".

* C++ API, MIPInfoCallbackI::getMIPRelativeGap

* Java API, MIPInfoCallback.getMIPRelativeGap

* .Net API, MIPInfoCallback.MIPRelativeGap, this is MipInfoCallback class property

[{"Product":{"code":"SSSA5P","label":"IBM ILOG CPLEX Optimization Studio"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Not Applicable","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"12.5;12.4;12.3;12.2;12.1;12.0;11.2.1;11.2","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}},{"Product":{"code":"SSSA5P","label":"IBM ILOG CPLEX Optimization Studio"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF017","label":"Mac OS"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"12.5;12.4;12.3;12.2.0.1;12.2","Edition":"All Editions","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

cplex/FAQ/129

Document Information

Modified date:
16 June 2018

UID

swg21400046