julialinear-programminggurobijulia-jump

Access root relaxation objective value in JuMP Gurobi


I am struggling to get any information on the web on how to store the root relaxation value in JuMP Gurobi.

Of course this is written here:

[...]
Coefficient statistics:
  Matrix range     [1e+00, 2e+00]
  Objective range  [7e+00, 6e+02]
  Bounds range     [0e+00, 0e+00]
  RHS range        [1e+00, 5e+00]
Presolve removed 102 rows and 51 columns
Presolve time: 0.27s
Presolved: 63802 rows, 5100 columns, 193850 nonzeros
Variable types: 0 continuous, 5100 integer (5100 binary)

Root relaxation: objective 1.502750e+03, 298 iterations, 0.13 seconds (0.12 work units)

Root relaxation: objective 1.502750e+03

But I can't store it apart from reading it in the terminal. As I will solve many instances does that mean I should store the terminal output then parse it?


Solution

  • Gurobi doesn't provide special support for querying the root relaxation.

    You will probably need to write a solver-specific callback that queries the objective value and store only the first objective found.

    Storing the logs and then parsing also works and is probably simpler. Note that the Gurobi root relaxation isn't always equivalent to solving the LP relaxation of the MIP.

    Another question to think about is: why is this useful?