Originally posted by: SystemAdmin
[johncui said:]
Please try:
CPXgetmiprelgap
int CPXgetmiprelgap(CPXCENVptr env, CPXCLPptr lp, double * gap_p)
Definition file: cplex.h
The routine CPXgetmiprelgap accesses the relative objective gap for a MIP optimization.
For a minimization problem, this value is computed by
(bestinteger - bestobjective) / (1e-10 + |bestobjective|)
where bestinteger is the value returned by CPXgetobjval and bestobjective is the value returned by CPXgetbestobjval. For a maximization problem, the value is computed by:
(bestobjective - bestinteger) / (1e-10 + |bestobjective|)
Example
status = CPXgetmiprelgap (env, lp, &gap);
Parameters:
env A pointer to the CPLEX environment as returned by CPXopenCPLEX.
lp A pointer to a CPLEX problem object as returned by CPXcreateprob.
gap_p A pointer to the location where the relative mip gap is returned.
Returns:
The routine returns zero if successful and nonzero if an error occurs.
#DecisionOptimization#MathematicalProgramming-General