Closed nick-gorman closed 2 years ago
I have similar problem; quite new to using python-mip. Currently working on version 1.7.3 on Windows 10/64-bit Python 3.7 (64-bit). Also tested v 1.6.8
For me, the error is 'random'; in that i can run the same code several times; and it will complete a solution every so often.
I've not debugged through python-mip code yet, but there's something odd going on with the either filtering or redirection of stdout; or something to do with multi-threading possibly? Note the 'C' on the line below, is that normal?
Coptimal solution cost 8425.08888888889 found
.e.g.. On Fail it will print part of the line, then fail
Cbc0038I Pass 19: suminf. 1.29305 (14) obj. 8406.07 iterations 28
Cbc0038I Pass 20: suminf. 1.29305 (14) obj. 8406.07 iterations 0
Cbc0038I Pass 21: suminf. 4.25929 (18) obj. 7506.12 iterations 21
Cbc0038I Pass 22: suminf. 2.11761 (10) obj. 7818.55 iterations 18
Cbc0038I Pass 23: suminf. 2.11761 (10) obj. 7818.55 iterations 4
Cbc0038I Pass 24: suminf. 1.78335 (4) obj. 8406.07 iterations 32
Cbc0038I Pass 25: suminf. 0.28224 (4) obj. 8279.58 iterations 13
Cbc0038I Pass 26: suminf. 1.29305 (14) obj. 8406.07 iterations 20
Cbc0038I Pass 27: suminf. 4.04683 (18) obj. 7541.92 iterations 19
Cbc0038I Pass 28: suminf. 2.11761 (10) obj. 7818.55 iterations 14
Cbc0038I Pass 29: suminf. 2.11761 (10) obj. 7818.55 iterations 3
Cbc0038I Pass 30: suminf. 1.78335 (4) obj. 8406.07 iterations 31
Cbc0038I Pass 31: suminf. 0.28224 (4) obj. 8279.58 iterations 15
Cbc0038I Pass 32: suminf. 1.29305 (14) obj. 8406.07 iterations 24
C
Process finished with exit code -1073741819 (0xC0000005)
But sometimes, same code will complete
Cbc0038I Pass 26: suminf. 1.29305 (14) obj. 8406.07 iterations 20
Cbc0038I Pass 27: suminf. 4.04683 (18) obj. 7541.92 iterations 19
Cbc0038I Pass 28: suminf. 2.11761 (10) obj. 7818.55 iterations 14
Cbc0038I Pass 29: suminf. 2.11761 (10) obj. 7818.55 iterations 3
Cbc0038I Pass 30: suminf. 1.78335 (4) obj. 8406.07 iterations 31
Cbc0038I Pass 31: suminf. 0.28224 (4) obj. 8279.58 iterations 15
Cbc0038I Pass 32: suminf. 1.29305 (14) obj. 8406.07 iterations 24
Coptimal solution cost 8425.08888888889 found
solution:
bc0038I Pass 33: suminf. 4.25929 (18) obj. 7506.12 iterations 25
Cbc0038I Pass 34: suminf. 2.11761 (10) obj. 7818.55 iterations 23
Cbc0038I Pass 35: suminf. 2.11761 (10) obj. 7818.55 iterations 2
Cbc0038I Pass 36: suminf. 1.78335 (4) obj. 8406.07 iterations 35
Cbc0038I Pass 37: suminf. 0.28224 (4) obj. 8279.58 iterations 20
Cbc0038I No solution found this major pass
Cbc0038I Before mini branch and bound, 556 integers at bound fixed and 5 continuous
Cbc0038I Full problem 1316 rows 692 columns, reduced to 71 rows 47 columns
Cbc0038I Mini branch and bound did not improve solution (0.45 seconds)
Cbc0038I After 0.45 seconds - Feasibility pump exiting with objective of 8592.84 - took 0.12 seconds
Cbc0012I Integer solution of 8592.8444 found by feasibility pump after 0 iterations and 0 nodes (0.45 seconds)
Cbc0012I Integer solution of 8425.0889 found by DiveCoefficient after 0 iterations and 0 nodes (0.46 seconds)
Cbc0038I Full problem 1316 rows 692 columns, reduced to 40 rows 24 columns
Cbc0006I The LP relaxation is infeasible or too expensive
Cbc0013I At root node, 0 cuts changed objective from 6725.3529 to 8155.4204 in 1 passes
Cbc0014I Cut generator 0 (Probing) - 55 row cuts average 2.0 elements, 85 column cuts (85 active) in 0.003 seconds - new frequency is 1
Cbc0014I Cut generator 1 (Gomory) - 0 row cuts average 0.0 elements, 0 column cuts (0 active) in 0.000 seconds - new frequency is -100
Cbc0014I Cut generator 2 (Knapsack) - 0 row cuts average 0.0 elements, 0 column cuts (0 active) in 0.000 seconds - new frequency is -100
Cbc0014I Cut generator 3 (Clique) - 0 row cuts average 0.0 elements, 0 column cuts (0 active) in 0.000 seconds - new frequency is -100
Cbc0014I Cut generator 4 (MixedIntegerRounding2) - 0 row cuts average 0.0 elements, 0 column cuts (0 active) in 0.000 seconds - new frequency is -100
Cbc0014I Cut generator 5 (FlowCover) - 0 row cuts average 0.0 elements, 0 column cuts (0 active) in 0.000 seconds - new frequency is -100
Cbc0014I Cut generator 7 (ZeroHalf) - 0 row cuts average 0.0 elements, 0 column cuts (0 active) in 0.000 seconds - new frequency is -100
Cbc0001I Search completed - best objective 8425.088888888889, took 0 iterations and 0 nodes (0.49 seconds)
Cbc0035I Maximum depth 0, 3 variables fixed on reduced cost
Cuts at root node changed objective from 6725.35 to 8155.42
Probing was tried 1 times and created 140 cuts of which 0 were active after adding rounds of cuts (0.003 seconds)
Gomory was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
Knapsack was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
Clique was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
MixedIntegerRounding2 was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
FlowCover was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
TwoMirCuts was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
ZeroHalf was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
57 bounds tightened after postprocessing
Result - Optimal solution found
Objective value: 8425.08888889
Enumerated nodes: 0
Total iterations: 0
Time (CPU seconds): 0.56
Time (Wallclock seconds): 0.56
Total time (CPU seconds): 0.56 (Wallclock seconds): 0.56
Process finished with exit code 0
@nick-gorman just tested the same code using the python3 distribution in Windows Subsystem for Linux; and it's totally fine. Looks like a problem in the windows interface dll.
I have the same problem. The process finishes with no return, and the Exit code is -1073741819 . I used pycharm to trace the last call, and the last line I was able to achieve was
Filename :: cbc.py Line Number :: 1221 Code :: cbclib.Cbc_solve(self._model)
which I think is the solver itself. I'm running on Win10 using pycharm.
If I pass on the argument relax=True
, then the solver call is able to return, but the solution is no longer Binary (which is expected, I guess). In this case, the solver returns the value OptimizationStatus.OPTIMAL
.
Otherwise, I get no return and I can't see what is going on "under the hood"
Hi @h-g-s and @tuliotoffolo,
Is there any chance you could take a look at this issue. I can work around it by using linux, but I'd really like the package I'm developing, which depends on mip, to be properly cross platform.
Let me know If can help.
Cheers, Nick
Sorry, just realised that this is probably the same issue as https://github.com/coin-or/Cbc/issues/325
The lp-file from related issue works well with latest release 1.14.0. At the moment this will be considered as not reproducible
Hi Folks,
Has anyone come across this error before, the last line printed out (i.e. not a stack trace) is
Process finished with exit code -1073741819 (0xC0000005)
The last few lines of print out are below. Any thoughts on whats going on would be appreciated, apologies for not having a minimum workable example, can't seem to create one yet.
Cbc0038I Pass 78: suminf. 0.13329 (50) obj. -1.31505e+07 iterations 17 Cbc0038I Pass 79: suminf. 13.12313 (67) obj. -1.31505e+07 iterations 130 Cbc0038I Pass 80: suminf. 2.27872 (14) obj. -1.31505e+07 iterations 77 Cbc0038I Pass 81: suminf. 2.07194 (53) obj. -1.31505e+07 iterations 44 Cbc0038I Pass 82: suminf. 4.74232 (33) obj. -1.31505e+07 iterations 57 Cbc0038I Pass 83: suminf. 8.89919 (22) obj. -1.31505e+07 iterations 63 Cbc0038I Pass 84: suminf. 6.20734 (57) obj. -1.31505e+07 iterations 52 Cbc0038I No solution found this major pass Cbc0038I Before mini branch and bound, 4 integers at bound fixed and 1518 continuous Cbc0038I Full problem 1541 rows 2534 columns, reduced to 1025 rows 1011 columns - 40 fixed gives 919, 918 - still too large Cbc0038I Full problem 1541 rows 2534 columns, reduced to 797 rows 810 columns - too large Cbc0038I Mini branch and bound did not improve solution (1.27 seconds) Cbc0038I After 1.27 seconds - Feasibility pump exiting with objective of -1.31235e+07 - took 0.91 seconds Cbc0012I Integer solution of -13123518 found by feasibility pump after 0 iterations and 0 nodes (1.29 seconds) Cbc0012I Integer solution of -13179616 found by DiveCoefficient after 0 iterations and 0 nodes (1.53 seconds) Cbc0012I Integer solution of -13183290 found by DiveCoefficient after 571 iterations and 0 nodes (2.42 seconds) Cbc0031I 77 added rows had average density of 151.66234 Cbc0013I At root node, 77 cuts changed objective from -13213517 to -13213517 in 6 passes Cbc0014I Cut generator 0 (Probing) - 2 row cuts average 51.0 elements, 7 column cuts (7 active) in 0.025 seconds - new frequency is -100 Cbc0014I Cut generator 1 (Gomory) - 401 row cuts average 109.2 elements, 0 column cuts (0 active) in 0.087 seconds - new frequency is -100 Cbc0014I Cut generator 2 (Knapsack) - 0 row cuts average 0.0 elements, 0 column cuts (0 active) in 0.015 seconds - new frequency is -100 Cbc0014I Cut generator 3 (BKClique) - 0 row cuts average 0.0 elements, 0 column cuts (0 active) in 0.001 seconds - new frequency is -100 Cbc0014I Cut generator 4 (OddHoleWC) - 0 row cuts average 0.0 elements, 0 column cuts (0 active) in 0.000 seconds - new frequency is -100 Cbc0014I Cut generator 5 (MixedIntegerRounding2) - 26 row cuts average 61.9 elements, 0 column cuts (0 active) in 0.168 seconds - new frequency is -100 Cbc0014I Cut generator 6 (FlowCover) - 1 row cuts average 33.0 elements, 0 column cuts (0 active) in 0.023 seconds - new frequency is -100 Cbc0014I Cut generator 7 (TwoMirCuts) - 465 row cuts average 104.5 elements, 0 column cuts (0 active) in 0.157 seconds - new frequency is -100 Cbc0010I After 0 nodes, 1 on tree, -13183290 best solution, best possible -13213516 (2.69 seconds) Cbc0012I Integer solution of -13186937 found by DiveCoefficient after 978 iterations and 5 nodes (2.93 seconds) Cbc0012I Integer solution of -13187594 found by DiveCoefficient after 1009 iterations and 6 nodes (3.11 seconds) Cbc0012I Integer solution of -13190791 found by DiveCoefficient after 1055 iterations and 7 nodes (3.17 seconds) Cbc0012I Integer solution of -1 Process finished with exit code -1073741819 (0xC0000005)