<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
After digging into OsiCpxSolverInterface.cpp, I happened to find where the problem was:<div><br></div><div>I had a bug in my "fixIntegerVariables()" method... which was not only fixing Integer and Binary variables... but was also fixing all the Continuous variables! <span style="font-size: 10pt; ">With a problem with 100% of the variables fixed... no wonder I was getting 0 for all my constraint's shadow cost.</span></div><div><br></div><div>Thanks a lot for your help and taking the time to answer! </div><div><br></div><div>At least I confirmed in the first place that my approach was valid (as I did not find much documentation on that particular problem).</div><div><br></div><div><br></div><div>Sylvain<br><div><br><div>> Date: Tue, 29 Nov 2011 08:45:03 -0800<br>> From: lou@cs.sfu.ca<br>> To: osi@list.coin-or.org<br>> Subject: Re: [Osi] Proper way to fix Integers after a branchAndBound call?<br>> <br>> Sylvain,<br>> <br>> > I am trying to solve a MIP problem and get the shadow costs of the<br>> > constraints after that. Out of the box that does not work if I just<br>> > call si.branchAndBound() and then si.getRowPrice(), which makes<br>> > sense. So this is what I did: 1. call si.branchAndBound();2. check<br>> > that it is proven optimal.3. loop through all the Integer/Binary<br>> > variables and set their Upper and Lower bounds to the solution found<br>> > during branchAndBound().4. call si.resolve(); Note that I am using<br>> > CPLEX as the solver's backend. The problem I am facing is that the<br>> > vector returned by si.getRowPrice() is only zeros. I figured that by<br>> > removing step #3 from my code, and just calling resolve(), I get<br>> > non-zeros values out of getRowPrice(), and they look descent. But<br>> > then my Integer variables becomes not Integer anymore...<br>> <br>> To add a bit to Stefan's explanation: The branchAndBound() call is<br>> regarded by some of us (myself included) as a mistake that should never<br>> have been included in the OSI API. OSI is a good match for continuous<br>> exterior-point LP algorithms (i.e., simplex). It copes with various<br>> other continuous LP algorithms. It simply doesn't have the hooks for<br>> anything more complicated. To my knowledge, for the OsiXxx that<br>> implement branchAndBound(), it'll be a standalone call to the underlying<br>> solver. Integrality conditions (bounds) are not propagated back to the<br>> problem representation held in the OsiXxx object. Other values (duals,<br>> for example) are not in general valid. That's why you need step 3 to<br>> impose integral bounds on the problem representation held in the OsiXxx<br>> object before calling resolve(), which is a continuous resolve. After<br>> that, the OsiXxx data structures are valid.<br>> <br>> It's an ongoing debate.<br>> <br>>                                                 Lou<br>> _______________________________________________<br>> Osi mailing list<br>> Osi@list.coin-or.org<br>> http://list.coin-or.org/mailman/listinfo/osi<br></div></div></div>                                            </div></body>
</html>