The MIP solver will terminate (with an optimal result) when the gap
between the lower and upper objective bound is less than
MIPGap times the absolute value of the incumbent objective
value. More precisely, if is the primal objective bound (i.e.,
the incumbent objective value, which is the upper bound for
minimization problems), and is the dual objective bound (i.e.,
the lower bound for minimization problems), then the MIP gap is
Note that if , then the gap is defined to be zero. If and , the gap is defined to be infinity.
For most models, and will have the same sign throughout the optimization process, and then the gap is monotonically decreasing. But if and have opposite signs, the relative gap may increase after finding a new incumbent solution, even though the absolute gap has decreased.
Note: Only affects mixed integer programming (MIP) models
For examples of how to query or modify parameter values from our different APIs, refer to our Parameter Examples.