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
3
votes
1 answer

Check if an element is present in a array #minizinc

I'd like to check which is the number between 1 to 5 that not occurs in the array group and put this number (or numbers) in an other array. g=2; set of int: GROUPS = 1..g; groups = [{1, 3}, {2,5}]; p=5; set of int: PEOPLE = 1..p; I tried in…
P.ru
  • 93
  • 1
  • 13
3
votes
1 answer

Minizinc nested for loop

How could I use nested for loop(like what java does below) to generate/populate arrays in Minizinc? int[][] input1 = {{1,1,1}, {3,3,3}, {5,5,5} }; int[][] input2 = {{2,6,9},{7,7,7}, {9,9,9}, {11,11,11} }; int[][] diff = new…
jan06
  • 79
  • 2
  • 9
3
votes
2 answers

Constraint Programming: Scheduling with multiple workers

I'm new to constraint programming. I imagine this is an easy problem but I can't wrap my head around it. Here's the problem: We have multiple machines (N), each with a limited resource (let's say memory, and it can be the same for all machines.) We…
Mike
  • 251
  • 1
  • 12
3
votes
1 answer

Solving string constraints in MiniZinc

I attempted to define a constraint with the string concatenation operator in MiniZinc, solving for the variables a and b: include "disjunctive.mzn"; var string:a; var string:b; constraint("var1/var2" = (a ++ "/" ++ b)); solve satisfy; output…
Anderson Green
  • 30,230
  • 67
  • 195
  • 328
3
votes
1 answer

In MiniZinc how can I resolve this error?

In MiniZinc how can I get this code to compile without the error "no function or predicate with this signature found: `round(var float)'"? var int: D = 1; var int: F; constraint F = round (D / 2);
Jim Lewis
  • 349
  • 2
  • 14
3
votes
2 answers

debugging minizinc (anyway, did I found a bug?)

I'm familiarizing with the basic of MiniZinc. So, armed with the MiniZinc IDE, I write snippets like solve satisfy; string: s1 = "hello"; string: s2 = "world"; function list of int: cdr(list of int: v) = [v[i] | i in 1..length(v)]; function list…
CapelliC
  • 59,646
  • 5
  • 47
  • 90
3
votes
1 answer

Minizinc: output for five days,there is a better flexible way?

I have to extend the output and the solution of my project (make an exams scheduling): -Extend the structure to five days (I have always worked on one day): I thought about moltiply the number of days for slotstimes (5*10) and then I tune the…
3
votes
2 answers

Projection of solutions

Is there a possibility to tell MiniZinc to project solutions on a subset of the set of variables? Or is there any other way to enumerate all solutions that are unique wrt to evaluation of some subset of variables? I have tried to use FlatZinc…
kostya
  • 33
  • 3
3
votes
2 answers

Minizinc: variable order

A constraint model may have restrictions or provide hints to the constraint solver to solve the problem more efficiently by defining the order in which variables are solved for. Is there a mechanism to specify the order in which variables need to…
3
votes
1 answer

power-of (pow) constraints in minizinc

Is there any way (direct or indirect) by which pow constraints can be supported in minizinc. Gecode supports the pow constraint with float and int variables, however Minizinc and FlatZinc does not support pow for variables. Minizinc and Flatzinc…
3
votes
4 answers

Constraint programming boolean solver

Huey, Dewey and Louie are being questioned by their uncle. These are the statements they make: • Huey: “Dewey and Louie had equal share in it; if one is guilty, so is the other.” • Dewey: “If Huey is guilty, then so am I.” • Louie: “Dewey and I are…
user2975699
  • 585
  • 1
  • 9
  • 22
3
votes
0 answers

Is there any way to empty the "cache" in MiniZinc

I'm trying to optimize a modele (in terms of the time it takes to solve). The modele returns the right answer, but MiniZinc takes too much time to find the solution. My probleme is that, when I try to solve the modele the first time, minizinc takes…
2
votes
0 answers

Big performance differences between solvers

I have a working model with its associated dzn files. I have tried different solvers (Gurobi, ORTools & Chuffed). All solvers can find a solution (for now, I'm only using solve satisfy;. However, if I increase the problem size, Gurobi & ORTools…
Yop
  • 23
  • 4
2
votes
2 answers

How can I generate a graph by constraining it to be subisomorphic to a given graph, while not subisomorphic to another?

TL;DR: How can I generate a graph while constraining it to be subisomorph to every graph in a positive list while being non-subisomorph to every graph in a negative list? I have a list of directed heterogeneous attributed graphs labeled as positive…
2
votes
2 answers

Placing array of rectangles inside a given area

I want to place a set of rectangles into an area with a given width and minimize the total height. I have made a solution in miniZinc, but the running time is quite long. The final result came after a couple of seconds, but the running didn't stop…