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 x86 supported Linux x86 and ARM supported macOS x86 and ARM 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)

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

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.3.1
File Actions
hermax-1.3.1-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.15 CPython 3.15 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for hermax-1.3.1-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
hermax-1.3.1-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for hermax-1.3.1-cp314-cp314-win_amd64.whl
hermax-1.3.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for hermax-1.3.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
hermax-1.3.1-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for hermax-1.3.1-cp313-cp313-win_amd64.whl
hermax-1.3.1-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.3.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
hermax-1.3.1-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for hermax-1.3.1-cp312-cp312-win_amd64.whl
hermax-1.3.1-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 for hermax-1.3.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
hermax-1.3.1-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for hermax-1.3.1-cp311-cp311-win_amd64.whl
hermax-1.3.1-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 for hermax-1.3.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
hermax-1.3.1-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for hermax-1.3.1-cp310-cp310-win_amd64.whl
hermax-1.3.1-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 for hermax-1.3.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Total release size: 110.9 MB

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

Download URL hermax-1.3.1-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 9.5 MB
Tags CPython 3.15 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
a8f9d35b8c73501afd8ac4c80076a5cb882d131570a6f3f80e922e839ba1d478
BLAKE2b-256 checksum
How to use checksums
1a793092dee58c7b3c05426e8f8260e5c76b571cfe6f15fdf08025b3d8d6e5ed
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.1-cp314-cp314-win_amd64.whl

Download URL hermax-1.3.1-cp314-cp314-win_amd64.whl
Size 10.9 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
3cc358d684a5b0dfa25c7941237f1a2b0251892e44c2c3b60949618735609aef
BLAKE2b-256 checksum
How to use checksums
e38695d169b80ad395a521ec4e3ef587b8eded36150c1fa7acd12fc47884ad86
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.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL hermax-1.3.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 9.5 MB
Tags CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
32408a9a6ff2c60d115a00e1030dba5714fec3dfdd2fd2343ce9a3e0dff8b8ba
BLAKE2b-256 checksum
How to use checksums
bd124ca84fc52cdc14509b0c5ebbaffa6b43602a9a93c119294ff7324a59cbba
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.1-cp313-cp313-win_amd64.whl

Download URL hermax-1.3.1-cp313-cp313-win_amd64.whl
Size 10.8 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
5bff0f9fc49809777d1156f6f32339bad3e68af9c209d144054b366619e9f845
BLAKE2b-256 checksum
How to use checksums
ac6fd3eadd5574c624b1824910e927d25770414685c46e1828156536dc910fad
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.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL hermax-1.3.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 9.5 MB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
7768c4bac06ffa1a80784cad4129fdbc07de6df2b04a19ca3cce9e0aee5c571a
BLAKE2b-256 checksum
How to use checksums
a08390c88c85a32eb02e7f58c63e9dac97d05ac33e704406331b7f69f82c5b3f
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.1-cp312-cp312-win_amd64.whl

Download URL hermax-1.3.1-cp312-cp312-win_amd64.whl
Size 10.7 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
b025ebb821e08cf12c4dd277499bdf872221ef2c4d0373ce7b731d1ca3036764
BLAKE2b-256 checksum
How to use checksums
47b7a542385f71ef93d85e434837764cc96af65b23fa011aee17fd1d8abaa5a0
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.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL hermax-1.3.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 9.5 MB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
b9164d6fe75934c43bb68c32edfd5467b4c6cbb2df032e91d0a32475bb2f98e5
BLAKE2b-256 checksum
How to use checksums
7a360d0099f72a833c60597f2e641cf0f3e8927d7c53da6ffdbd216f67e5f4fa
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.1-cp311-cp311-win_amd64.whl

Download URL hermax-1.3.1-cp311-cp311-win_amd64.whl
Size 10.7 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
d40ddbbc5f234b41d8714e69f8ea3cb3d04abc9ba1acbf0d4d454f58d9f4f637
BLAKE2b-256 checksum
How to use checksums
0e84106f48f66ce4a75bbc03011f33ab8c6369f0483e2de2411f23405072003c
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.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL hermax-1.3.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 9.5 MB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
e1d392304da29aafaa0d64912486398a890e9fb4a991e67fbb43630e94e8d61f
BLAKE2b-256 checksum
How to use checksums
d394aedf39670bc7e94c3968b3f751f484bbf5700de8bc05228b430acbf6c64f
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.1-cp310-cp310-win_amd64.whl

Download URL hermax-1.3.1-cp310-cp310-win_amd64.whl
Size 10.7 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
75493eb496335f6c3b9f4aea72af1ba2bd7649c64750783f9238e0d774d82a91
BLAKE2b-256 checksum
How to use checksums
52ec2fc75fbc76b27fb0ab2668f28a1700982782c1b22cddbb2d0b8bf4cde419
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.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL hermax-1.3.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 9.5 MB
Tags CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
9ae40df319af3f2bcbe457403101f250d555466fbcc8dde5b21891b52e7925ab
BLAKE2b-256 checksum
How to use checksums
3ab159561c7ca464016397f61e4a38621764ffa1710a8646f52346f8faf8eeb0
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.1

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