Getting the upper and lower bounds in MILP - JuMP

Hello everyone,
When I use JuMP v0.21.7 with the Gurobi solver and optimize a MILP, how do I get, after optimization:

  1. The value of the first upper bound (of the first incumbent solution).
  2. The value of the first lower bound (from the first incumbent solution).
  3. The value of the upper limiter at the end of the run.
  4. The value of the lower limiter at the end of the run.
    (see the figure below in a maximization problem)

My intention is to study how the lower and upper bounds change as the Gurobi optimizes.
Thank you very much!

There is no function in JuMP that allows you to query the first primal / dual bound.
The functionalities that are exposed are the following:

All three are valid only after the optimization is done. Check JuMP’s recommended workflow for how to query them.

If you want to track the progress of the primal / dual bound over time, I can think of two options (assuming you use Gurobi):

  • Use a Gurobi-specific callback: this will allow you to query information such as current upper and lower bound each time your callback is called. You will have to hook into Gurobi’s API directly.
  • Outside JuMP: if you’re OK with plotting progress after the fact, you may find Gurobi’s grblogtools useful.