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

Minizinc: is this constraint possible?

I'd like to figure out how to write this constraint: I have a list of exams,every exam has a duration; the final output is the display of a real timetable, in the columns there are the available hours, four in the morning and four in the afternoon,…
0
votes
1 answer

Generating unique solutions with Constraint Programming

I had a brief exposure to CP and MiniZinc but I'm no expert. I have a CP model, which I cannot post here ATM, implemented in MiniZinc. I need to generate all the feasible solution for the problem. We expect to have just a "few" ones, say less than…
a.tavs
  • 3
  • 1
-1
votes
1 answer

Minizinc : var array with variable size

I want solve this problem : i have a number n and i want to have an array with all pair (i,j) for all i,j in [1,n] I write this for solve the problem: include "globals.mzn"; int:n=2; var 1..:ArrayLenght; array[1..ArrayLenght,1..2] of var…
-1
votes
1 answer

Minizinc : how to check if a row exists in an 2D array

I have an 2D array like that : array[1..3,1..3] of var 1..3: t; how can I write a constraint to check if there is a table row that matches |1,2,3| (for example) ? I wrote it like that but it doesn't work that return a type error : constraint…
-1
votes
1 answer

why does minizinc python show TypeError: Can't instantiate abstract class Instance with abstract methods

0 Though i've Minizinc installed in my PC! still getting this error: --> 12 instance = Instance(gecode, nqueens) ImportError: cannot import name 'Instance' from 'minizinc' So, i modified the code : from minizinc.instance import Instance But i've…
-1
votes
1 answer

minizinc gramma error can not Dynamic calculation

Anyone can help me to slove this gramma error? I do know how to rewrite this code constraint forall(i in 1..LINENUMBER,j in 1..DAYSETNUMBER ) ( PACKOUTCAP[i,j] -( sum(k in 1..j)(INPUTCAP[i,k] * rate[i,k,j-k+1])) >0 );
jinzhu
  • 15
  • 2
-1
votes
1 answer

Few minizinc questions on constraints

A little bit of background. I'm trying to make a model for clustering a Design Structure Matrix(DSM). I made a draft model and have a couple of questions. Most of them are not directly related to DSM per se. include "globals.mzn"; int: dsmSize =…
Eosfor
  • 81
  • 9
-1
votes
1 answer

Minizinc on node.js with minizinc npm - how to define solution options when not in the CLI?

I am using the following npm package https://www.npmjs.com/package/minizinc but the documentation doesn't state how to enter cli strings/options where model is that might change the functionality instead of only returning the default first solved…
MikeyB
  • 460
  • 1
  • 6
  • 22
-1
votes
2 answers

Defining constraints in MiniZinc

I am new to Constraint programming and to MiniZinc I want to define the constraints for the following problem. Can you help me 3 Arrays F1,F2 and F3 have child elements (F1a,F1b) ; (F2a,F2b,F2c) ; (F3a,F3b,F3c,F3d) respectively. I need to define…
-1
votes
1 answer

Minizinc: declare explicit set in decision variable

I'm trying to implement the 'Sport Scheduling Problem' (with a Round-Robin approach to break symmetries). The actual problem is of no importance. I simply want to declare the value at x[1,1] to be the set {1,2} and base the sets in the same column…
Wouter Vandenputte
  • 1,948
  • 4
  • 26
  • 50
-1
votes
1 answer

Declaring an array of vars with an array of sets

I'm pretty new to minizinc, and this might be a simple question, but I can't find the answer anywhere so I'm resorting to asking here. I have this array: set of int: N=1..n; array[N] of set of int: x_d = [ { j | j in i+1..min(2*i,n-1) } | i in…
Mariana
  • 3
  • 3
-1
votes
1 answer

MiniZinc select a subset of products -problem category

after having watched the coursera Basic Modelling course I am trying to categorize my problem so that to choose the suitable Model representation on MiniZinc. I have a range of 10 products, each of them with its 4 special features/attributes, (a…
user2829319
  • 239
  • 4
  • 16
-1
votes
1 answer

Minizinc - error cannot determine bounds

How i do the code that is in fugure link in Minizinc? A code that take a minimum number I try this: constraint forall(i in nurse, j in patient where j != 1)(start[i] == min((arrive[i,j] + ((1-y[i,1,j])*H) - sum(u in…
-1
votes
1 answer

inner product in minizinc

Ιn two Vectors V1(x11, x12) και V2(x21,x22) we can compute their inner product as V1 • V2.= (x11* x21 + x12 * x22 ). I try to compute minimum inner product as (x1ix2j|i-j|, i.j the places of coordinates at V1, V2. Every cooedinate is used once…
Kotsos
  • 19
  • 5
-1
votes
1 answer

Efficient predicate for palindrome in Minizinc

To help me learning Minizinc, I am trying to solve an easy problem. My code finds an answer but I am surprised that it takes about 10 seconds to run for such an easy problem. The problem is "What is the smallest palindromic integer > 10, so that the…
1 2 3
28
29