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..n:X;
constraint forall(i,j in 1..n)(exists(r in 1..ArrayLenght) (X[r,..] == [i,j]));
solve minimize ArrayLenght;
but i have a type error type error: type-inst must be par set but is 'var set of int'
on this line array[1..ArrayLenght,1..2] of var 1..size:X
So how i can do to have an array with a variabe size ? (i don't see anything about this in the official documentation)
NB : for this specific example, it would be better to set the arrayLenght to n*n but it's a minimal example, I have to add constraints that make the size of array cannot be fixed.