-
Notifications
You must be signed in to change notification settings - Fork 69
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
Solver claims solution is optimal, but violates constraints #48
Comments
Thanks for the detailed report. Just to be sure that this is a problem with |
How can I have booleans in cylp? The documentation does not mention bool anywhere. I tried just constraining integers to 0<=x<=1. But the code takes forever to run. (I haven't written code directly for cylp before, so it's possibly wrong)
|
For the record, I found a way of implementing boolean ORs which doesn't involve summing booleans. Basically for C = A or B Here's the updated MWE. Although the issue that I raised this ticket for is still valid.
|
OK, I didn't catch before how you expected a Your original model should have been infeasible. Thus, there is a bug, but it's not clear to me whether it's a bug in |
If I use the default solver, then it returns How can I write this directly in cylp? How do I write bools into cylp? How does cvxpy convert it's booleans into cylp? |
I'm not sure what you mean by the "default solver," but I infeasible is the proper return. To create a |
When I say 'default solver', I mean using
instead of
With the former, it returns infeasible. With the latter, it returns a solution that violates constraints. |
@matt-telstra not sure if you ever sorted this out, I believe @tkralphs was pointing to the fact that there are two interfaces involved (and therefore potentially two sources of errors): between cvxpy and cylp, and between cylp and CBC. |
I am also encountering this issue. CBC is returning a solution it claims is optimal, but in reality violates a constraint. I have constraints which sum binary variables. |
tldr
I'm trying to add booleans together, hoping that the result is a boolean OR. I'm expecting a boolean OR, XOR, or an error, or
INFEASIBLE
. But what happens is that the solver violates other constraints to satisfy the addition.Minimum working example
Expected output
INFEASIBLE
.Observed output
Comments
My third constraint seems to be causing issues. I understand that summing booleans is a bit odd, I was just wondering/hoping that it would work.
The issue here is that when the solver encounters this odd third constraint, it violates the first two constraints and claims the solution is optimal.
When I run this, I do see some
FutureWarning
s. They sound like they are not of consequence, but could they be the cause of the problem?The output when I run this code is:
The text was updated successfully, but these errors were encountered: