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

Allow CyIpopt to solve problems without objectives #3163

Merged
merged 2 commits into from
Feb 27, 2024

Conversation

Robbybp
Copy link
Contributor

@Robbybp Robbybp commented Feb 25, 2024

Fixes

CyIpopt can't solve problems without objectives because it fails to create the PyomoNLP that it needs to construct the CyIpoptProblemInterface

Summary/Motivation:

Use CyIpopt as a solver for square problems in various contexts.

Changes proposed in this PR:

  • In PyomoCyIpoptSolver.solve, check the model for active objectives. If none, add a dummy objective with value zero that is removed after the NLP object is created.

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@Robbybp
Copy link
Contributor Author

Robbybp commented Feb 26, 2024

Test failure appears unrelated:

FAILED pyomo/solvers/tests/mip/test_scip_log_data.py::test_scip_some_more - AssertionError: assert 'Gap' in {'Status': 'ok', 'Message': 'time limit reached', 'Termination condition': 'maxTimeLimit', 'Id': 403, 'Error rc': 0, 'Time': 0.025727272033691406}

@blnicho blnicho merged commit 26e4970 into Pyomo:main Feb 27, 2024
33 checks passed
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.

5 participants