MiniZinc
From Wikipedia, the free encyclopedia
From Wikipedia, the free encyclopedia
MiniZinc[1] is a constraint modelling language (or algebraic modeling language) to describe and solve high-complexity problems using a variety of well-known solving paradigms for combinatorial problems including constraint programming, integer programming, lazy clause generation, SAT, and SMT.
Paradigm | Constraint programming / Logic Programming |
---|---|
Developer | Monash University |
First appeared | May 2, 2009 |
Stable release | 2.8.5
/ June 3, 2024 |
Implementation language | C++ |
OS | Linux, MacOS, and Windows |
License | MPLv2 |
Filename extensions | .mzn, .dzn, .fzn |
Website | www |
Influenced by | |
Zinc |
Following the constraint programming paradigm, in MiniZinc a problem is specified in terms of known values (parameters), unknown values (decision variables), and the relationship (constraints) between these values. MiniZinc promotes the use of global constraints to model well-known structures in problems. These global constraints improve the clarity of the model and allow solvers to use the most effective method to exploit the structure. A MiniZinc problem instance is translated (or flattened) to a level at which it only supports constraints that are supported by the target solver and then given to the solver using its preferred format. Currently MiniZinc can communicate with solver using its own format FlatZinc or .nl files.
A big advantage of MiniZinc is the possibility to use different solvers, and even different solvers, from the same MiniZinc instance. MiniZinc supports many solvers, both open source and commercial software, including CBC,[2] Choco,[3] Chuffed, Gurobi, IPOPT, and OR-Tools.
MiniZinc is interoperable with other languages such as R. [4]
The following MiniZinc model can be used to solve the famous n-queens puzzle:
include "all_different.mzn"; % Include all_different global
int: n = 8; % The number of queens. (parameter)
array [1..n] of var 1..n: q; % The height of the queens on the board. (decision variable)
% No queen can be in a position where it can capture another queen. (constraints)
constraint all_different(q);
constraint all_different(i in 1..n)(q[i] + i);
constraint all_different(i in 1..n)(q[i] - i);
Seamless Wikipedia browsing. On steroids.
Every time you click a link to Wikipedia, Wiktionary or Wikiquote in your browser's search results, it will show the modern Wikiwand interface.
Wikiwand extension is a five stars, simple, with minimum permission required to keep your browsing private, safe and transparent.