[Osi] Proper way to fix Integers after a branchAndBound call?

Lou Hafer lou at cs.sfu.ca
Tue Nov 29 11:45:03 EST 2011


Sylvain,

> I am trying to solve a MIP problem and get the shadow costs of the
> constraints after that. Out of the box that does not work if I just
> call si.branchAndBound() and then si.getRowPrice(), which makes
> sense. So this is what I did: 1. call si.branchAndBound();2. check
> that it is proven optimal.3. loop through all the Integer/Binary
> variables and set their Upper and Lower bounds to the solution found
> during branchAndBound().4. call si.resolve(); Note that I am using
> CPLEX as the solver's backend. The problem I am facing is that the
> vector returned by si.getRowPrice() is only zeros. I figured that by
> removing step #3 from my code, and just calling resolve(), I get
> non-zeros values out of getRowPrice(), and they look descent. But
> then my Integer variables becomes not Integer anymore...

To add a bit to Stefan's explanation: The branchAndBound() call is
regarded by some of us (myself included) as a mistake that should never
have been included in the OSI API. OSI is a good match for continuous
exterior-point LP algorithms (i.e., simplex). It copes with various
other continuous LP algorithms. It simply doesn't have the hooks for
anything more complicated. To my knowledge, for the OsiXxx that
implement branchAndBound(), it'll be a standalone call to the underlying
solver. Integrality conditions (bounds) are not propagated back to the
problem representation held in the OsiXxx object. Other values (duals,
for example) are not in general valid. That's why you need step 3 to
impose integral bounds on the problem representation held in the OsiXxx
object before calling resolve(), which is a continuous resolve. After
that, the OsiXxx data structures are valid.

It's an ongoing debate.

						Lou


More information about the Osi mailing list