[Cbc] problem with re-solving a model

Michal Kaut mail at michalkaut.net
Wed Feb 6 05:08:18 EST 2008


[Sorry for re-posting, but I sent it two days ago with no effect...]

Hello,

I have encountered a rather strange problem (at least to me): I have an
MIP model which I am solving repetitively with different bounds (both
columns and rows). It works OK with Glpk (well, except for speed), but
no so with Cbc.
For some instances, the branchAndBound() method will fail to find the
optimal solution, finding instead an infeasible one and finishing with:
"On closer inspection node is infeasible". The fact that there indeed is
an feasible (and thus optimal) solution can be verified in two ways:
- Save an MPS file right before the solve. The MPS file than solves OK,
also with Cbc. (I can even create a second OsiCbcSolverInterface object,
load the MPS into it and it will solve without problems.)
- Create a new OsiCbcSolverInterface object, copy the model from the
first one using loadProblem (accessing the data using getMatrixByRow(),
getColLower(), etc.) and then copy the integer status of the variables.
Running branchAndBound() on this new object also solves the problem to
optimality.

So, maybe I need to reset some parameters/members of the
OsiCbcSolverInterface object, in order to get the same solution as I
would get by copying the model into a new object?
Note: I have already noticed that the branchAndBound() method changes
variable bounds, so I always save them before calling the method and
re-set the bounds afterwards. Maybe there are more things I need to reset?

Or would it be better/cleaner to have a "base model" and then at each
iteration, I would create a fresh copy, update the bounds, solve it and
delete the model? If so, what is the fastest way of copying an
OsiCbcSolverInterface object? (Speed really is an issue here, since I am
solving a lot of these problems.)


Thanks a lot in advance.

Regards,
Michal Kaut



More information about the Cbc mailing list