MiniZinc

MiniZinc
Paradigm
DeveloperMonash University
First appeared2 May 2009; 17 years ago (2009-05-02)
Stable release
2.9.2 / 6 March 2025; 14 months ago (2025-03-06)
Typing disciplineStrong
Implementation languageC++
OSLinux, macOS, and Windows
LicenseMozilla Public License 2.0
Filename extensions.mzn, .dzn, .fzn
Websitewww.minizinc.org
Influenced by
Zinc

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, SAT, and SMT.

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 solvers using its own format "FlatZinc" or .nl files.

A big advantage of MiniZinc is the possibility to use different solvers from the same MiniZinc instance. MiniZinc supports many solvers, both open source and commercial software, including CBC,[2] Choco,[3] Chuffed, HiGHS, Gurobi, IPOPT, and OR-Tools.

MiniZinc is interoperable with other languages such as R[4] and Python.[5]

Language

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);

References

  1. ^ Nethercote, Nicholas; Stuckey, Peter J.; Becket, Ralph; Brand, Sebastian; Duck, Gregory J.; Tack, Guido (2007). "MiniZinc: Towards a Standard CP Modelling Language". In Bessière, Christian (ed.). Principles and Practice of Constraint Programming – CP 2007. Lecture Notes in Computer Science. Berlin, Heidelberg: Springer. pp. 529–543. doi:10.1007/978-3-540-74970-7_38. ISBN 978-3-540-74970-7.
  2. ^ "COIN-OR Branch-and-Cut MIP Solver". projects.coin-or.org. Retrieved 14 September 2020.
  3. ^ "Choco-solver". Choco-solver. Retrieved 14 September 2020.
  4. ^ "Introduction".
  5. ^ "Minizinc Python".

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.