multi-objective logging
AnsweredHi,
I'm trying to solve a hierarchical multi-objective ILP with gurobi 10.0.
When the model is solved, I retrieve the objective values with:
nSolutions = model.SolCount
nObjectives = model.NumObj
for s in range(nSolutions):
model.params.SolutionNumber = s
print('Solution', s, ':', end='\n')
for o in range(nObjectives):
model.params.ObjNumber = o
print(' ',model.ObjNVal, end='\n')
This gives me the following solution:
Solution 0 :
1074757567.0
44910059.0
Solution 1 :
1122697741.0
46681612.0
Solution 2 :
1126893891.0
47306774.0
As I also solved the single-objective problem before, I know that the returned objective value of objective 1 of the first solution is right.
When I look at the gurobi log, however, the incumbent seems to be even better and none of the solutions in "solution count" is returned by model.ObjNVal.
Optimize a model with 8236 rows, 17755 columns and 68217 nonzeros
Variable types: 0 continuous, 17755 integer (17749 binary)
Coefficient statistics:
Matrix range [8e-03, 3e+04]
Objective range [1e+03, 7e+07]
Bounds range [1e+00, 1e+00]
RHS range [1e+00, 2e+02]
---------------------------------------------------------------------------
Multi-objectives: starting optimization with 2 objectives ...
---------------------------------------------------------------------------
Multi-objectives: applying initial presolve ...
---------------------------------------------------------------------------
Presolve removed 8229 rows and 12014 columns
Presolve time: 0.02s
Presolved: 7 rows and 5741 columns
---------------------------------------------------------------------------
Multi-objectives: optimize objective 1 (LCC) ...
---------------------------------------------------------------------------
Found heuristic solution: objective 1.083384e+09
Presolve removed 0 rows and 3772 columns
Presolve time: 0.00s
Presolved: 7 rows, 1969 columns, 4073 nonzeros
Found heuristic solution: objective 1.079187e+09
Variable types: 0 continuous, 1969 integer (1897 binary)
Root relaxation: objective 1.024916e+09, 5 iterations, 0.00 seconds (0.00 work units)
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time
0 0 1.0249e+09 0 2 1.0792e+09 1.0249e+09 5.03% - 0s
0 0 1.0309e+09 0 1 1.0792e+09 1.0309e+09 4.48% - 0s
H 0 0 1.031247e+09 1.0309e+09 0.03% - 0s
0 0 1.0309e+09 0 1 1.0312e+09 1.0309e+09 0.03% - 0s
Explored 1 nodes (9 simplex iterations) in 0.08 seconds (0.05 work units)
Thread count was 8 (of 8 available processors)
Solution count 3: 1.03125e+09 1.07919e+09 1.08338e+09
Optimal solution found (tolerance 0.00e+00)
Best objective 1.031247217000e+09, best bound 1.031247217000e+09, gap 0.0000%
---------------------------------------------------------------------------
Multi-objectives: optimize objective 2 (CO2-eq) ...
---------------------------------------------------------------------------
Loaded user MIP start with objective 1.52736e+07
Presolve removed 0 rows and 3781 columns
Presolve time: 0.03s
Presolved: 8 rows, 1960 columns, 6005 nonzeros
Variable types: 0 continuous, 1960 integer (1890 binary)
Root relaxation: objective 1.527358e+07, 28 iterations, 0.00 seconds (0.00 work units)
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time
0 0 1.5274e+07 0 2 1.5274e+07 1.5274e+07 0.00% - 0s
Explored 1 nodes (28 simplex iterations) in 0.11 seconds (0.07 work units)
Thread count was 8 (of 8 available processors)
Solution count 1: 1.52736e+07
Optimal solution found (tolerance 1.00e-04)
Best objective 1.527357700000e+07, best bound 1.527357611111e+07, gap 0.0000%
---------------------------------------------------------------------------
Multi-objectives: solved in 0.13 seconds (0.07 work units), solution count 3
Do you have any idea/hint, why model.ObjNVal and logging values differ?
Thanks for your help!
-
Hi Nathalie,
This is a bug in 10.0.0 an will be fixed with 10.0.1. Please refer to Why does Gurobi 10.0.0 report an incorrect objective value for my multi-objective problem? for more details.
Best regards,
Jaromił0 -
Thanks for the quick response!
0
Please sign in to leave a comment.
Comments
2 comments