Originally posted by: gxkendall
Hi
I am trying to develop my first CPLEX model in Java (so I apologise if this is an easy question).
I am declaring a decision variable as follows (n is declared (n=20)).
IloIntVar[] x = cplex.intVarArray(n, 1, n);
So, I am trying to declare an array of 20 integers, where each elemnet can take a value between 1 and 20.
BUT, each integer can only appear once so (I think) I need to specify an allDifferent constraint, but no amount of searching shows me how to do this.
Is it possible, or am I gettng LP/MIP etc. confused with Constraint Programming and it is not possible?
Thanks in advance.
G
#CPLEXOptimizers#DecisionOptimization