Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Hermax: MaxSAT Optimization for Python

PyPI version PyPI wheel Python versions License: Apache-2.0 Documentation Status

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

hermax-1.2.2rc1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (6.3 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

hermax-1.2.2rc1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (6.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

hermax-1.2.2rc1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (6.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

hermax-1.2.2rc1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (6.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

hermax-1.2.2rc1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (6.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file hermax-1.2.2rc1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for hermax-1.2.2rc1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 08a7b05f5b0e20b2eb6ef38d41775bdcb0a9be84a6f3387bc990dea2f3caada2
MD5 92be86464930bc6a0272e93d41f59b13
BLAKE2b-256 89a6981f20c9c2280aace0c7dd47247362a99cc013eb851c6e333a1d9e8efc21

See more details on using hashes here.

File details

Details for the file hermax-1.2.2rc1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for hermax-1.2.2rc1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d5459cec0b89786b8ba4f3aad4b0a860581c5ea1477cb742081614ffd8e4d595
MD5 a46246ba1fa556244774b8a130e368cc
BLAKE2b-256 bb669203f1f9613e3d2e2a2786d9dbdea743360a5d6e460710cf05884f294f9b

See more details on using hashes here.

File details

Details for the file hermax-1.2.2rc1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for hermax-1.2.2rc1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7d4b1be531227eac0a6d20a0f62e3de5be9feb565f8debf82b07c23fbd8dedbf
MD5 d8616f10734e77ae3824e3ce2a637bc7
BLAKE2b-256 e147487f82c3745de59e8881d1d04c9c95e48c6e62ddd46f2c35c06fb93a4957

See more details on using hashes here.

File details

Details for the file hermax-1.2.2rc1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for hermax-1.2.2rc1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fec12004a3a48afe2fd81ddb35b39ebd54aec64c04811ebba6074ba369320c4f
MD5 b1a8ff2bafa4fb569bd007b97543bfe9
BLAKE2b-256 4af244e52093f38b9925378098d8430f5dc2b63fcbbbc7088b6e33c6816e2685

See more details on using hashes here.

File details

Details for the file hermax-1.2.2rc1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for hermax-1.2.2rc1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3717bfc1a1641a4e5190e87d965d60a03334f8695ca25b7073808d9e1186abeb
MD5 6e9023e10add570b2b42f5a9c6da343a
BLAKE2b-256 f25d8341bee14325cd92e8d6b07c34e7e151f89310239bdfd9b71d2a66094535

See more details on using hashes here.

Release history Release notifications | RSS feed

1.2.5

10 files

1.2.4

21 files

1.2.3

5 files

This release

1.2.2rc1 This release

5 files

1.2.1

25 files

1.1.1

25 files

1.0.0

20 files

0.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page