Questions tagged [minizinc]

MiniZinc is a solver-independent Constraint-Programming modelling language.

MiniZinc as modelling language is high-level enough to express most constraint problems easily, but low-level enough that it can be mapped onto existing solvers easily and consistently. This is done by converting the MiniZinc model to a lower-level language, FlatZinc. It is a subset of the higher-level language Zinc.

Around MiniZinc, several FlatZinc solvers and an IDE for development are freely available.

The MiniZinc home is here: http://www.minizinc.org

Hakan Kjellerstrand's MiniZinc page has lots of MiniZinc models and global constraint definitions.

426 questions
4
votes
1 answer

How to install a minizinc solver

In MiniZinc (windows IDE) How can I resolve: flatzinc: error: variables of type `var float' are not supported by the FD solver backend. I realize I need a different solver but could not find a procedure installing one and the Preferences dlg does…
Jim Lewis
  • 349
  • 2
  • 14
3
votes
1 answer

Optimizing MiniZinc constraints for a scheduling problem

I am trying to use MiniZinc to solve a scheduling problem. Here is the main setting: I have a certain number of students They rank 7 topics in order of preference They will be assigned 4 of such topics There is 4 time slots available in the…
3
votes
2 answers

I can't even phrase the question, I need 3 closely equal number from a huge set of numbers

I have an optimisation problem with: 5 variables a,b,c,d,e; 4 constraints; 5 objectives; a list of "increment" instructions to choose from. The constraints: a >= x b >= y e > c e > d x and y are integer parameters. The objectives: maximize (c +…
Ceritoxi
  • 41
  • 4
3
votes
1 answer

What are does the gray squares represent in MiniZinc?

In Minizinc while visualising the execution tree (created via Profile search) I obtain a tree containing gray square. What do they represent ?
Charc
  • 87
  • 5
3
votes
1 answer

Can I specify the order in which the possible values are tried for a variable?

I'm performing clustering on Minizinc on huge dataset but my computational time is huge and I'm trying to reduce it. To do so, I would like to specify the order in which the possible values are tried for a variable. For example, a variable v as a…
Charc
  • 87
  • 5
3
votes
1 answer

Minizinc trace an array during solve

I have a 2d grid where certain cell values produce different scores, and I want to maximize the score by assigning values to cells. Is it possible to trace each grid the solver tried during the solve? Below is a snippet of the model just to…
Kun Hu
  • 417
  • 5
  • 11
3
votes
1 answer

Difference between seq_search([ann1, ann2]) and ann1 :: ann2?

What is the difference between these two methods to do the search in Minizinc? First one: solve :: seq_search([ann1, ann2]) satisfy; Second one: solve :: ann1 :: ann2 satisfy;
albero
  • 169
  • 2
  • 9
3
votes
1 answer

Optional variables and set membership in MiniZinc

I have a variable, that should only have a value under certain conditions, so it needs to be an optional variable, I suppose. If that condition is met, the optional variable should be restricted to elements of a set. The problem is, that MiniZinc…
Jinxed
  • 356
  • 2
  • 16
3
votes
1 answer

Find the smallest alldifferent array whose sum is n

This seems like such a simple problem, but I can't find a simple way to represent this in MiniZinc. include "globals.mzn"; int: target; int: max_length; var 1..max_length: length; array[1..length] of int: t; constraint sum(t) =…
jamesrom
  • 866
  • 3
  • 10
  • 19
3
votes
1 answer

reified and half-reified predicates

It has been recently brought to my attention that some recent version of FlatZinc supports half-reified predicates: Half-reified predicates essentially represent constraints that are implied by a Boolean variable rather than being equivalent to…
Patrick Trentin
  • 7,126
  • 3
  • 23
  • 40
3
votes
1 answer

Getting Minizinc output as .txt from IDE

Imagine I ran a .mzn with .dzn and got an output in IDE as…
suresh_chinthy
  • 377
  • 2
  • 12
3
votes
0 answers

How to partition a graph into connected components using MiniZinc?

I am trying to assign a component to each node of a graph in such a way that all nodes that are assigned the same component are connected. By connected I mean that any two nodes in the same component should be reachable through some undirected path…
Lorenz Leutgeb
  • 474
  • 6
  • 12
3
votes
1 answer

What does $ mean in MiniZinc?

I see $ used in various places in the MiniZinc Handbook (mostly in the Reference Manual portion), but I haven't been able to find a definition. Would someone kindly explain it to me. Thanks.
RussAbbott
  • 2,660
  • 4
  • 24
  • 37
3
votes
1 answer

Unsatisfiable solution with `constraint forall(i in x)( x[i] <= x[i+1] );`

I'm working on a toy problem to learn minizinc. Take an array (hardcoded to size 3 for now) of values between 0 and 9 and find the combinations where the sum is equal to the product. par int: n = 3; % hardcode for now array[1..n] of var 0..9:…
Chris Snow
  • 23,813
  • 35
  • 144
  • 309
3
votes
1 answer

Sampling from weighted constraint solving in Minizinc?

Slightly unusual constraint solving problem I'm trying to implement in MiniZinc: I have a CSP that has some hard constraints and a soft constraint that the relations in the solution should have a statistically similar profile to an example solution.…
Isaac
  • 137
  • 1
  • 1
  • 5
1 2
3
28 29