[gecode-users] flow constraint
Javier Núñez
jnunezf at gmail.com
Wed May 14 03:10:27 CEST 2008
Hello for all,
I need make this flow constraint for a routing problem:
(in latex): \sum_j x_{ ij } = \sum_j x_{ ji }
(in ampl): sum {j in J} x[i,j] - sum {j in J} x[j,i] = 0
(where x[i,j] is a binary variable, for all i in I and j in J.). I
tried to do this constraint in gecodej (in java), but is incorrect:
[...]
x = new VarMatrix<IntVar>(this, n, n, IntVar.class, 0, 1);
for (int i=0; i<n; i++) {
linear(this, x.row(i) - x.col(i) , IRT_EQ, 0);
}
[...]
Error: "operator: cannot be applied to VarArray<IntVar>, VarArray<IntVar>"
How I can implement this constraint in gecode/gecodej? There are
gecode examples for vehicle routing problem?
Thank you.
More information about the gecode-users
mailing list