<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!&nbsp;<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!&nbsp;</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>&gt; Date: Tue, 29 Nov 2011 08:45:03 -0800<br>&gt; From: lou@cs.sfu.ca<br>&gt; To: osi@list.coin-or.org<br>&gt; Subject: Re: [Osi] Proper way to fix Integers after a branchAndBound call?<br>&gt; <br>&gt; Sylvain,<br>&gt; <br>&gt; &gt; I am trying to solve a MIP problem and get the shadow costs of the<br>&gt; &gt; constraints after that. Out of the box that does not work if I just<br>&gt; &gt; call si.branchAndBound() and then si.getRowPrice(), which makes<br>&gt; &gt; sense. So this is what I did: 1. call si.branchAndBound();2. check<br>&gt; &gt; that it is proven optimal.3. loop through all the Integer/Binary<br>&gt; &gt; variables and set their Upper and Lower bounds to the solution found<br>&gt; &gt; during branchAndBound().4. call si.resolve(); Note that I am using<br>&gt; &gt; CPLEX as the solver's backend. The problem I am facing is that the<br>&gt; &gt; vector returned by si.getRowPrice() is only zeros. I figured that by<br>&gt; &gt; removing step #3 from my code, and just calling resolve(), I get<br>&gt; &gt; non-zeros values out of getRowPrice(), and they look descent. But<br>&gt; &gt; then my Integer variables becomes not Integer anymore...<br>&gt; <br>&gt; To add a bit to Stefan's explanation: The branchAndBound() call is<br>&gt; regarded by some of us (myself included) as a mistake that should never<br>&gt; have been included in the OSI API. OSI is a good match for continuous<br>&gt; exterior-point LP algorithms (i.e., simplex). It copes with various<br>&gt; other continuous LP algorithms. It simply doesn't have the hooks for<br>&gt; anything more complicated. To my knowledge, for the OsiXxx that<br>&gt; implement branchAndBound(), it'll be a standalone call to the underlying<br>&gt; solver. Integrality conditions (bounds) are not propagated back to the<br>&gt; problem representation held in the OsiXxx object. Other values (duals,<br>&gt; for example) are not in general valid. That's why you need step 3 to<br>&gt; impose integral bounds on the problem representation held in the OsiXxx<br>&gt; object before calling resolve(), which is a continuous resolve. After<br>&gt; that, the OsiXxx data structures are valid.<br>&gt; <br>&gt; It's an ongoing debate.<br>&gt; <br>&gt;                                                 Lou<br>&gt; _______________________________________________<br>&gt; Osi mailing list<br>&gt; Osi@list.coin-or.org<br>&gt; http://list.coin-or.org/mailman/listinfo/osi<br></div></div></div>                                               </div></body>
</html>