Comments (7)
I have made changes - which I hope do not break anything. Lazy looks OK - Gen still does not work - will look at that - but it is slightly awkward debugging C++ called from python. In debug mode my Complete took 47 seconds for 100 model and Lazy 38.
from cbc.
Thanks again for the rapid response and changes.
This new version solves N=10 with lazy constraints quickly (0.85 CPU seconds). However for N=11 the lazy variant does not converge within a 30 seconds time limit (the complete model does in 0.1second) and was not able to find the optimal solution (it selects x_{N-2}=x_{N-1}=1, but x_N=0):
Complete Model N=11 | Lazy Model N=11 | |
---|---|---|
Result | Optimal solution found | stopped on time limit |
Objective value: | 0.190909090909 | 0.211111111111 |
Lower bound: | - | 0.166667 |
Gap: | - | 0.266667 |
Enumerated nodes: | 4 | 70383 |
Total iterations: | 692 | 202 |
Time (CPU seconds): | 0.106367 | 30.9555 |
Looking at the solvers output, I'm surprised by the reported gap of 0.26 -- shouldn't that be 0.045(=0.211-0.1667)?
Moreover, the constraint generation model now fails to find the optimal solution for N=8 and aborts after the 30s time limit with a sub optimal solution of 0.375 instead of 0.267.
from cbc.
I knew I might have made Gen model worse - was going to dig into that today.
The reported gap is correct - it is a fraction so (0.211-0.1667)/0.1667
from cbc.
Just ran lazy with 11 -
####### SOLVING ######### Mode.Lazy N= 11
OptimizationStatus.OPTIMAL
obj= 0.19090909090909092 solution: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0]
Result - Optimal solution found
Objective value: 0.190909090909
Enumerated nodes: 16
Total iterations: 102
Time (CPU seconds): 0.018546
from cbc.
Have made more changes. Works for me with 8,9,10,11,50 and 100
One point that might be of interest to people using Cbc master and python-mip is that to help me debug, I modified Cbc_C_Interface which is used by python-mip. Now if the environment variable COIN_CBC_OPTIONS is set
e.g.
export COIN_CBC_OPTIONS=/tmp/options_py.txt
the code reads standard cbc options which adds some items not directly accessible from the C interface. The format is one parameter per line - without the leading -. Lines starting * are comments. Any options that you can see by going into cbc and entering ? can be used.
from cbc.
Many thanks for these changes, cbc now solves up to N=100 with ease -- and the lazy constraint variant being extremely fast, actually the fastest of the 3 variants. I guess the reason that the generated constraint model is slower is due to the python interoperability overhead, isn't it? Or could there be something else?
One thing I noticed though is that the lazy variant reports a sub optimal solution as optimal. For example with N=105, it selects x_N=x_{N-2}=1 and x_{N-1}=0 with objective value of 0.0192325473879 instead of 0.0191391941392. Is that within some epsilon tolerance or is this an issue?
(Similarly for N=107 and N=109. Interestingly the odd numbers 106, 108 are not affected, neither are N>110 (have not tested extensively).
Again thanks a lot for your work to improve the lazy constraint generation feature. I hope debugging the solver when called from python was not too bothersome, or at least, that the minimalistic examples made up for that and helped to identify the root causes quickly.
from cbc.
The default cutoff increment is 0.0001 and 0.0191391 is not 0.0001 better than 0.019232, which is why you got that behaviour. I will get round to adding a setCutoffIncrement to the C interface - unless someone else wants to get involved with C interface. However you can fix the problem. So I have a file /tmp/options_py.txt which just has one line
increment 1.0e-6
and I export COIN_CBC_OPTIONS="/tmp/options_py.txt"
from cbc.
Related Issues (20)
- CBC and CPLEX mismatch in optimal results
- missing Result after TimeOut HOT 4
- Discrepancy in config.guess between Releases and Master Branch HOT 1
- "Conditional jump or move depends on uninitialised value" for model with SOS 2 and MIP start (master) HOT 2
- CBC fails when initial solution is passed with mipstart HOT 2
- Undefined reference to `node_count` when compiling HOT 5
- Feature Request -- Retrieving multiple optimal solutions
- Question - interpretation of a sol file
- Bug: got Infeasible on obviously feasible problem HOT 3
- Bug? Huge variance in solving time HOT 3
- Error installing Cbc solver in a docker image HOT 2
- osiUnitTest failure HOT 2
- Trying to end CBC Promt with ctrl-d leads to endless loop
- mipStart_ not copied in CbcModel copy constructor HOT 1
- Wrong result with current master build HOT 3
- Option '-threads 8' causes unpredictable hanging due to lock issue HOT 10
- How to use latest CBC solver in Python PULP on MacOS HOT 1
- cbc crash ( segmentation fault) when model was solved during presolve process and given lp is large HOT 2
- No static library in MacOS builds HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cbc.