Code Monkey home page Code Monkey logo

Comments (6)

liam-veitch avatar liam-veitch commented on May 30, 2024

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

from python-mip.

liam-veitch avatar liam-veitch commented on May 30, 2024

@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.

from python-mip.

JanMichelFarias avatar JanMichelFarias commented on May 30, 2024

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"

from python-mip.

nick-gorman avatar nick-gorman commented on May 30, 2024

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

from python-mip.

nick-gorman avatar nick-gorman commented on May 30, 2024

Sorry, just realised that this is probably the same issue as coin-or/Cbc#325

from python-mip.

sebheger avatar sebheger commented on May 30, 2024

The lp-file from related issue works well with latest release 1.14.0.
At the moment this will be considered as not reproducible

from python-mip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.