Registry / data / jijmodeling

jijmodeling

JSON →
library2.4.1pypypi✓ verified 90d ago

JijModeling is a Python library for mathematical modeling of optimization problems, with a focus on combinatorial optimization. It provides an intuitive API to define decision variables, constraints, and objective functions, and interfaces with solvers like JijZept. Current version 2.4.1, requires Python >=3.11, <4. Released regularly.

pip install jijmodeling
INSTALL
IMPORT
SIG · JIJMODELING
J
jijmodeling
datapythonv2.4.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

jm
✓ import jijmodeling as jm
✗ from jijmodeling import *
Wildcard import pollutes namespace; use 'import jijmodeling as jm'.
Problem
✓ import jijmodeling as jm; problem = jm.Problem('name')
✗ from jijmodeling import Problem
Direct import is fine, but typical usage via jm.Problem is recommended for clarity.

Define a simple binary optimization problem with variables, objective, and constraint.

import jijmodeling as jm # Define variables x = jm.BinaryVar('x', shape=(3,)) y = jm.BinaryVar('y', shape=(3,)) # Set problem problem = jm.Problem('simple') problem += x[0] + x[1] + x[2] problem += jm.Constraint('c1', x[0] + y[0] == 1) # Solve (requires JijZept token) token = os.environ.get('JIJZEPT_TOKEN', '') if token: import jijzept as jz sampler = jz.JijSASampler(token) result = sampler.sample(problem) print(result) else: print('No JIJZEPT_TOKEN set. Problem defined:', problem)
Debug
Known issues
breakingIn version 2.0+, the API changed significantly. The old `jijmodeling` standalone model definition (e.g., `jm.Model`) is replaced by `jm.Problem`. Code from v1.x must be rewritten.
fix
Migrate from `jm.Model` to `jm.Problem`. Use `jm.BinaryVar` instead of `jm.Binary`. Check migration guide.
affects: >=2.0
gotchaVariable indexing returns a placeholder, not the actual value. You cannot compare variables directly using Python comparison operators; use `==`, `<=`, `>=` only within constraints or objective expressions.
fix
Always use `jm.Constraint` for comparisons. Do not use `if x[0] == 1:` in code logic.
affects: *
deprecatedThe `jm.pw` (piecewise linear) function is deprecated in 2.4.0+. Use `jm.Problem.add_piecewise` or custom linearization.
fix
Replace `jm.pw(...)` with `problem.add_piecewise(...)` or reformulate.
affects: >=2.4.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'jijmodeling'
jijmodeling is not installed or installed in wrong environment.
fix
Run `pip install jijmodeling` in the correct Python environment (Python >=3.11).
AttributeError: module 'jijmodeling' has no attribute 'Model'
In version 2.x, `Model` was renamed to `Problem`.
fix
Use `jm.Problem` instead of `jm.Model`.
JijModelingError: Cannot use operator '>' with Expression objects
Using Python comparison operators like `>` outside of Constraint definition.
fix
Wrap comparisons in `jm.Constraint('name', expr)` or use `jm.Constraint(expr)`.
Upgrade
Version history
2.4.1latest on PyPI · released May 1, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources