Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion `model->col_upper_[col] == kHighsInf || (model->col_upper_[col] >= implColUpper[col] - primal_feastol && colUpperSource[col] == row)' failed. #1688

Closed
Downsite opened this issue Mar 20, 2024 · 9 comments
Assignees
Labels

Comments

@Downsite
Copy link

Similar to #1684, it appears when solving the problem from C++, but I can't reproduce it from the MPS file. Maybe there is either a difference between the command line solver and the C++ API, or the MPS file is not an exact representation of the state of the optimizer?

Anyways, the problem is as follows:

Running HiGHS 1.7.0 (git hash: b0365f9ff): Copyright (c) 2024 HiGHS under MIT licence terms

ERROR:   Options file not found
Coefficient ranges:
  Matrix [2e-03, 1e+04]
  Cost   [1e+00, 1e+00]
  Bound  [1e+00, 1e+05]
  RHS    [2e-16, 5e+02]
Presolving model
157 rows, 108 cols, 415 nonzeros  0.001706s
122 rows, 75 cols, 397 nonzeros  0.002488s
110 rows, 66 cols, 367 nonzeros  0.007232s

Solving MIP model with:
   110 rows
   66 cols (38 binary, 0 integer, 0 implied int., 28 continuous)
   367 nonzeros

        Nodes      |    B&B Tree     |            Objective Bounds              |  Dynamic Constraints |       Work      
     Proc. InQueue |  Leaves   Expl. | BestBound       BestSol              Gap |   Cuts   InLp Confl. | LpIters     Time

         0       0         0   0.00%   -30.93630939    inf                  inf        0      0      0         0     0.0s
         0       0         0   0.00%   -16.5           inf                  inf        0      0      5        48     0.0s
 L       0       0         0   0.00%   -14.74854644    -1.475770857     899.38%      360     61     80       314     0.2s

Symmetry detection completed in 0.0s
Found 1 generators


main: /home/user/GitReps/myprogram/dep/HiGHS/src/presolve/HPresolve.cpp:3009: presolve::HPresolve::rowPresolve(presolve::HighsPostsolveStack&, HighsInt)::<lambda(HighsInt)>: Assertion `model->col_upper_[col] == kHighsInf || (model->col_upper_[col] >= implColUpper[col] - primal_feastol && colUpperSource[col] == row)' failed.

Thread 1 "main" received signal SIGABRT, Aborted.
__pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at pthread_kill.c:44
warning: 44	pthread_kill.c: Datei oder Verzeichnis nicht gefunden
(gdb) bt
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at pthread_kill.c:89
#3  0x00007ffff6e44256 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007ffff6e28835 in __GI_abort () at abort.c:79
#5  0x00007ffff6e28759 in __assert_fail_base (fmt=0x7ffff6fbebf8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=assertion@entry=0x7ffff7da18a0 "model->col_upper_[col] == kHighsInf || (model->col_upper_[col] >= implColUpper[col] - primal_feastol && colUpperSource[col] == row)", 
    file=file@entry=0x7ffff7da0a60 "/home/user/GitReps/myprogram/dep/HiGHS/src/presolve/HPresolve.cpp", line=line@entry=3009, 
    function=function@entry=0x7ffff7da1798 "presolve::HPresolve::rowPresolve(presolve::HighsPostsolveStack&, HighsInt)::<lambda(HighsInt)>") at assert.c:94
#6  0x00007ffff6e3af16 in __assert_fail (assertion=0x7ffff7da18a0 "model->col_upper_[col] == kHighsInf || (model->col_upper_[col] >= implColUpper[col] - primal_feastol && colUpperSource[col] == row)", 
    file=0x7ffff7da0a60 "/home/user/GitReps/myprogram/dep/HiGHS/src/presolve/HPresolve.cpp", line=3009, function=0x7ffff7da1798 "presolve::HPresolve::rowPresolve(presolve::HighsPostsolveStack&, HighsInt)::<lambda(HighsInt)>") at assert.c:103
#7  0x00007ffff7bdb78e in operator() (__closure=0x7ffffffe2d40, col=32) at /home/user/GitReps/myprogram/dep/HiGHS/src/presolve/HPresolve.cpp:3009
#8  0x00007ffff7bdbf2c in presolve::HPresolve::rowPresolve (this=0x7ffffffe3100, postsolve_stack=..., row=45) at /home/user/GitReps/myprogram/dep/HiGHS/src/presolve/HPresolve.cpp:3027
#9  0x00007ffff7be959b in presolve::HPresolve::presolveChangedRows (this=0x7ffffffe3100, postsolve_stack=...) at /home/user/GitReps/myprogram/dep/HiGHS/src/presolve/HPresolve.cpp:5107
#10 0x00007ffff7be37e7 in presolve::HPresolve::fastPresolveLoop (this=0x7ffffffe3100, postsolve_stack=...) at /home/user/GitReps/myprogram/dep/HiGHS/src/presolve/HPresolve.cpp:4057
#11 0x00007ffff7be3fa1 in presolve::HPresolve::presolve (this=0x7ffffffe3100, postsolve_stack=...) at /home/user/GitReps/myprogram/dep/HiGHS/src/presolve/HPresolve.cpp:4173
#12 0x00007ffff7be5194 in presolve::HPresolve::run (this=0x7ffffffe3100, postsolve_stack=...) at /home/user/GitReps/myprogram/dep/HiGHS/src/presolve/HPresolve.cpp:4385
#13 0x00007ffff7c1d29e in PresolveComponent::run (this=0x7ffffffee540) at /home/user/GitReps/myprogram/dep/HiGHS/src/presolve/PresolveComponent.cpp:39
#14 0x00007ffff7981f67 in Highs::runPresolve (this=0x7ffffffe9b58, force_lp_presolve=true, force_presolve=false) at /home/user/GitReps/myprogram/dep/HiGHS/src/lp_data/Highs.cpp:3188
#15 0x00007ffff79763a0 in Highs::run (this=0x7ffffffe9b58) at /home/user/GitReps/myprogram/dep/HiGHS/src/lp_data/Highs.cpp:1208
#16 0x00007ffff7ae27ab in HighsLpRelaxation::run (this=0x7ffffffe9b50, resolve_on_error=true) at /home/user/GitReps/myprogram/dep/HiGHS/src/mip/HighsLpRelaxation.cpp:1050
#17 0x00007ffff7ae34c9 in HighsLpRelaxation::resolveLp (this=0x7ffffffe9b50, domain=0x0) at /home/user/GitReps/myprogram/dep/HiGHS/src/mip/HighsLpRelaxation.cpp:1206
#18 0x00007ffff7b4f0c3 in HighsPrimalHeuristics::randomizedRounding (this=0x555556a7ae50, relaxationsol=std::vector of length 40, capacity 40 = {...}) at /home/user/GitReps/myprogram/dep/HiGHS/src/mip/HighsPrimalHeuristics.cpp:989
#19 0x00007ffff7aebfba in HighsMipSolver::run (this=0x7ffffffef5d0) at /home/user/GitReps/myprogram/dep/HiGHS/src/mip/HighsMipSolver.cpp:200
#20 0x00007ffff7b49ecd in HighsPrimalHeuristics::solveSubMip (this=0x5555568cf420, lp=..., basis=..., fixingRate=0.31578947368421051, colLower=std::vector of length 0, capacity 0, colUpper=std::vector of length 0, capacity 0, maxleaves=500, 
    maxnodes=200, stallnodes=12) at /home/user/GitReps/myprogram/dep/HiGHS/src/mip/HighsPrimalHeuristics.cpp:144
#21 0x00007ffff7b4d7fc in HighsPrimalHeuristics::RINS (this=0x5555568cf420, relaxationsol=std::vector of length 66, capacity 66 = {...}) at /home/user/GitReps/myprogram/dep/HiGHS/src/mip/HighsPrimalHeuristics.cpp:800
#22 0x00007ffff7aec08f in HighsMipSolver::run (this=0x7fffffff5ee0) at /home/user/GitReps/myprogram/dep/HiGHS/src/mip/HighsMipSolver.cpp:207
#23 0x00007ffff79840ff in Highs::callSolveMip (this=0x7fffffff7030) at /home/user/GitReps/myprogram/dep/HiGHS/src/lp_data/Highs.cpp:3590
#24 0x00007ffff7975842 in Highs::run (this=0x7fffffff7030) at /home/user/GitReps/myprogram/dep/HiGHS/src/lp_data/Highs.cpp:1053
@fwesselm
Copy link
Contributor

Interesting, could you provide the MPS file?

@jajhall
Copy link
Sponsor Member

jajhall commented Mar 20, 2024

I note that it says "options file not found", so if you're wanting to reproduce options settings that you make in your application, it's not picking them up.

I didn't look at your MPS file, but there's a limit to the precision of real values in MPS

@Downsite
Copy link
Author

Downsite commented Mar 20, 2024

I note that it says "options file not found", so if you're wanting to reproduce options settings that you make in your application, it's not picking them up.

No option file is used in either the call from the C++ API or from console. The path is set, so that I could change the options of the subsolver (e.g. HiGHS ) without recompilation.

I didn't look at your MPS file, but there's a limit to the precision of real values in MPS

Is there an option to generate a MPS file with extended precision (Xpress used to need a flag to save in full precision).
I currently just use model.writeModel(this->get_name()+".mps");. Is there a way the model in a way that is better at reproducing such issues?

I attached the MPS file below, but as I said, from the console I can't reproduce the bug either.

prob.mps.txt

@jajhall
Copy link
Sponsor Member

jajhall commented Mar 20, 2024

I see that your MPS file has plenty of full-length values. The option you describe would be relatively easy to implement.

I'm puzzled as to why that "Options file not found" is logged

@Downsite
Copy link
Author

I'm puzzled as to why that "Options file not found" is logged

I think this is because I do not check if the file exists, but always forward the path to HiGHS

// try to read settings from file
model.readOptions(this->settings_file);

@Downsite
Copy link
Author

Downsite commented Mar 20, 2024

prob.mps.txt

Generating it with more significant digits seems to be easy indeed. (I just replaced "10g" with "17g" in HMPSIO.cpp).
Not sure if this precision is read in, as the problem does still not occur when calling HiGHS directly.

@Downsite
Copy link
Author

Downsite commented Mar 20, 2024

I tried the following to debug/reproduce the issue:

  • call writeModel directly followed from readModel ==> there still is a case with the errror
  • save the options via model.writeOptions(this->get_name()+".opt", false);, even with that option file and the more accurate MPS file, the error does not occur in the console.

BTW: model.writeOptions(this->get_name()+".opt", true); did not write anything for me, even when I changed some settings on purpose. See prob.opt.txt.

@fwesselm
Copy link
Contributor

Unfortunately, I am not able to reproduce this yet. I suspect that its due to the fact that the problematic assertions do not take into account that the implied column bounds may be infinite, i.e. implColLower[col] == -kHighsInf or implColUpper[col] == kHighsInf.

I have tried to fix this in my fork: https://github.com/fwesselm/HiGHS/tree/fixAssertionFailure

@Downsite, could you try this out? Thank you.

@Downsite
Copy link
Author

Downsite commented May 9, 2024

Thanks!
This helped, at least for the concrete case where the error was occuring before.
It will be some time before I have the chance to run extendend tests again, but I consider this issue fixed with this change.

@Downsite Downsite closed this as completed May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants