Use MiniZinc
Use MiniZinc for decision problems that naturally fit a constraint programming (CP) model. It works well for discrete constraint satisfaction problems and models that benefit from CP global constraints.
Capabilities
Section titled “Capabilities”- Supports constraint programming (CP) and discrete optimization.
Limitations
Section titled “Limitations”- Does not support continuous decision variables.
- Only the Chuffed backend is currently exposed.
- MiniZinc requires a single, scalar objective.
Example
Section titled “Example”Create a Problem with Integer model type and pass "minizinc" to .solve() to use the MiniZinc backend:
from relationalai.semantics import Integer, Modelfrom relationalai.semantics.reasoners.prescriptive import Problem
m = Model("DiscreteExample")
# ... model definition ...
p = Problem(m, Integer)
# ... problem definition ...
p.solve("minizinc", _server_side_import=False)- MiniZinc requires
Problem(m, Integer). If you useFloat, you will typically get type or compilation errors. - MiniZinc runs through a MiniZinc backend. In current deployments, PyRel uses the Chuffed backend.
Version and licensing
Section titled “Version and licensing”MiniZinc is bundled and does not require a license key or additional Snowflake setup.
| Detail | Info |
|---|---|
| Version | 2.8.5 |
| License | MPL 2.0 (free and open source) |
Resources
Section titled “Resources”Where to go next
Section titled “Where to go next” Solve a decision problem Learn the prescriptive workflow for declaring decision variables, adding requirements and an objective, solving, and reading results.
Browse prescriptive reasoning templates Explore prescriptive templates you can adapt to your own problems.