[gecode-users] Modelling Conditions on Latin Squares

Christian Schulte cschulte at kth.se
Fri Oct 30 09:06:11 CET 2009


I guess the problem is that element over matrices expects variables as
arguments and not integers. So instead of:
	element(home, mat, mat(i,j), mat(j,i), i)
You have to create an integer variable that is equal to i and use that as
last argument, such as:
	element(home, mat, mat(i,j), mat(j,i), IntVar(home,i,i))

Cheers
Christian

--
Christian Schulte, www.ict.kth.se/~cschulte/

-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Christian Drescher
Sent: Friday, October 30, 2009 4:18 AM
To: users at gecode.org
Subject: [gecode-users] Modelling Conditions on Latin Squares

Dear Subscribers,

I try to model an algebraic problem. In fact, I try to determine the
existence of Latin Squares with certain properties. Hence, my model
contains a Matrix of IntVar:

  Matrix<IntVarArray> mat(l, n, n);

The constraint I want to post is that for all i,j in Q:

  (i*j) * (j*i) == i

or rather

  mat(mat(i,j),mat(j,i)) == i

I tried two different approaches, but gecode's library doesn't support
the following:

  // this doesn't work
  post(home, mat(mat(i,j),mat(j,i)) == i);

  // this neither
  element(home, mat, mat(i,j), mat(j,i), i);

How do I model the constraint correctly?

Best,
Christian


_______________________________________________
Gecode users mailing list
users at gecode.org
https://www.gecode.org/mailman/listinfo/gecode-users





More information about the gecode-users mailing list