When cancelling a solution search early, which is not based on a specified rel. MIP gap limit but e.g. via a time limit, is it possible to display the relative MIP gap of the best feasible solution that was found by the solver?
Unfortunately there is no direct API as the definition of relative MIP gap varies across solvers.
You can always pick one formula and recompute it using the two methods on the objective: MPObjective.Value()
and MPObjective.BestBound()
.