All Projects → MiniZinc → minizinc-python

MiniZinc / minizinc-python

Licence: MPL-2.0 license
Access to all MiniZinc functionality directly from Python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to minizinc-python

gibbous
Convex optimization for java and scala, built on Apache Commons Math
Stars: ✭ 17 (-81.52%)
Mutual labels:  linear-programming, constraint-programming
rcbc
COIN-OR branch and cut (CBC) bindings for R
Stars: ✭ 16 (-82.61%)
Mutual labels:  linear-programming, integer-programming
pymzn
A Python wrapper for the MiniZinc tool pipeline.
Stars: ✭ 54 (-41.3%)
Mutual labels:  constraint-programming, minizinc
Gosl
Linear algebra, eigenvalues, FFT, Bessel, elliptic, orthogonal polys, geometry, NURBS, numerical quadrature, 3D transfinite interpolation, random numbers, Mersenne twister, probability distributions, optimisation, differential equations.
Stars: ✭ 1,629 (+1670.65%)
Mutual labels:  linear-programming
SimplexSolver
An easy-to-use Simplex solver class for linear programming.
Stars: ✭ 18 (-80.43%)
Mutual labels:  linear-programming
EKR-SIMPLEX-PROBLEM-CALCULATOR
simplex problem calculator
Stars: ✭ 13 (-85.87%)
Mutual labels:  linear-programming
SAT-Solver-DPLL
A simple SAT solver that implements the DPLL algorithm with unit resolution
Stars: ✭ 37 (-59.78%)
Mutual labels:  sat-solver
good lp
Linear Programming for Rust, with an user-friendly API. This crate allows modeling LP problems, and let's you solve them with various solvers.
Stars: ✭ 77 (-16.3%)
Mutual labels:  linear-programming
ordered
Entropy-controlled contexts in Python
Stars: ✭ 36 (-60.87%)
Mutual labels:  constraint-programming
simsttab
Simple timetabling engine for schools
Stars: ✭ 21 (-77.17%)
Mutual labels:  constraint-programming
cplex-scala
A scala library for IBM ILOG CPLEX
Stars: ✭ 20 (-78.26%)
Mutual labels:  constraint-programming
pycsp3
A Python Library for modeling combinatorial constrained problems
Stars: ✭ 39 (-57.61%)
Mutual labels:  constraint-programming
conjure
Conjure: The Automated Constraint Modelling Tool
Stars: ✭ 84 (-8.7%)
Mutual labels:  constraint-programming
flipy
A Python linear programming interface library
Stars: ✭ 23 (-75%)
Mutual labels:  linear-programming
minisat-rust
Experimental minisat SAT solver reimplementation in Rust
Stars: ✭ 68 (-26.09%)
Mutual labels:  sat-solver
Machine-Learning
🌎 I created this repository for educational purposes. It will host a number of projects as part of the process .
Stars: ✭ 38 (-58.7%)
Mutual labels:  linear-programming
batsat
A (parametrized) Rust SAT solver originally based on MiniSat
Stars: ✭ 26 (-71.74%)
Mutual labels:  sat-solver
antaresViz
ANTARES Visualizations
Stars: ✭ 19 (-79.35%)
Mutual labels:  linear-programming
CNApy
An integrated visual environment for metabolic modeling with common methods such as FBA, FVA and Elementary Flux Modes, and advanced features such as thermodynamic methods, extended Minimal Cut Sets, OptKnock, RobustKnock, OptCouple and more!
Stars: ✭ 27 (-70.65%)
Mutual labels:  constraint-programming
HyperGraphLib
C++ Hypergraph modelling Library using Boost and OpenMP with some algorithms, including isomorphism using Gecode.
Stars: ✭ 19 (-79.35%)
Mutual labels:  constraint-programming

Logo

MiniZinc Python

The python package that allows you to access all of MiniZinc's functionalities directly from Python.
Explore the docs »

Report Bug · Request Feature

Table of Contents

About The Project

MiniZinc Python provides an interface from Python to the MiniZinc driver. The most important goal of this project are to allow easy access to MiniZinc using native Python structures. This will allow you to more easily make scripts to run MiniZinc, but will also allow the integration of MiniZinc models within bigger (Python) projects. This module also aims to expose an interface for meta-search. For problems that are hard to solve, meta-search can provide solutions to reach more or better solutions quickly.

Getting Started

To get a MiniZinc Python up and running follow these simple steps.

Installation

MiniZinc Python can be installed by running pip install minizinc. It requires MiniZinc 2.5.0+ and Python 3.6.0+ to be installed on the system. MiniZinc python expects the minizinc executable to be available on the executable path, the $PATH environmental variable, or in a default installation location.

For more information, please refer to the Documentation

Usage

Once all prerequisites and MiniZinc Python are installed, a minizinc module will be available in Python. The following Python code shows how to run a typical MiniZinc model.

import minizinc

# Create a MiniZinc model
model = minizinc.Model()
model.add_string("""
var -100..100: x;
int: a; int: b; int: c;
constraint a*(x*x) + b*x = c;
solve satisfy;
""")

# Transform Model into a instance
gecode = minizinc.Solver.lookup("gecode")
inst = minizinc.Instance(gecode, model)
inst["a"] = 1
inst["b"] = 4
inst["c"] = 0

# Solve the instance
result = inst.solve(all_solutions=True)
for i in range(len(result)):
    print("x = {}".format(result[i, "x"]))

For more examples, please refer to the Documentation

Testing

MiniZinc Python uses Tox environments to test its coding style and functionality. The code style tests are executed using Black, Flake8, and isort. The functionality tests are constructed using the PyTest unit testing framework.

  • To run all tests, simply execute tox in the repository directory.
  • Individual environments can be triggered using the -e flag.
    • To test the coding style of the repository run tox -e check
    • The py3x environments are used to test a specific Python version; for example, to test using Python version 3.7 run tox -e py37

Tox can also be used to generate the documentation, tox -e docs, and to typeset the Python code, tox -e format.

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the Mozilla Public License Version 2.0. See LICENSE for more information.

Contact

👤 Jip J. Dekker

🏛 MiniZinc

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].