Hermax: MaxSAT Optimization for Python
Hermax is a Python bridge to high-performance MaxSAT backends, with a unified IPAMIR-inspired interface for hard clauses, soft literals, assumptions, and iterative optimization workflows.
Why Hermax
- High-level modeling API (
hermax.model) with typed variables, vectors, matrices, intervals, and lazy arithmetic. - Unified API across heterogeneous MaxSAT engines.
- Incremental and non-incremental solver families
- Scientific and reproducible workflow
- Native compatibility with PySAT
Who Is This For?
Hermax is for combinatorially hard problems where:
- finding even a good base solution is already difficult
- the search state is mostly boolean
This is usually a better fit than MILP tooling when your problem is not mainly about floating-point structure, large integer arithmetic, or strong LP relaxations. In those cases, a MILP such as PuLP, SCIP, or Gurobi is often the more natural first choice.
If your problem is highly combinatorial but can benefit from a broader black-box CP approach, CP-SAT may also be a good alternative.
Hermax is especially relevant for:
- engineers building repeated optimization workflows around hard clauses, soft literals, assumptions, and iterative solve loops,
- users who already work with clauses, WCNF, or incremental solver-style APIs, and
- researchers comparing MaxSAT backends behind a common Python interface.
Installation
Core install:
pip install hermax
- User and API docs: https://hermax.readthedocs.io
Modeling Example
from hermax.model import Model
m = Model()
# Decision variables
x = m.int_vector("x", length=4, lb=0, ub=6) # integer domain [0, 6]
use_bonus = m.bool("use_bonus")
# Hard constraints
m &= x.all_different()
m &= (x[0] + x[1] <= x[2] + 2)
m &= (x[3] >= 2).only_if(use_bonus)
# Prefer x[0] == 1, and charge 3 for using the bonus.
m.obj += 5 * (x[0] != 1)
m.obj += 3 * use_bonus
r = m.solve() # auto-routes SAT/MaxSAT based on model content
print(r.status, r.cost)
Incremental MaxSAT Example
CoreTrail is Hermax’s native incremental core-guided MaxSAT solver.
from hermax.incremental import CoreTrail
solver = CoreTrail()
solver.add_clause([1, 2]) # hard
solver.set_soft(-1, 10) # soft weight
solver.set_soft(-1, 6) # update weight (last-wins)
ok = solver.solve(assumptions=[-2])
print("status:", solver.get_status().name)
if ok:
print("cost:", solver.get_cost())
print("model:", solver.get_model())
Citation
If you use Hermax in research, please cite:
@InProceedings{salviahornos_et_al:LIPIcs.SAT.2026.41,
author = {Salvia Hornos, Josep Maria and Fern\'{a}ndez Cam\'{o}n, C\`{e}sar and Mateu Pi\~{n}ol, Carles},
title = {{Hermax: A Unified MaxSAT Library}},
booktitle = {29th International Conference on Theory and Applications of Satisfiability Testing (SAT 2026)},
pages = {41:1--41:13},
series = {Leibniz International Proceedings in Informatics (LIPIcs)},
ISBN = {978-3-95977-431-4},
ISSN = {1868-8969},
year = {2026},
volume = {377},
editor = {Ignatiev, Alexey and Szeider, Stefan},
publisher = {Schloss Dagstuhl -- Leibniz-Zentrum f\"{u}r Informatik},
address = {Dagstuhl, Germany},
URL = {https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.SAT.2026.41},
URN = {urn:nbn:de:0030-drops-263478},
doi = {10.4230/LIPIcs.SAT.2026.41},
annote = {Keywords: MaxSAT, Incremental Solving, IPAMIR, Python, Constraint modelling}
}
If you use CoreTrail, please also cite its solver description:
@article{hornos2026coretrail,
title={CoreTrail and ShareTrail: Incremental Core-Guided MaxSAT Solvers},
author={Hornos, Josep Maria Salvia and Ignatiev, Alexey and Marques-Silva, Joao},
journal={MaxSAT Evaluation 2026: Solver and Benchmark Descriptions},
pages={17},
year={2026},
url={https://hdl.handle.net/10138/640150}
}
Please also cite the backend solver papers relevant to your experiments; see
the documentation acknowledgments,
CITATION.cff, and NOTICE for the relevant references.
License
This repository is licensed under Apache License 2.0. See LICENSE.
Third-party integrated solvers may have additional license terms.
Metadata
Release files for hermax 1.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 121.1 MB
Release files / hermax-1.3.2-cp315-cp315-win_amd64.whl
| Download URL | hermax-1.3.2-cp315-cp315-win_amd64.whl |
|---|---|
| Size | 10.9 MB |
| Tags | CPython 3.15 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
72f28a3fc4fb3805663a67200be4c72ad7b293004d473c468ce6c9ce1ab6b805
|
|
BLAKE2b-256 checksum How to use checksums |
32091af8ed6afb0ad0fde91eaeee2c205cd4117c0db9a4745db8ada90c636bd9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.3
|
Release files / hermax-1.3.2-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | hermax-1.3.2-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 9.4 MB |
| Tags | CPython 3.15 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
18239cabadc72248453140876fc05688c2b0739f210d4dc473d8ea1d0f6716c5
|
|
BLAKE2b-256 checksum How to use checksums |
9aa15952ff9ba750eae8201d6517b1f1069252e46d8ba9e4d7f43741444a5200
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.8
|
Release files / hermax-1.3.2-cp314-cp314-win_amd64.whl
| Download URL | hermax-1.3.2-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 10.9 MB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
592b690e494d8bf8f5d3394ec2c7acebcaafc4c6ddba68a676a7a799fd4344c7
|
|
BLAKE2b-256 checksum How to use checksums |
6cda1a91dd38af624f1e1d336cbd027b285fac4749af38b149227fd896524f47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.3
|
Release files / hermax-1.3.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | hermax-1.3.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 9.4 MB |
| Tags | CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
95efdd5f451409bf163c69f5e3ca7a3a45a2aa871f87a18b3cc8f2b644ba1c2d
|
|
BLAKE2b-256 checksum How to use checksums |
7009e843b7e5b976e988ca4d0404a28f1034185e330d569194864d9dd9d9a979
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.8
|
Release files / hermax-1.3.2-cp313-cp313-win_amd64.whl
| Download URL | hermax-1.3.2-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 10.8 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
0178680168f1167ec162c284d667a08052b575665073d2b566f67b181d3e2cec
|
|
BLAKE2b-256 checksum How to use checksums |
19049fd0768b4c8f29276b307a27b05caafa306297a2614190602cff82f59c8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.3
|
Release files / hermax-1.3.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | hermax-1.3.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 9.4 MB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
d39709463922ff49602b478c5f3e2f49bf8df4854eb44f83b2676f3783febcf6
|
|
BLAKE2b-256 checksum How to use checksums |
9dce731bde03275519be97ff736051eac84d6a59284adb5c47248c02f64b1798
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.8
|
Release files / hermax-1.3.2-cp312-cp312-win_amd64.whl
| Download URL | hermax-1.3.2-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 10.7 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f63850e879b2b841e0d07b288e3d7188a10ded4cce4685f8e8c861b1038bb90d
|
|
BLAKE2b-256 checksum How to use checksums |
cb4f0a95f75ad2492dcc5c4f5e2b44f2e2a78d67ff236f6edf45b2b17b571952
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.3
|
Release files / hermax-1.3.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | hermax-1.3.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 9.4 MB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
c00a3f94bc9692da1d6135e110f3b54695f34564b06fe5a2687129d6f0d59cd4
|
|
BLAKE2b-256 checksum How to use checksums |
0f8e86c5635a5cbbe9688cdfc6c7135459cca0b7963dc69ab723073583595ff2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.8
|
Release files / hermax-1.3.2-cp311-cp311-win_amd64.whl
| Download URL | hermax-1.3.2-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 10.7 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
2505844020ff53f514fb65cc9fe49efa026e9825f3b60d8c093f540c667883ed
|
|
BLAKE2b-256 checksum How to use checksums |
6615d0ec844291862e848eb0a3a1751e3c7c2eae89c15a690e3ea367c7af7ba6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.3
|
Release files / hermax-1.3.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | hermax-1.3.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 9.4 MB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
c22fe28035b30b8a3f9f59c408ac5bf2054710eeffe7714d5b237c783d144746
|
|
BLAKE2b-256 checksum How to use checksums |
5ab2a97d48f148b311390dae5bffed554eff0c0a4a59c73ece73ce4458829c32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.8
|
Release files / hermax-1.3.2-cp310-cp310-win_amd64.whl
| Download URL | hermax-1.3.2-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 10.7 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
88a75682c14bb12b1c6548a34bee30a363b3f0901b24d81beda141e32727f155
|
|
BLAKE2b-256 checksum How to use checksums |
98182cb9b98e06bfa348fe9f8a747a7787c90d393c42102c6874664ebd1cff53
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.3
|
Release files / hermax-1.3.2-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | hermax-1.3.2-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 9.4 MB |
| Tags | CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
8f16e3b320a6972fa4a837af120e3ea052d2d9f201cd80023518f1f6e4f6b7cb
|
|
BLAKE2b-256 checksum How to use checksums |
c48cf143789ff07299ae79c1ab6776387c98c1fa57d9a73aa4b1277a306e3c79
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.8
|
Security for hermax 1.3.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.