You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all, if I clone a base solver instance (in my case, of OsiClpSolverInterface) that is proven optimal and for which basisIsAvailable returns true, the cloned solver no longer preserves this status because, at least for Clp, the copy constructor called within clone sets lastAlgorithm_ = 0.
What would be the right approach to access the tableau in the cloned solver, ensuring that it is exactly the same tableau as for the base solver instance? My guess is calling resolve on the cloned solver will typically suffice, but I want to make sure that there are no edge cases in which a different basis/tableau would be obtained. (In which case, if resolve produces a different tableau, then potentially the set of available cuts, for example, would be different, which would be problematic for creating reliable baselines.)
A snippet of the type of code that I am trying to use is below:
OsiSolverInterface* origSolver = new OsiClpSolverInterface;
origSolver = readMps("bm23.mps.gz");
origSolver->initialSolve();
// At this point, origSolver->basisIsAvailable() is true
OsiSolverInterface* copySolver = origSolver->clone();
// Here, copySolver->isProvenOptimal() is true, but copySolver->basisIsAvailable() is false
Thank you,
Aleks
The text was updated successfully, but these errors were encountered:
The values in the solution may differ by an incredibly small amount. This is because of the difference between a solve that does iterations and one that is given an optimal basis. The simplest thing to do is to do a resolve on origSolver before doing anything else. Once you are happy with results then try taking out some of the resolves - or directly use ClpSimplex where you have much more control.
Hi all, if I clone a base solver instance (in my case, of
OsiClpSolverInterface
) that is proven optimal and for whichbasisIsAvailable
returns true, the cloned solver no longer preserves this status because, at least for Clp, the copy constructor called within clone setslastAlgorithm_ = 0
.What would be the right approach to access the tableau in the cloned solver, ensuring that it is exactly the same tableau as for the base solver instance? My guess is calling
resolve
on the cloned solver will typically suffice, but I want to make sure that there are no edge cases in which a different basis/tableau would be obtained. (In which case, if resolve produces a different tableau, then potentially the set of available cuts, for example, would be different, which would be problematic for creating reliable baselines.)A snippet of the type of code that I am trying to use is below:
Thank you,
Aleks
The text was updated successfully, but these errors were encountered: