[Coin-discuss] OsiClp: problem with sign of objective value
Kish Shen
kish.shen at crosscoreop.com
Fri Aug 11 00:22:05 EDT 2006
Hi,
I have done some more tests on this problem. For the problem (in LP format):
Maximize
obj: x0
Subject To
Bounds
0 <= x0 <= 1
End
when I try to solve the above problem (produced by calling OsiSolverInterface functions, rather
than from reading in the LP or MPS file) in ClpSolverInterface. The objective value is
incorrectly returned as -1 rather than 1. If I add a dummy constraint, e.g.
Maximize
obj: x0
Subject To
cons0: x0 >= -100000000000000000000
Bounds
0 <= x0 <= 1
End
the objective value is then correctly returned as 1.
I have tried to trace the execution of both problems, and the objective value in the ClpModel,
stored in objectiveValue_, is different in the above two cases. It is 1 in the first case (without
the dummy constraint) and -1 in the second (with the dummy constraint. This objective value is
then multiplied by the objective sense (-1 for maximising) and this gives the -1 and 1 objective
value respectively.
I tried to trace the execution further to see why there is this difference, but I was not really
able to follow what Clp was doing.
Any suggestions of how I can work round this problem, so that I can get the correct objective
value in the first case? Thanks in advance for any help!
Kish Shen
More information about the Coin-discuss
mailing list