Skip to content

Added support for Highs solver in contrib.Benders#3686

Merged
blnicho merged 1 commit intoPyomo:mainfrom
viens-code:solvers_for_benders
Aug 8, 2025
Merged

Added support for Highs solver in contrib.Benders#3686
blnicho merged 1 commit intoPyomo:mainfrom
viens-code:solvers_for_benders

Conversation

@viens-code
Copy link
Copy Markdown
Contributor

@viens-code viens-code commented Aug 7, 2025

Fixes #3684

Summary/Motivation:

Add the ability to use the Highs solver in contrib.Benders.

Changes proposed in this PR:

  • Adds Highs to the supported solvers list for the Benders contrib solver

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.

Highs follows the general dual sign convention as the rest of the solvers.
Applied the same tests as the rest of the LP solvers and it passes
@blnicho blnicho changed the title Added support for High solver in contrib.Benders Added support for Highs solver in contrib.Benders Aug 7, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Aug 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.20%. Comparing base (de14e28) to head (a2d0b5a).
⚠️ Report is 972 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3686   +/-   ##
=======================================
  Coverage   89.20%   89.20%           
=======================================
  Files         892      892           
  Lines      102978   102979    +1     
=======================================
+ Hits        91857    91860    +3     
+ Misses      11121    11119    -2     
Flag Coverage Δ
builders 26.74% <100.00%> (+<0.01%) ⬆️
default 85.80% <100.00%> (?)
expensive 34.08% <100.00%> (?)
linux 86.97% <100.00%> (-1.99%) ⬇️
linux_other 86.97% <100.00%> (+<0.01%) ⬆️
osx 83.27% <100.00%> (+<0.01%) ⬆️
win 85.16% <100.00%> (+<0.01%) ⬆️
win_other 85.16% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
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.

I don't have a problem with this PR; however, I should note that this doesn't actually test that HiGHS works as a solver. I am comfortable deferring that to a more comprehensive overhaul of this package in a future PR.

Comment on lines +20 to 31
for mip_name in (
'cplex_direct',
'gurobi_direct',
'gurobi',
'cplex',
'glpk',
'cbc',
'highs',
):
mip_available = pyo.SolverFactory(mip_name).available(exception_flag=False)
if mip_available:
break
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This isn't actually running tests against each of these solvers. It just picks the first available solver. Is that the intended behavior?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That was not what I intended no.
Due to the MPI linkage and the original tests being designed (in my understanding) for the MPI-SPPY use, I want to keep the tweaks to the tests and code as minimal as possible.
I did test it as just running highs locally.
Planning a larger PR that will overhaul this package and will add more tests then.

@blnicho blnicho merged commit a780912 into Pyomo:main Aug 8, 2025
35 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.

Adding New Solvers to contrib.Benders

4 participants