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)
# Soft objective terms
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
from hermax.incremental import UWrMaxSAT
solver = UWrMaxSAT()
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}
}
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.2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| hermax-1.2.6-cp314-cp314-win_amd64.whl | CPython 3.14 | CPython 3.14 | Windows x86-64 | Details |
| hermax-1.2.6-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.14 | CPython 3.14 | Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 | Details |
| hermax-1.2.6-cp313-cp313-win_amd64.whl | CPython 3.13 | CPython 3.13 | Windows x86-64 | Details |
| hermax-1.2.6-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.13 | CPython 3.13 | Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 | Details |
| hermax-1.2.6-cp312-cp312-win_amd64.whl | CPython 3.12 | CPython 3.12 | Windows x86-64 | Details |
| hermax-1.2.6-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 | Details |
| hermax-1.2.6-cp311-cp311-win_amd64.whl | CPython 3.11 | CPython 3.11 | Windows x86-64 | Details |
| hermax-1.2.6-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 | Details |
| hermax-1.2.6-cp310-cp310-win_amd64.whl | CPython 3.10 | CPython 3.10 | Windows x86-64 | Details |
| hermax-1.2.6-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.10 | CPython 3.10 | Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 | Details |
Total release size: 97.1 MB
Release files / hermax-1.2.6-cp314-cp314-win_amd64.whl
| Download URL | hermax-1.2.6-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 10.4 MB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
c156f0580060e811bd48d94ce19c45b35044ee0d630799309a6a5cd5013318c3
|
|
BLAKE2b-256 checksum How to use checksums |
c79a57c17b0f59a992585608e622e33a4a578f0eb170cf740c78f9ada5d93e82
|
| 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.2.6-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | hermax-1.2.6-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 9.1 MB |
| Tags | CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
c2eff311269fb38620e3fdb7bec4fda8c81fb768a9ea05e715fe54c9438e666c
|
|
BLAKE2b-256 checksum How to use checksums |
ee8b042ca990b38a7d8501ef30818f41c503fa3831ef5f342c58fec44cb57192
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / hermax-1.2.6-cp313-cp313-win_amd64.whl
| Download URL | hermax-1.2.6-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 10.4 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
8d01e0502e0088d98d1b281f5225413b897eb27459fcc67d1e52338adf0d8589
|
|
BLAKE2b-256 checksum How to use checksums |
787b1b29415dd71e293216f6f99077e865398c9f9d24d1156a29eea2e481c1cd
|
| 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.2.6-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | hermax-1.2.6-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 9.1 MB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
692e7f5258685654c8abedf939a9d58071e55ea036cc57e690ccf9ef2d496192
|
|
BLAKE2b-256 checksum How to use checksums |
d1e9d4b99afed0085d7376fa8226191b7815df5ffd4dfe9044bf5408ca06c977
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / hermax-1.2.6-cp312-cp312-win_amd64.whl
| Download URL | hermax-1.2.6-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 10.3 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
ffa38290e02c097058691f8942a651d0cf616d98f8127a07a2e4bb64e6fe0571
|
|
BLAKE2b-256 checksum How to use checksums |
f3caf840b206bba4cc751be17a5b8a4953468de71dd7e9702b48f0cd0d13f91b
|
| 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.2.6-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | hermax-1.2.6-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 9.1 MB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
0a4fefc9bbb284ba94ecf224be0485ad63e22c336d7f2cfdaefb5d7a0662ad42
|
|
BLAKE2b-256 checksum How to use checksums |
8aef75a39161f83b0622a3abb81878336f850f971d8df36f59256ea1c7a986fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / hermax-1.2.6-cp311-cp311-win_amd64.whl
| Download URL | hermax-1.2.6-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 10.3 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d9488c67bf853d293b8dea4c54e49ea0200eca7cd31a95ed3a8cc03e443c6a44
|
|
BLAKE2b-256 checksum How to use checksums |
6ece008c4142d5ad4a1283762408e7f281f633eaeeeb7cfca660bbdd7f2e1c84
|
| 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.2.6-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | hermax-1.2.6-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 9.1 MB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
0d5822a6912f8f8829d188e5cc4ebe58aeca58bf6772df5af8e8d891438820b6
|
|
BLAKE2b-256 checksum How to use checksums |
92d48cda00561575cefa73abbe780e37291e7e2331618e9d86781190954ee51a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / hermax-1.2.6-cp310-cp310-win_amd64.whl
| Download URL | hermax-1.2.6-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 10.3 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
3b056999b771d94d81cee9071f84c686fac470913585ed8e8e880e5c533e5a1b
|
|
BLAKE2b-256 checksum How to use checksums |
dbb890dddc49e6ed3fa491c2118813e88dd036667520bfdf9090a6489a6379a3
|
| 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.2.6-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | hermax-1.2.6-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 9.1 MB |
| Tags | CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
43e4d9358fb58eacb361abe42b1dbdca367614c0ee15e87a7c06930c789324db
|
|
BLAKE2b-256 checksum How to use checksums |
432952298547b4a19d23660d6a47854017f2a6d863095a10b9c93c1815a151c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|