coin-or / Cbc.old

This is a mirror of the subversion repository on COIN-OR
https://projects.coin-or.org/Cbc
Other
88 stars 30 forks source link

[Trac #149] CBC reports incorrect optimal objective value #58

Open s-c-e opened 5 years ago

s-c-e commented 5 years ago

image

Attachments: https://github.com/s-c-e/cbc-trac-migration-attachments/blob/master/trac-ticket-149.zip

CBC reports an incorrect optimal objective value when solving a trivial problem available in .nl format here: ​https://drive.google.com/file/d/0B8fdrkFjzN7mV2ZIODc5cnBIMm8/edit?usp=sharing

Running

cbc test.nl -AMPL

produces a file test.sol containing the line:

CBC 2.8.8 optimal, objective 4e+01

Apart from strange formatting (the optimal value it tries to report is actually 45), the value is incorrect as can be checked with any other solver, e.g.

cplex test.nl CPLEX 12.6.0.0: optimal solution; objective 15005 4 dual simplex iterations (3 in phase I)

One obvious issue is that the constant offset is not taken into account here: ​https://projects.coin-or.org/Cbc/browser/trunk/Cbc/src/CbcSolver.cpp?rev=1780#L2802

However, even when taking the offset into account, one can still see that the value returned from CoinModel::getObjValue is wrong.