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

LazyConstraint based MIP yields incorrect optimum #331

Open
ciderale opened this issue Jan 9, 2023 · 6 comments
Open

LazyConstraint based MIP yields incorrect optimum #331

ciderale opened this issue Jan 9, 2023 · 6 comments
Labels
bug Something isn't working cbc All items related to cbc

Comments

@ciderale
Copy link

ciderale commented Jan 9, 2023

Describe the bug
Solving a MIP with lazy constraints yields a sub optimal solution. Yet, the solver reports the solution to be optimal.

My assumption is that adding all constraints (a) up-front, (b) as lazy constraints, or (c) using a lazy constraint generator should not affect the optimal of the solution. Is this assumption incorrect?

To Reproduce
A minimal example with 1 continuous variable (the objective), 4 integer variables, and 2 constraint is provided.
The problem is solved three times: (a) complete model, (b) lazy constraints, (c) using lazy constraint generator.

Solving the complete model yields the true optimal solution. Both lazy variants provide a sub-optimal solution.
Variant (c) shows that both constraints are generated and added to the model in the first call to the lazy constraint generator.

Expected behavior
Using (generated) lazy constraints should yield the same optimum as solving the complete model with all constraint provided up front.

Desktop (please complete the following information):

  • Operating System, version: macOS Monterey 12.4 (M1)
  • Python version: 3.9.6
  • Python-MIP version (we recommend you to test with the latest version): 1.14.2
  • CBC built from coin-or/cbc/0713c30b8e5e2b2a8e1b804ee9d98087fc524530 (23.Nov 2022)

Example Program and Execution Log:
lazy-minimal-example.py.txt
lazy-minimal-example.log

@sebheger
Copy link
Collaborator

Most likely to be duplicate to #36

@sebheger
Copy link
Collaborator

@ciderale Thanks for reporting the issue. It is at the moment unlikely, that this bug will be fixed on cbc side soon.

@sebheger sebheger added cbc All items related to cbc bug Something isn't working labels Jan 10, 2023
@ciderale
Copy link
Author

@sebheger Thank you for your quick response. Do you have an idea what the root cause could be?

Since #36 is already closed, do you think it is a duplicate of the example mentioned towards the last comments (after the issue was closed)? A comment in #274 mentions that some lazy constraint seem to be ignored, but a minimalistic examples was missing. That sounds related to this problem and I hoped that the above example is minimal enough to help finding the problem. Is there something more I could do?

@sebheger
Copy link
Collaborator

@ciderale Many thanks for the minimalistic example. I guess that will help also for future development/testing

@aBBDnGus
Copy link

Any updates on this bug?

@tkralphs
Copy link
Member

It is at the moment unlikely, that this bug will be fixed on cbc side soon.

#36 was addressed on the Cbc side because @h-g-s, who is a Cbc developer, got involved. If there are still issues, this needs to get reported to Cbc or it certainly won't be addressed. The Cbc developers are not generally monitoring python-mip for bug reports (although I try my best). If the python-mip team could refer these kind of issues to Cbc, that would be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cbc All items related to cbc
Projects
None yet
Development

No branches or pull requests

4 participants