[Cbc] getting solution to original problem from Cbc/Clp
Kish Shen
kisshen at cisco.com
Fri Oct 19 12:03:55 EDT 2007
Hi,
I am using CBC with CLP as the linear solver. CLP is accessed via OSI
i.e. OsiClpSolverInterface), but CBC is accessed directly, instead of
via OSI.
I have been obtaining the solution state for MIP problems via the OSI
calls, e.g. getColSolution(), getRowPrice(), etc.. One of our users
reported that some of the solution is incorrect, e.g. variables that
should be integers are not, and some constraints are violated.
I suspected that this is because the OSI calls are via
OsiClpSolverInterface, and so I am obtaining the state from the most
recent LP relaxation, rather than the most recent MIP solution. I
therefore changed the code to obtain the solution state via Cbc calls,
for example, bestSolution() of CbcModel instead of getColSolution().
Unfortunately, in this case, the number of columnssiz in the problem
seems to be much smaller: in one example, the original problem had 945
columns, and the MIP solution of the problem has only 205 columns. I
assume this is because presolve reduced the problem, and bestSolution()
returns the solution for the presolved matrix.
Questions:
1) Am I correct that OSIClpSolverInterface's methods, such as
getColSolution(), is returning the state from the LP relaxation, rather
than the MIP solution? [If not, then there is something wrong with the
MIP solution produced]
2) How can I obtain the MIP solution state (solution values, row price,
row activity, reduced cost [and basis status for the LP relaxation that
produced the MIP solution, if this is available], for the original
problem (and not the presolved problem)?
Thanks in advance for any help/information!
Cheers,
Kish Shen
More information about the Cbc
mailing list