MIPGap

Relative MIP optimality gap
 Type: double
 Default value: 1e-4
 Minimum value: 0
 Maximum value: Infinity

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 <span>$</span>z_P<span>$</span> is the primal objective bound (i.e., the incumbent objective value, which is the upper bound for minimization problems), and <span>$</span>z_D<span>$</span> is the dual objective bound (i.e., the lower bound for minimization problems), then the MIP gap is defined as

<span>$</span>gap = \vert z_P - z_D\vert / \vert z_P\vert<span>$</span>.

Note that if <span>$</span>z_P = z_D = 0<span>$</span>, then the gap is defined to be zero. If <span>$</span>z_P = 0<span>$</span> and <span>$</span>z_D \neq 0<span>$</span>, the gap is defined to be infinity.

For most models, <span>$</span>z_P<span>$</span> and <span>$</span>z_D<span>$</span> will have the same sign throughout the optimization process, and then the gap is monotonically decreasing. But if <span>$</span>z_P<span>$</span> and <span>$</span>z_D<span>$</span> have opposite signs, the relative gap may increase after finding a new incumbent solution, even though the absolute gap <span>$</span>\vert z_P - z_D\vert<span>$</span> 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.