-- Sep 27 In-Class Exercise
Student: Phyllis Lau
Variables: 16 squares where X(0,0), X(0,1), X(1,0), X(1,1)…X(3,3)
Where (rows, columns)
Domain: For each variable, they have the same domain of {1, 2, 3, 4}
Constraints:
ALLDIFF(X(0,0), X(0,1), X(0,2), X(0,3))
ALLDIFF(X(1,0), X(1,1), X(1,2), X(1,3))
ALLDIFF(X(2,0), X(2,1), X(2,2), X(2,3))
ALLDIFF(X(3,0), X(3,1), X(3,2), X(3,3))
ALLDIFF(X(0,0), X(1,0), X(2,0), X(3,0))
ALLDIFF(X(0,1), X(1,1), X(2,1), X(3,1))
ALLDIFF(X(0,2), X(1,2), X(2,2), X(3,2))
ALLDIFF(X(0,3), X(1,3), X(2,3), X(3,3))
(
Edited: 2017-09-27)
Student: Phyllis Lau
Variables: 16 squares where X(0,0), X(0,1), X(1,0), X(1,1)…X(3,3)
Where (rows, columns)
Domain: For each variable, they have the same domain of {1, 2, 3, 4}
Constraints:
ALLDIFF(X(0,0), X(0,1), X(0,2), X(0,3))
ALLDIFF(X(1,0), X(1,1), X(1,2), X(1,3))
ALLDIFF(X(2,0), X(2,1), X(2,2), X(2,3))
ALLDIFF(X(3,0), X(3,1), X(3,2), X(3,3))
ALLDIFF(X(0,0), X(1,0), X(2,0), X(3,0))
ALLDIFF(X(0,1), X(1,1), X(2,1), X(3,1))
ALLDIFF(X(0,2), X(1,2), X(2,2), X(3,2))
ALLDIFF(X(0,3), X(1,3), X(2,3), X(3,3))