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

appsi_highs: allow solving quadratic problems #3431

Closed
wants to merge 3 commits into from

Conversation

maurerle
Copy link
Contributor

@maurerle maurerle commented Nov 19, 2024

Fixes #3381.

Summary/Motivation:

Before, the highs solver did not allow to solve quadratic equations, but highs does support solving such.
I did only run a few test cases which are solved by using this.
This was added 3 years ago with the appsi_highs solver, though a lot happened in highs in the meantime.

Changes proposed in this PR:

  • remove highs restriction to disable solving quadratic equations

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.

Tested with:

  • debian 13 trixie
  • highspy 1.7.2
  • pyomo derived from main

Copy link
Member

@jsiirola jsiirola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your interest in getting QP support added to the HiGHS interface, Unfortunately just removing the guard against nonlinear constraints and objectives doesn't actually pass the nonlinear terms on to HiGHS. For this PR to be accepted, it will need significant rework to (at a minimum):

  • add the logic for passing the quadratic terms from the compiled representation to the HiGHS solver
  • update tests to exercise the logic using QPs with known solutions (possibly sufficient to add HiGHS to the standard solver tests for solvers that support (QC)QPs

Given the significant amount of work that will need to be incorporated in this before the PR can be merged, I would suggest closing this PR and re-opening when it is (closer to) complete.

@maurerle
Copy link
Contributor Author

This is indeed much more complex. If someone hints me how I can improve my draft, I would be happy to do so, but fro now, I will close this :)

@maurerle maurerle closed this Nov 20, 2024
@jsiirola
Copy link
Member

I did a little digging, so maybe some of this will be helpful:

  • HiGHS only supports QPs, so you only want to turn on processing for quadratic terms when handling the objective (and not for constraints)
  • I believe the method you want to use to pass the quadratic coefficients in to HiGHS is passHessian
  • We don't have quite the same general testing framework for APPSI that exists for the legacy solvers. In particular, there is no category for "MIQP solvers" (only QCQP and MIQCQP). You might be able to tie into the legacy solver tests through APPSI's legacy interface, or extend the APPSI test framework to include tests for (MI)QPs. This is likely to be involved. You should also be aware of current work building a new standard for Pyomo solver interfaces (to replace both the legacy interface and APPSI). This effort will almost certainly overhaul the infrastructure for testing the solvers using a standard test suite. It might be worth waiting until that effort is farther along (hopefully tings will look close in a month or 2).
  • Hopefully @michaelbynum can weigh in on any general strategies you should consider when determining what needs to be cached to support efficient model updates, and how those caches should integrate into the rest of the APPSI infrastructure.

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.

Cannot solve quadratic problem with Highs solver
2 participants