this repo has no description
1<!-- PROJECT LOGO -->
2<br />
3<p align="center">
4 <a href="https://www.minizinc.org/">
5 <img src="https://www.minizinc.org/MiniZn_logo.png" alt="Logo" width="80" height="80">
6 </a>
7
8 <h3 align="center">MiniZinc</h3>
9
10 <p align="center">
11 A high-level constraint modelling language that allows you to easily
12 express and solve discrete optimisation problems.
13 <br />
14 <a href="https://www.minizinc.org/"><strong>Visit our website »</strong></a>
15 <br />
16 <br />
17 <a href="https://www.minizinc.org/doc-latest/">View Documentation</a>
18 ·
19 <a href="https://github.com/MiniZinc/libminizinc/issues">Report Bug</a>
20 ·
21 <a href="https://github.com/MiniZinc/libminizinc/issues">Request Feature</a>
22 </p>
23</p>
24
25
26<!-- TABLE OF CONTENTS -->
27## Table of Contents
28
29* [About the Project](#about-the-project)
30* [Getting Started](#getting-started)
31 * [Installation](#installation)
32 * [Usage](#usage)
33* [Building](#building)
34 * [Prerequisites](#prerequisites)
35 * [Compilation](#compilation)
36* [Testing](#testing)
37* [License](#license)
38* [Contact](#contact)
39
40
41<!-- ABOUT THE PROJECT -->
42## About The Project
43
44MiniZinc is a free and open-source constraint modeling language.
45
46You can use MiniZinc to model constraint satisfaction and optimisation problems
47in a high-level, solver-independent way, taking advantage of a large library of
48pre-defined constraints. Your model is then compiled into FlatZinc, a solver
49input language that is understood by a wide range of solvers.
50
51MiniZinc is developed at Monash University in collaboration with Data61
52Decision Sciences.
53
54<!-- GETTING STARTED -->
55## Getting Started
56
57To get a MiniZinc up and running follow these simple steps.
58
59### Installation
60
61The recommended way to install _MiniZinc_ is by the use of the bundled binary
62packages. These packages are available for machines running Linux, Mac, and
63Windows.
64
65The latest release can be found on [the MiniZinc
66website](http://www.minizinc.org/software.html).
67
68### Usage
69
70Once the MiniZinc bundle is installed on your machine, you can start expressing
71and solving discrete optimisation problems. The following code segment shows a
72MiniZinc model for the well known n-queens problem.
73
74```minizinc
75int: n = 8; % The number of queens.
76
77array [1..n] of var 1..n: q;
78
79include "alldifferent.mzn";
80
81constraint alldifferent(q);
82constraint alldifferent(i in 1..n)(q[i] + i);
83constraint alldifferent(i in 1..n)(q[i] - i);
84```
85
86You have two easy options to solve this model:
87 - In the MiniZincIDE: Select your preferred solver and press the "Run" button.
88 - With the `minizinc` executable available on your path: run `minizinc --solver gecode nqueens.mzn`.
89
90_For more example MiniZinc models and more information about working with
91MiniZinc, please refer to our
92[Documentation](https://www.minizinc.org/doc-latest/)_
93
94<!-- BUILDING INSTRUCTIONS -->
95## Building
96
97The following instructions will help you compile the MiniZinc compiler. Note
98that this repository does not include the IDE, findMUS, or any solvers that are
99part of the MiniZinc project. These can be found in the following repositories:
100
101 - [MiniZincIDE](https://github.com/MiniZinc/MiniZincIDE)
102 - [Gecode](https://github.com/Gecode/gecode)
103 - [Chuffed](https://github.com/chuffed/chuffed)
104
105### Prerequisites
106
107- [CMake](https://cmake.org/) (>=3.4)
108- A recent C++ compiler - Compilation is tested with recent versions of Clang,
109 GCC, and Microsoft Visual C++.
110- (optional) [Bison](https://www.gnu.org/software/bison/) (>=3.4) and
111 [Flex](https://github.com/westes/flex) (>=2.5) - To make changes to the
112 MiniZinc lexer or parser.
113- (optional) [Gecode](https://www.gecode.org/) - To compile the internal Gecode
114 solver interface (included in the MiniZinc bundle)
115- (optional) [Coin OR's CBC](https://www.coin-or.org/) - To compile the
116 internal CBC solver interface (included in the MiniZinc bundle)
117- (optional) Proprietary solver headers
118 ([CPLEX](https://www.ibm.com/analytics/cplex-optimizer),
119 [Gurobi](https://www.gurobi.com/), [SCIP](https://www.scipopt.org/),
120 [Xpress](https://www.fico.com/)) - To load these solvers at runtime (included
121 in the MiniZinc bundle)
122
123### Compilation
124
125The MiniZinc compiler is compiled as a CMake project. CMake's [User Interaction
126Guide](https://cmake.org/cmake/help/latest/guide/user-interaction/index.html)
127can provide you with a quick introduction to compiling CMake projects. The
128following CMake variables can be used in the MiniZinc project to instruct the
129compilation behaviour:
130
131| Variable | Default | Description |
132|----------------------------------------------|---------|-------------------------------------------------------------|
133| CMAKE_BUILD_TYPE | Release | Build type of single-configuration generators. |
134| CMAKE_INSTALL_PREFIX | | Install directory used by `--target install`. |
135| CMAKE_POSITION_INDEPENDENT_CODE | TRUE | Whether to create a position-independent targets |
136| **<solver_name>**_ROOT | | Additional directory to look for **<solver_name>** |
137| CMAKE_DISABLE_FIND_PACKAGE_**<solver_name>** | FALSE | Disable compilation of **<solver_name>**'s solver interface |
138| USE_PROPRIETARY | FALSE | Allow static linking of proprietary solvers |
139| **<Gurobi/CPlex>**_PLUGIN | TRUE | Load solver at runtime (instead of static compilation) |
140
141Possible values for **<solver_name>** are `CPlex`, `Geas`, `Gecode`, `Gurobi`,
142`OsiCBC`, `SCIP`, and `Xpress`.
143
144<!-- TESTING INSTRUCTIONS -->
145## Testing
146
147The correctness of the MiniZinc compiler is tested using a
148[PyTest](https://docs.pytest.org/en/stable/) test suite. Instruction on how to
149run the test suite and how to add new tests can be found
150[here](https://github.com/MiniZinc/libminizinc/tree/master/tests)
151
152
153<!-- LICENSE -->
154## License
155
156Distributed under the Mozilla Public License Version 2.0. See `LICENSE` for more information.
157
158
159<!-- CONTACT -->
160## Contact
161
162🏛 **MiniZinc Community**
163 - Website: [https://www.minizinc.org/](https://www.minizinc.org/)
164 - StackOverflow: [https://stackoverflow.com/questions/tagged/minizinc](https://stackoverflow.com/questions/tagged/minizinc)
165 - Google Groups: [https://groups.google.com/g/minizinc](https://groups.google.com/g/minizinc)
166
167🏛 **Monash Optimisation Group**
168 - Website: [https://www.monash.edu/it/dsai/optimisation](https://www.monash.edu/it/dsai/optimisation)