[Clp] Objective value is nan, or checkClear assertion failure from createRim

John Forrest john.forrest at fastercoin.com
Mon Aug 14 05:16:49 EDT 2017


Alexsandr,

I have made changes in trunk and stable.

The Clp dual simplex algorithm operates on a dual feasible problem.  It 
does this by setting non-basic variables to a bound depending on reduced 
cost.  If bounds on variables are smallish this is easy - otherwise it 
may have to set them to a fake bound. If we have a solution that looks 
optimal then it "may" have to increase this fake bound and try again.

For some reason this was happening too much on your problems - maybe 
they were borderline dual infeasible.

A simple solution without using changes would be to set bounds of 1.0e8 
or something on all variables and constraints.

The change I have made is that by default the code will declare victory 
if the fake bound has been increased to 1.0e20.  For any masochists who 
think such numbers are too small, you can set -DCOIN_MAX_DUAL_BOUND=1.0e300.

John Forrest
On 09/08/17 17:50, Aleksandr M. Kazachkov wrote:
> Hi everyone,
>
> I have intermittently run into the following problems with LPs that I 
> am solving. I can reproduce the first three errors and attach LPs and 
> sample code below this message that works to reproduce the issues on 
> my machine (error 2 only happens with "badLP1"). The fourth error is 
> consistently produced with my full code, but the sample code does not 
> generate it.
>
> (1) Occasionally the objective value ends up being nan with an 
> accompanying assertion failure "OsiClpSolverInterface.cpp:1203: 
> virtual void OsiClpSolverInterface::resolve(): Assertion 
> `modelPtr_->objectiveValue()<1.0e100' failed." (This may be related to 
> the issue I wrote about, and was resolved, in May: 
> https://list.coin-or.org/pipermail/clp/2017-May/001705.html 
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_pipermail_clp_2017-2DMay_001705.html&d=DwMFaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=js2M0T-3OIMIVDvokcKjokJbk0F8QOCd0mT4FsVFE88&m=ZwBkG1Wqo-2LsWbspAar7YZCdLygBejXTFLz0VNMT-M&s=dtE_bEWhnOP89Diu5y_YDBcE3AFbJbRkIwJhPiq5wt8&e=>.)
>
> (2) When I try to avoid the problem by using an initialSolve after 
> checking whether resolve yields a nan objective, Clp may run into a 
> segmentation fault in gutsOfDelete at ClpSimplex.cpp:2755 when 
> deleting rowCopy_. Before the seg-fault, I see the status 
> message Clp0006I 13  Obj -nan Primal inf inf (103).
>
> (3) If presolve is turned on for resolve, an error I get is 
> ClpSimplexDual.cpp:7959: void ClpSimplexDual::resetFakeBounds(int): 
> Assertion `!nErrors' failed, again with a preceding status of Clp0006I 
> 3  Obj -nan Primal inf inf (6).
>
> (4) Sometimes I run into an assertion failure in createRim, at 
> ClpSimplex.cpp:4186, when calling checkClear for rowArray_[0]. This is 
> always after the problem gets perturbed by ClpSimplexDual::perturb. 
> This may or may not be related to a previous email from 2005: 
> https://list.coin-or.org/pipermail/clp/2005-August/000327.html 
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_pipermail_clp_2005-2DAugust_000327.html&d=DwMFaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=js2M0T-3OIMIVDvokcKjokJbk0F8QOCd0mT4FsVFE88&m=ZwBkG1Wqo-2LsWbspAar7YZCdLygBejXTFLz0VNMT-M&s=9RC-mebqJhuVufmUrNGEBY5MtakPBuRdgpmKM3nX1fE&e=>, 
> which was seemingly resolved by adding a "clear" in the relevant block 
> of the code. However, what I see (when clear is run) is that one 
> element of the CoinIndexedVector, rowArray_[0], is non-zero (at an 
> extremely large number), while nElements_ is 0, so the block of code 
> starting at CoinIndexedVector.cpp:47 is not entered into.
>
> I am using Clp version 1.16 build Jun 17 2017 on a Fedora machine. The 
> compilation options are: enable_debug=yes, enable_gnu_packages=yes, 
> with blas and lapack.
>
> The LP is resolved many times with different objective functions. 
> There are many free variables in the LP, which I think may be 
> relevant. The LP is also probably numerically unstable (e.g., in 
> badLP1, the smallest coefficient is 1e-6 and the largest is 80640, and 
> badLP2 is worse). I set a time limit of five seconds for each solve 
> (which may or may not be relevant).
>
> Please let me know if I can provide any more information,
> Alex
>
> === Errors ===
> // Set generateError1 to false if you want to see error 2
> const bool generateError1 = true; // must be false to get error 2
> const bool generateError2 = true;
> const bool generateError3 = false;  // must be false to get error 1 or 
> error 2
> const int num_iters = 1000;
> int iter = 0;
>
> if (generateError3) {
>   solver->setHintParam(OsiDoPresolveInResolve, 1);
> }
> solver->getModelPtr()->setMaximumSeconds(5);
> solver->initialSolve();
> while (iter < num_iters) {
>     for (int i = 0; i < solver->getNumCols(); i++) {
>       solver->getModelPtr()->setMaximumSeconds(5);
>       solver->setObjCoeff(i, 1.);
>       solver->resolve();
>       if (!generateError1 && std::isnan(solver->getObjValue())) {
> solver->getModelPtr()->setMaximumSeconds(5);
>         solver->initialSolve();
>         if (generateError2 && solver->isProvenOptimal()) {
>           solver->resolve();
>         }
>       } else if (generateError1) {
>         solver->resolve();
>       }
>       solver->setObjCoeff(i, 0.);
>     }
>     iter++;
> }
>
>
> _______________________________________________
> Clp mailing list
> Clp at list.coin-or.org
> https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_clp&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=js2M0T-3OIMIVDvokcKjokJbk0F8QOCd0mT4FsVFE88&m=ZwBkG1Wqo-2LsWbspAar7YZCdLygBejXTFLz0VNMT-M&s=1MRJLThB2ZrOtWsn3bKuYeecK6oxNAseiPH_ZL4zSF4&e=


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/clp/attachments/20170814/d5cf2a11/attachment.html>


More information about the Clp mailing list