Skip to main content
Loss of provenance

A previous release had provenance metadata, but this release does not. View details.

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, 5]
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

Hermax is designed for the incremental MaxSAT setting formalized by:

  • Niskanen, Berg, Jarvisalo. Incremental Maximum Satisfiability. SAT 2022.

If you use Hermax in research:

  1. Cite the repository: https://github.com/josalhor/hermax
  2. Cite the backend solver papers relevant to your experiments (see CITATION.cff as a starting point)
  3. See additional attribution and latest-paper list in NOTICE.

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

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

Loss of provenance

This file belongs to a release without provenance metadata, despite a prior release including this data.

We recommend further investigation before installing this file. View details.

Built distribution (wheel)

Table of built distributions (wheels) for hermax 1.2.0
File Interpreter ABI Platform Actions
hermax-1.2.0-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.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Release files / hermax-1.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Loss of provenance

This file belongs to a release without provenance metadata, despite a prior release including this data.

We recommend further investigation before installing this file. View details.

Download URL hermax-1.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 6.3 MB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
f78fc942f8a8a036c20a9a52a06900870b017d2d97384065fcce298ba2aea28c
BLAKE2b-256 checksum
How to use checksums
945bcec389092ef63c694f3f6f84c48c8e7f20a6f315d01d22f0d47b94b1d7d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for hermax 1.2.0

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.

Loss of provenance

A previous release of these files had provenance metadata, but this release does not.

While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.

Release comparison

  • Removed 1.3.3 18 files Partial provenance
  • Added 1.2.0 1 file Without provenance

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