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

Adding function to detect whether problem is infeasible or an optimal… #150

Merged
merged 4 commits into from
Mar 19, 2022

Conversation

tkralphs
Copy link
Member

… solution is found

@mkoeppe
Copy link
Contributor

mkoeppe commented Mar 14, 2022

While at it, perhaps it would be a good idea to fix the typo "isRelaxationAbondoned" and document what this problem status means?

mkoeppe added a commit to mkoeppe/cvxpy that referenced this pull request Mar 14, 2022
@mkoeppe
Copy link
Contributor

mkoeppe commented Mar 14, 2022

Thanks, Ted, together with cvxpy/cvxpy#1707, this fixes the testcase added in cvxpy/cvxpy#1705

sageb0t pushed a commit to sagemath/sagetrac-mirror that referenced this pull request Mar 14, 2022
rileyjmurray pushed a commit to cvxpy/cvxpy that referenced this pull request Mar 15, 2022
@tkralphs
Copy link
Member Author

@mkoeppe Apparently, I can't add you as a reviewer unless you are a member of the COIN-OR organization. Do you want to be added? Is this ready to go?

@mkoeppe
Copy link
Contributor

mkoeppe commented Mar 15, 2022

This fixes the reported problem, but I am not sure if the fix is complete. It seems that the result 'solution' can now be produced in two ways: (1) On self.CppSelf.isProvenOptimal(), (2) From self.CppSelf.secondaryStatus().

Also the misspelling "abondoned" is still used in the result - or this part of the stable API?

@tkralphs
Copy link
Member Author

OK, fixed that remaining typo and clarified what the status actually means. The way the statuses work in Cbc is a bit weird and the documentation in the header file is actually a bit misleading. What status zero actually means is that the search completed. But the result could still either be that a solution was found and proven optimal or that the problem was proven infeasible. That's why you have to then separately check which is those two actually occurred with the isProven* functions. So I think we should be good now.

@mkoeppe
Copy link
Contributor

mkoeppe commented Mar 15, 2022

OK, am I understanding correctly that "search completed" is never actually returned by CyCbcModel.status?

@mkoeppe
Copy link
Contributor

mkoeppe commented Mar 15, 2022

Also not sure if you had a chance to look at cvxpy/cvxpy@d390389 - am I mapping this correctly?

@tkralphs
Copy link
Member Author

tkralphs commented Mar 15, 2022

OK, am I understanding correctly that "search completed" is never actually returned by CyCbcModel.status?

Yes, that is true because it is a kind of useless status that encompasses both the feasible and infeasible cases. The reason it is listed there is because it is a status that exists internal to Cbc itself, but whenever we have that status, then it is guaranteed that either isProvenInfeasible() or isProvenOptimal() will be true and we need to use those functions to distinguish those two cases. So in the end, that status cannot actually be returned by CyCbcModel.status, but we have it to preserve the maping to Cbc's internal list of statuses. It's a bit messy. Perhaps this is something to be cleaned up in the refactoring of Cbc, if that ever gets finished.

@mkoeppe
Copy link
Contributor

mkoeppe commented Mar 16, 2022

Another bug in the file:

problemStatus =  ['search completed', 'relaxation infeasible',
         'stopped on gap', 'stopped on nodes', 'stopped on time',
         'stopped on user event', 'stopped on solutions'
         'linear relaxation unbounded', 'unset']

misses a comma after 'stopped on solutions'

mkoeppe added a commit to mkoeppe/cvxpy that referenced this pull request Mar 16, 2022
@tkralphs
Copy link
Member Author

Good catch!

@mkoeppe
Copy link
Contributor

mkoeppe commented Mar 16, 2022

This works well now.

sageb0t pushed a commit to sagemath/sagetrac-mirror that referenced this pull request Mar 16, 2022
@rsemenoff
Copy link

rsemenoff commented Mar 16, 2022 via email

@rsemenoff
Copy link

rsemenoff commented Mar 16, 2022 via email

@rsemenoff
Copy link

rsemenoff commented Mar 16, 2022 via email

rileyjmurray pushed a commit to cvxpy/cvxpy that referenced this pull request Mar 17, 2022
* cvxpy/tests/solver_test_helpers.py: add a new standard test MILP: ``mi_lp_5``.

* cvxpy/tests/test_conic_solvers.py: have each MILP solver run a test against ``mi_lp_5``.

* cvxpy/tests/test_conic_solvers.py: skip ``test_cbc_mi_lp_5`` with broken CyLP (see coin-or/CyLP#150).
@tkralphs
Copy link
Member Author

tkralphs commented Mar 18, 2022

You should probably make it clear in the docs that this is only intended for python primitives. Although, what is the point of using python aside for the existence of major codebases like Pandas, Numpy, Scipy ... etc etc etc.

@rsemenoff I really don't know what this means, but PRs are welcome. I am not the author of this package and I just try to maintain it as a side project because it seems to get a lot of use in the community. I have limited bandwidth and it would be great if the people who find it useful could pitch in. Updates to documentation are one easy way to contribute.

@tkralphs
Copy link
Member Author

tkralphs commented Mar 18, 2022

I wish that the true status of this project (and the underlying Cbc) were more truthfully reported. I don't want to abuse volunteers, and I chose coin-or understanding that it was a funded project.

@rsemenoff Where did you get the idea that COIN-OR is a funded project? COIN-OR has never had any substantial funding and that is certainly not hidden. I'm pleading for help with this project and Cbc every chance I get. Please read this and this and here, where it is stated "This has been moving slowly due to a lack of developer bandwidth," as well as numerous comments in issues and PRs. Cbc and CyLP are both currently being maintained by just a few volunteer maintainers. If you are happy with CPLEX, that's great and probably a better fit for you. And if you "don't want to abuse volunteers"... well, then just don't.

What other known bugs are being covered up?

Huh?

@rsemenoff
Copy link

rsemenoff commented Mar 18, 2022 via email

@rsemenoff
Copy link

rsemenoff commented Mar 18, 2022 via email

@rsemenoff
Copy link

rsemenoff commented Mar 18, 2022 via email

@mkoeppe
Copy link
Contributor

mkoeppe commented Mar 18, 2022

@rsemenoff
Copy link

rsemenoff commented Mar 18, 2022 via email

@tkralphs
Copy link
Member Author

@tkralphs Don't feed the troll. You may find https://docs.github.com/en/communities/maintaining-your-safety-on-github/blocking-a-user-from-your-organization helpful

Believe it or not, @rsemenoff has been an active and upstanding member of the CyLP community up until now. I have had a number of respectful and even productive conversations with them. For the time being, I'll give them the benefit of the doubt and hope they return to their senses after a good night's sleep. But thanks for pointing out that it's possible to ban people. That could come in handy.

@tkralphs
Copy link
Member Author

I guess I will merge this PR now.

@tkralphs tkralphs merged commit f0139d8 into master Mar 19, 2022
SteveDiamond added a commit to cvxpy/cvxpy that referenced this pull request Apr 24, 2022
…github.com:cvxpy/cvxpy

* 'master' of github.com:QiuWJX/cvxpy:
  changed the copyright and docstring
  create resources folder in codes
  undid changes
  standardized the code style created a folder called ./cvxpy/tests/resources/
  Add unit test for gurobi `model.write()`
  Add 'save_file' kwargs for GUROBI. - use Gurobi.write(save_file) to save the model file. - cplex and mosek have the similar functionality.
  cvxpy/tests: Add test for infeasible boolean problem (#1705)
  Handle new CyLP statuses from coin-or/CyLP#150 (#1707)

* 'master' of github.com:cvxpy/cvxpy:
  SCIP: add version requirement (< 4.0.0) and fix solve_via_data to eliminate certain error messages
  update error message for mixed-integer problems (#1738)
  remove out of date news
  fix TypeError in GLOP and PDLP interfaces (#1736)
  Propagate today's documentation improvements from release/1.2.x (#1733)
  Cylp update (#1727)
  Add 'save_file' kwargs for GUROBI. (#1720)
  pip install cvxpy[GLOP,XPRESS] (#1719)
  Fix #1714
  cvxpy/tests: Add test for infeasible boolean problem (#1705)
  Handle new CyLP statuses from coin-or/CyLP#150 (#1707)
rileyjmurray pushed a commit to cvxpy/cvxpy that referenced this pull request May 16, 2022
rileyjmurray pushed a commit to cvxpy/cvxpy that referenced this pull request May 16, 2022
sageb0t pushed a commit to sagemath/sagetrac-mirror that referenced this pull request Jul 30, 2022
sageb0t pushed a commit to sagemath/sagetrac-mirror that referenced this pull request Jul 30, 2022
sageb0t pushed a commit to sagemath/sagetrac-mirror that referenced this pull request Oct 2, 2022
sageb0t pushed a commit to sagemath/sagetrac-mirror that referenced this pull request Oct 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants