[Coin-discuss] Construct a MIP problem
Ted Ralphs
tkralphs at lehigh.edu
Fri Mar 18 13:04:28 EST 2005
Spencer,
It is not a bug. The way the CPLEX solver works is not actually very
compatible with the way the current version of OSI works. As long as
CPLEX thinks the problem type is an LP, it will not keep track of the
integrality status of the variables. One possible solution would be to
set the problem type to MIP whenever the user asks for the integrality
type of the variables to be changed, so that CPLEX will accept it.
However, once this switch is made, the problem can no longer be solved
as an LP. If one then tries to switch the problem type back to LP, CPLEX
will "forget" the integrality information again. And even nastier things
can happen---if one tries to solve the problem as an LP and then
switches the problem type to MIP, CPLEX "forgets" the LP solution
information. This is a big problem when using OsiCpx in a branch and cut
implementation where one wants to solve LP relaxations and retain both
the LP solution information and the integrality status of the variables
at the same time. This is basically impossible with a straightforward
interface to CPLEX. The best solution seems to be to simply cache the
information for the user and load it only when it is really needed,
i.e., when the branchAndBound() method is actually called. The
unfortunate side effect is that CPLEX always thinks it has an LP on its
hands and writeMps() will not work properly, as you have discovered.
There is no perfect solution to this until we redesign Osi, which is
currently in the works. Hope this helps explain things.
Ted
--
Dr. Ted Ralphs
Assistant Professor
Industrial and Systems Engineering
Lehigh University
(610)758-4784
tkralphs at lehigh.edu
www.lehigh.edu/~tkr2
More information about the Coin-discuss
mailing list