Skip to main content

Hermax: MaxSAT Optimization for Python

PyPI version PyPI wheel Python versions License: Apache-2.0 Documentation Status
Paper: SAT 2026 Windows supported Linux supported macOS supported

Hermax Banner

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

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.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for hermax 1.2.7
File Actions
hermax-1.2.7-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.15 CPython 3.15 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for hermax-1.2.7-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
hermax-1.2.7-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 for hermax-1.2.7-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
hermax-1.2.7-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 for hermax-1.2.7-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
hermax-1.2.7-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for hermax-1.2.7-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
hermax-1.2.7-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for hermax-1.2.7-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
hermax-1.2.7-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for hermax-1.2.7-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Total release size: 54.7 MB

Release files / hermax-1.2.7-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL hermax-1.2.7-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 9.1 MB
Tags CPython 3.15 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
075b8e6c8a71b4c36846db74947a48c9d2f14719a125076feb36ebfe59eb7c2f
BLAKE2b-256 checksum
How to use checksums
940dcd34de44adfb809c91af4191ebe4b04a6289a07a6417782fba56cdf1b955
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.7-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL hermax-1.2.7-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
223608725a4c161b4f1f870e03fc9a0fa2b03c897ba9dc28c72f6bfb944f75aa
BLAKE2b-256 checksum
How to use checksums
35764e305becdcd62d107fd03802f6c0a6ddbb1346459328ba95bc4c7417f4be
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.7-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL hermax-1.2.7-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
1d6d20d443008d3c93cf7cf7db7725f57116b0b053bf4fef2d228479364e59db
BLAKE2b-256 checksum
How to use checksums
8d26287c4425d6b6c40f5db351e8a423af5671fe70b8d1ac21684710ca70d02d
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.7-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL hermax-1.2.7-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
0dc060c4a2fb3d7cc8a7468c82fae8851a5c405a7f9cf91bb8624760d984b349
BLAKE2b-256 checksum
How to use checksums
0f698d84b974e2b497ae649dccbe857bee9411bec95a140d6f8dd463c6899102
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.7-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL hermax-1.2.7-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
1cdd9bf7010e99c5fdaa5b144e0dda8167f2b19e71b385439bea2aca17738e34
BLAKE2b-256 checksum
How to use checksums
549ec59dfa43bf64305049dc8bacc06223539920c8bd2aaef7e29dd133c9aa8d
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.7-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL hermax-1.2.7-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
d0ed68efe40d27454923b7fe9e3289c10a7088da5c2c6c1fc1412cf68c0650c1
BLAKE2b-256 checksum
How to use checksums
f44ba2ef41554a7d95b43ae7e2fa981885e4455333f5e8b1360df99aba3f3a74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Security for hermax 1.2.7

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page