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.

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.5-cp314-cp314-win_amd64.whl (11.9 MB view details)

Uploaded CPython 3.14Windows x86-64

hermax-1.2.5-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (9.5 MB view details)

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

hermax-1.2.5-cp313-cp313-win_amd64.whl (11.9 MB view details)

Uploaded CPython 3.13Windows x86-64

hermax-1.2.5-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (9.5 MB view details)

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

hermax-1.2.5-cp312-cp312-win_amd64.whl (11.8 MB view details)

Uploaded CPython 3.12Windows x86-64

hermax-1.2.5-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (9.5 MB view details)

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

hermax-1.2.5-cp311-cp311-win_amd64.whl (11.8 MB view details)

Uploaded CPython 3.11Windows x86-64

hermax-1.2.5-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (9.5 MB view details)

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

hermax-1.2.5-cp310-cp310-win_amd64.whl (11.7 MB view details)

Uploaded CPython 3.10Windows x86-64

hermax-1.2.5-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (9.5 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.5-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: hermax-1.2.5-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 11.9 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for hermax-1.2.5-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 f23c527867de902b5a51df3e24b75974aab64fb22e22a69a8d1b4af0fda7adf7
MD5 3be3c7ecd72de652e1de23bce24f45cb
BLAKE2b-256 27896e8889065eeb0ecafa56f1efcc6c016995987a472695ddb6ad8caf909361

See more details on using hashes here.

File details

Details for the file hermax-1.2.5-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for hermax-1.2.5-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 319fb931154d7a0161ecd3770f745c6ab5ea150d5ca4d3b0682be954292d615f
MD5 f17422e25e9881c13a65d89ae8348e9e
BLAKE2b-256 ad70ea0a980f520d702ddc8e93641c14bcd0b0aa02656e2288f00c8d19ef0cda

See more details on using hashes here.

File details

Details for the file hermax-1.2.5-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: hermax-1.2.5-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 11.9 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for hermax-1.2.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 fb7c3728b8ed00d6362334f103bd05b98e23be54c0ea58d0db91d1afcb9c689a
MD5 918bd9ef7a31669d5d9bd99e597ed9ad
BLAKE2b-256 b3aa754c400de0502729ed2782d85f02db9e98dac85cd3369039e069d6e6ad48

See more details on using hashes here.

File details

Details for the file hermax-1.2.5-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for hermax-1.2.5-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f117a77fb1a4eb4abb49009468344142c9b5880cc064ae2eca412fbf3cc4e368
MD5 bcde332525b061d3b104f47bda43a524
BLAKE2b-256 ba46fae087749901dc25d297950b6c04e10f6be081abc28fe305668a2db41813

See more details on using hashes here.

File details

Details for the file hermax-1.2.5-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: hermax-1.2.5-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 11.8 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for hermax-1.2.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 4b9fac2da23dce2cb49bcc48c3b7bdafbfd528e2ffa08bf7c2f678d317f2e0e5
MD5 386df271157acf0c1f2a8e5351f30161
BLAKE2b-256 4a93ade55415d349fa5878e4fc9023547ed9cc7bf74cb799f608a8d875d20c60

See more details on using hashes here.

File details

Details for the file hermax-1.2.5-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for hermax-1.2.5-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 07e4793abf1c8c964dd9b1e3b8290336a997fe170fd9aa91a21020589980c2a9
MD5 a53ff1fe0aacfa71049680bbfc7f2296
BLAKE2b-256 bfc7adb7c5a4c0767c58f50562a04afb1c437f29eabf5046f91f1aa0c719df0c

See more details on using hashes here.

File details

Details for the file hermax-1.2.5-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: hermax-1.2.5-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 11.8 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for hermax-1.2.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1a2062c0a9b010a3c636abcf1c7bee2a8839c9de0f9c41b68542e9695f34839c
MD5 7b02e7c2e540c3d5050b2d194d468b01
BLAKE2b-256 318afa242e5f9c0777bc6b22c0a0d29a12a90646859833673f060191514349c0

See more details on using hashes here.

File details

Details for the file hermax-1.2.5-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for hermax-1.2.5-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b0430e92ee449d76793f8b7874372b46c2aaf97003ee2ca7adb346808bffa5e3
MD5 ad795851c779fe10dfe0c4430223db6e
BLAKE2b-256 cb32e8785d4746b4a3b8f81dd1fd5a445dc914ed036241543cd074d656a52f41

See more details on using hashes here.

File details

Details for the file hermax-1.2.5-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: hermax-1.2.5-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 11.7 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for hermax-1.2.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 9d42856c5dd6849e9303230526eb0aab0971be5c62c469c106fabb605d55d4e7
MD5 c7c15f12ff62c061eb25b4f0b4c6c672
BLAKE2b-256 ee037307a3d4180b1e7bf12eebd0a7dbeacb147a79d0155db1d336c581ba1a2d

See more details on using hashes here.

File details

Details for the file hermax-1.2.5-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for hermax-1.2.5-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4a97ebb3e9511e50af67f9cef7dee23b0d5d100ef67d8a4ff493cefc0c750f27
MD5 3687d74212410633959520c53a637841
BLAKE2b-256 5aa366601efad4f2bd28652c8d3699da97c151f42b516af3cc5231df7c03780a

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.2.5 This release

10 files

1.2.4

21 files

1.2.3

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