Skip to content

Feat/956 compute iis highs - #957

Merged
FabianHofmann merged 11 commits into
masterfrom
feat/956-compute-IIS-highs
Sep 22, 2026
Merged

FabianHofmann merged 11 commits into
masterfrom
feat/956-compute-IIS-highs

Conversation

@lisazeyen

@lisazeyen lisazeyen commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Closes #956 (if applicable).

Changes proposed in this Pull Request

Adds HiGHS support to Model.compute_infeasibilities(), which previously only worked with
Gurobi and Xpress. HiGHS's IIS (irreducible infeasible subsystem) computation
is documented at
HiGHS: Advanced features — IIS
and exposed in highspy via Highs.getIis().

Extended testing in test/test_infeasibility.py and test/test_optimization.py::test_infeasible_model for Highs

Checklist

  • AI-generated content is marked (see AGENTS.md).
  • Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in doc.
  • Unit tests for new features were added (if applicable).
  • A note for the release notes doc/release_notes.rst of the upcoming release is included.
  • I consent to the release of this PR's code under the MIT license.

@github-actions

github-actions Bot commented Sep 15, 2026

Copy link
Copy Markdown

Build cost — v1 vs legacy

v1 build peak & time relative to legacy, on this commit — not a comparison against master (that is CodSpeed).

peak — v1 / legacy time — v1 / legacy
peak v1/legacy time v1/legacy
Full table (time + peak, mean)
benchmarks/drivers/test_build.py::test_build[basic-n=10]
                  time (s)         peak (KiB) 
 name                 mean   │           mean 
──────────────────────────────────────────────
 (legacy)   0.04919 (1.12)   │   15.03 (1.00) 
 (v1)         0.0441 (1.0)   │    15.00 (1.0) 

benchmarks/drivers/test_build.py::test_build[basic-n=250]
                 time (s)         peak (MiB) 
 name                mean   │           mean 
─────────────────────────────────────────────
 (legacy)   0.0537 (1.12)   │   12.04 (1.00) 
 (v1)       0.04785 (1.0)   │    12.04 (1.0) 

benchmarks/drivers/test_build.py::test_build[cumsum-severity=0]
                  time (s)        peak (KiB) 
 name                 mean   │          mean 
─────────────────────────────────────────────
 (legacy)   0.02052 (1.13)   │   15.20 (1.0) 
 (v1)        0.01817 (1.0)   │   15.20 (1.0) 

benchmarks/drivers/test_build.py::test_build[cumsum-severity=100]
                  time (s)        peak (MiB) 
 name                 mean   │          mean 
─────────────────────────────────────────────
 (legacy)   0.03391 (1.18)   │   44.93 (1.0) 
 (v1)        0.02878 (1.0)   │   44.93 (1.0) 

benchmarks/drivers/test_build.py::test_build[cumsum-severity=50]
                  time (s)        peak (MiB) 
 name                 mean   │          mean 
─────────────────────────────────────────────
 (legacy)   0.02337 (1.06)   │   11.51 (1.0) 
 (v1)        0.02207 (1.0)   │   11.51 (1.0) 

benchmarks/drivers/test_build.py::test_build[expression_arithmetic-n=10]
                  time (s)         peak (KiB) 
 name                 mean   │           mean 
──────────────────────────────────────────────
 (legacy)   0.05472 (1.11)   │   24.34 (1.06) 
 (v1)        0.04934 (1.0)   │    23.04 (1.0) 

benchmarks/drivers/test_build.py::test_build[expression_arithmetic-n=250]
                  time (s)         peak (MiB) 
 name                 mean   │           mean 
──────────────────────────────────────────────
 (legacy)   0.06038 (1.10)   │   16.12 (1.00) 
 (v1)        0.05472 (1.0)   │    16.12 (1.0) 

benchmarks/drivers/test_build.py::test_build[knapsack-n=10000]
                 time (s)          peak (KiB) 
 name                mean   │            mean 
──────────────────────────────────────────────
 (legacy)    0.013 (1.14)   │   752.18 (1.10) 
 (v1)       0.01137 (1.0)   │    685.15 (1.0) 

benchmarks/drivers/test_build.py::test_build[knapsack-n=100]
                  time (s)        peak (KiB) 
 name                 mean   │          mean 
─────────────────────────────────────────────
 (legacy)   0.01242 (1.09)   │   3.12 (1.33) 
 (v1)        0.01139 (1.0)   │    2.34 (1.0) 

benchmarks/drivers/test_build.py::test_build[kvl_cycles-severity=0]
                 time (s)          peak (MiB) 
 name                mean   │            mean 
──────────────────────────────────────────────
 (legacy)   0.0423 (1.37)   │   126.16 (1.44) 
 (v1)       0.03089 (1.0)   │     87.71 (1.0) 

benchmarks/drivers/test_build.py::test_build[kvl_cycles-severity=100]
                  time (s)          peak (MiB) 
 name                 mean   │            mean 
───────────────────────────────────────────────
 (legacy)   0.03979 (1.33)   │   126.16 (1.44) 
 (v1)        0.02996 (1.0)   │     87.71 (1.0) 

benchmarks/drivers/test_build.py::test_build[kvl_cycles-severity=50]
                  time (s)          peak (MiB) 
 name                 mean   │            mean 
───────────────────────────────────────────────
 (legacy)   0.03983 (1.30)   │   126.16 (1.44) 
 (v1)        0.03057 (1.0)   │     87.71 (1.0) 

benchmarks/drivers/test_build.py::test_build[masked-n=100]
                  time (s)          peak (KiB) 
 name                 mean   │            mean 
───────────────────────────────────────────────
 (legacy)   0.02893 (1.01)   │    715.12 (1.0) 
 (v1)        0.02878 (1.0)   │   787.73 (1.10) 

benchmarks/drivers/test_build.py::test_build[masked-n=10]
                  time (s)        peak (KiB) 
 name                 mean   │          mean 
─────────────────────────────────────────────
 (legacy)   0.02862 (1.14)   │   4.54 (1.27) 
 (v1)        0.02501 (1.0)   │    3.57 (1.0) 

benchmarks/drivers/test_build.py::test_build[merge_balance-severity=0]
                 time (s)          peak (KiB) 
 name                mean   │            mean 
──────────────────────────────────────────────
 (legacy)   0.1976 (1.06)   │   704.12 (1.09) 
 (v1)         0.186 (1.0)   │    643.85 (1.0) 

benchmarks/drivers/test_build.py::test_build[merge_balance-severity=100]
                 time (s)        peak (MiB) 
 name                mean   │          mean 
────────────────────────────────────────────
 (legacy)   0.2052 (1.04)   │   18.34 (1.0) 
 (v1)        0.1978 (1.0)   │   18.34 (1.0) 

benchmarks/drivers/test_build.py::test_build[merge_balance-severity=50]
                 time (s)       peak (MiB) 
 name                mean   │         mean 
───────────────────────────────────────────
 (legacy)   0.2045 (1.06)   │   9.54 (1.0) 
 (v1)        0.1933 (1.0)   │   9.54 (1.0) 

benchmarks/drivers/test_build.py::test_build[milp-n=10]
                 time (s)        peak (KiB) 
 name                mean   │          mean 
────────────────────────────────────────────
 (legacy)   0.0402 (1.12)   │   3.77 (1.12) 
 (v1)       0.03596 (1.0)   │    3.37 (1.0) 

benchmarks/drivers/test_build.py::test_build[milp-n=50]
                  time (s)          peak (KiB) 
 name                 mean   │            mean 
───────────────────────────────────────────────
 (legacy)   0.04067 (1.14)   │   216.59 (1.10) 
 (v1)        0.03558 (1.0)   │    196.23 (1.0) 

benchmarks/drivers/test_build.py::test_build[nodal_balance-severity=0]
                  time (s)         peak (KiB) 
 name                 mean   │           mean 
──────────────────────────────────────────────
 (legacy)   0.02069 (1.12)   │   938.49 (1.0) 
 (v1)        0.01849 (1.0)   │   938.49 (1.0) 

benchmarks/drivers/test_build.py::test_build[nodal_balance-severity=100]
                  time (s)       peak (MiB) 
 name                 mean   │         mean 
────────────────────────────────────────────
 (legacy)   0.02172 (1.15)   │   9.66 (1.0) 
 (v1)         0.0188 (1.0)   │   9.66 (1.0) 

benchmarks/drivers/test_build.py::test_build[nodal_balance-severity=50]
                 time (s)       peak (MiB) 
 name                mean   │         mean 
───────────────────────────────────────────
 (legacy)   0.0208 (1.12)   │   5.32 (1.0) 
 (v1)       0.01856 (1.0)   │   5.32 (1.0) 

benchmarks/drivers/test_build.py::test_build[nodal_balance_sparse-severity=0]
                  time (s)       peak (MiB) 
 name                 mean   │         mean 
────────────────────────────────────────────
 (legacy)    0.01218 (1.0)   │   1.47 (1.0) 
 (v1)       0.01248 (1.02)   │   1.47 (1.0) 

benchmarks/drivers/test_build.py::test_build[nodal_balance_sparse-severity=100]
                  time (s)       peak (MiB) 
 name                 mean   │         mean 
────────────────────────────────────────────
 (legacy)   0.01203 (1.10)   │   1.47 (1.0) 
 (v1)        0.01092 (1.0)   │   1.47 (1.0) 

benchmarks/drivers/test_build.py::test_build[nodal_balance_sparse-severity=50]
                  time (s)       peak (MiB) 
 name                 mean   │         mean 
────────────────────────────────────────────
 (legacy)   0.01188 (1.06)   │   1.47 (1.0) 
 (v1)        0.01118 (1.0)   │   1.47 (1.0) 

benchmarks/drivers/test_build.py::test_build[piecewise-n=1000]
                 time (s)          peak (KiB) 
 name                mean   │            mean 
──────────────────────────────────────────────
 (legacy)   0.1005 (1.06)   │   946.85 (1.06) 
 (v1)       0.09457 (1.0)   │    891.54 (1.0) 

benchmarks/drivers/test_build.py::test_build[piecewise-n=10]
                  time (s)         peak (KiB) 
 name                 mean   │           mean 
──────────────────────────────────────────────
 (legacy)   0.09745 (1.04)   │   12.01 (1.00) 
 (v1)        0.09379 (1.0)   │    11.99 (1.0) 

benchmarks/drivers/test_build.py::test_build[qp-n=1000]
                  time (s)          peak (KiB) 
 name                 mean   │            mean 
───────────────────────────────────────────────
 (legacy)   0.02579 (1.07)   │   147.70 (1.06) 
 (v1)        0.02409 (1.0)   │    139.87 (1.0) 

benchmarks/drivers/test_build.py::test_build[qp-n=10]
                  time (s)        peak (KiB) 
 name                 mean   │          mean 
─────────────────────────────────────────────
 (legacy)   0.02644 (1.14)   │   2.60 (1.09) 
 (v1)        0.02314 (1.0)   │    2.38 (1.0) 

benchmarks/drivers/test_build.py::test_build[rolling-severity=0]
                 time (s)          peak (KiB) 
 name                mean   │            mean 
──────────────────────────────────────────────
 (legacy)   0.0221 (1.20)   │   696.75 (1.03) 
 (v1)       0.01848 (1.0)   │    673.70 (1.0) 

benchmarks/drivers/test_build.py::test_build[rolling-severity=100]
                  time (s)         peak (MiB) 
 name                 mean   │           mean 
──────────────────────────────────────────────
 (legacy)   0.05699 (1.08)   │   137.97 (1.0) 
 (v1)        0.05258 (1.0)   │   137.97 (1.0) 

benchmarks/drivers/test_build.py::test_build[rolling-severity=50]
                  time (s)        peak (MiB) 
 name                 mean   │          mean 
─────────────────────────────────────────────
 (legacy)   0.03612 (1.00)   │   69.22 (1.0) 
 (v1)        0.03604 (1.0)   │   69.22 (1.0) 

benchmarks/drivers/test_build.py::test_build[sos-n=1000]
                  time (s)          peak (KiB) 
 name                 mean   │            mean 
───────────────────────────────────────────────
 (legacy)   0.02385 (1.13)   │   402.33 (1.00) 
 (v1)        0.02109 (1.0)   │    402.30 (1.0) 

benchmarks/drivers/test_build.py::test_build[sos-n=10]
                  time (s)        peak (KiB) 
 name                 mean   │          mean 
─────────────────────────────────────────────
 (legacy)   0.02401 (1.10)   │   3.19 (1.19) 
 (v1)         0.0218 (1.0)   │    2.69 (1.0) 

benchmarks/drivers/test_build.py::test_build[sparse_network-n=10]
                  time (s)         peak (KiB) 
 name                 mean   │           mean 
──────────────────────────────────────────────
 (legacy)   0.02625 (1.09)   │   29.00 (1.54) 
 (v1)        0.02413 (1.0)   │    18.84 (1.0) 

benchmarks/drivers/test_build.py::test_build[sparse_network-n=250]
                  time (s)         peak (MiB) 
 name                 mean   │           mean 
──────────────────────────────────────────────
 (legacy)   0.03417 (1.13)   │   37.95 (1.43) 
 (v1)        0.03029 (1.0)   │    26.51 (1.0) 

benchmarks/drivers/test_build.py::test_build[storage-n=10]
                  time (s)          peak (KiB) 
 name                 mean   │            mean 
───────────────────────────────────────────────
 (legacy)    0.05045 (1.0)   │    410.93 (1.0) 
 (v1)       0.05092 (1.01)   │   427.84 (1.04) 

benchmarks/drivers/test_build.py::test_build[storage-n=250]
                 time (s)         peak (MiB) 
 name                mean   │           mean 
─────────────────────────────────────────────
 (legacy)     0.06 (1.09)   │     9.94 (1.0) 
 (v1)       0.05516 (1.0)   │   10.22 (1.03) 

📊 Interactive plots + CSV: download the semantics-report-v1-vs-legacy artifact from this run.

Report-only · not a gate · refreshed on every push · obsolete once legacy is dropped.

@codspeed

codspeed Bot commented Sep 15, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 5.3%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
❌ 4 regressed benchmarks
✅ 176 untouched benchmarks
⏩ 181 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
test_to_lp[qp-n=1000] 1.9 MB 2.6 MB -24.84%
test_to_lp[nodal_balance_sparse-severity=50] 2.8 MB 3.7 MB -24.12%
test_to_lp[merge_balance-severity=0] 2.7 MB 3.3 MB -18.24%
test_to_lp[nodal_balance-severity=50] 3.3 MB 3.7 MB -10.5%
test_to_lp[sparse_network-n=10] 1,338.9 KB 733.8 KB +82.47%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing feat/956-compute-IIS-highs (957cdd3) with master (718c0c1)2

Open in CodSpeed

Footnotes

  1. 181 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on master (20648f5) during the generation of this report, so 718c0c1 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Drop the hasattr getIis guard in favor of fail-fast, move the highspy
import to the top of the method, flatten the iis_strategy bitmask into
named locals, and reuse the module-level solvers helper.
The available_solvers check already guarantees highspy is importable.
Their available_solvers membership already guarantees importability,
matching the highs branch.

@FabianHofmann FabianHofmann left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

thanks @lisazeyen ; I added some refactoring to align the code and pulled up the release notes

@FabianHofmann
FabianHofmann merged commit 0770dfe into master Sep 22, 2026
21 of 23 checks passed
@FabianHofmann
FabianHofmann deleted the feat/956-compute-IIS-highs branch September 22, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request solver interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compute IIS with highs

2 participants