Description
Summary
Request for reporting the optimality gap, regardless of the solver used, as a feature in Pyomo
Rationale
It appears that there is no built-in feature in Pyomo that reports the optimality gap or features to report the estimated objective by the solver to calculate the optimality gap manually. Though for some solvers this is reported by the solver when "tee=True", it is still hard to retrieve the gap automatically in the Pyomo
Description
Adding a feature in Pyomo that directly retrieves the optimality gap for any solvers, or at least reports the best estimated objective function, in addition to the objective value, so that users can manually calculate the optimality gap, can help a lot. This makes users less reliant on the "solver.termination_condition", especially for MINLP problems using "mindtpy", for which there is no feature for getting the optimality status by "solver.termination_condition".