[Cbc] getting solution to original problem from Cbc/Clp

John J Forrest jjforre at us.ibm.com
Sat Oct 20 13:56:01 EDT 2007


Kish,

It sounds as if you are using presolve rather than CglPreProcess.  This 
could give wrong results as you describe.

Look at Cbc/examples/sample2.cpp and try with PREPROCESS defined to 1 or 2 
to see two ways of using CglPreProcess.

As to your questions.

1)  The solver can in some circumstances not have an integer solution - 
bestSolution is what is needed but it must go through post processing.
2) The result should be correct for problem with all integer variables 
fixed to correct values.


John Forrest



Kish Shen <kisshen at cisco.com> 
Sent by: cbc-bounces at list.coin-or.org
10/19/2007 12:03 PM

To
cbc at list.coin-or.org
cc

Subject
[Cbc] getting solution to original problem from Cbc/Clp






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
_______________________________________________
Cbc mailing list
Cbc at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/cbc

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.coin-or.org/pipermail/cbc/attachments/20071020/84537df5/attachment.html


More information about the Cbc mailing list