Searching for Doubly Self Searching for Doubly Self- Orthogonal Latin Squares Orthogonal Latin Squares Runming Lu Sheng Liu g Jian Zhang
Outline • Introduction (Latin square problems DSOLS) • Introduction (Latin square problems, DSOLS) • Approaches based on SAT and CSP • A new approach based on set systems • Experimental results • Experimental results • Conclusion
Introduction • Latin squares (Quasigroups) 1 2 3 3 1 2 2 3 1 • Challenging problems in mathematics (simple to describe difficult to solve) describe, difficult to solve) – Counting problem – Existence of Latin squares with certain properties Mutually orthogonal Latin squares (MOLS) u u y o ogo squ es ( O S)
Latin Square problems and Constraint Solving • Computer-aided research in combinatorics – existence of small Latin squares – crucial ! i f ll L i i l ! • Clement Lam and other mathematicians • AI researchers (using CSP / SAT tech.) – Jian Zhang (1990/1991) Ji Zh (1990/1991) – M. Fujita, J. Slaney, M. Stickel (IJCAI-1993, 1995) – Hantao Zhang, W. McCune , … – C Gomes C. Gomes, … – O. Dubois and G. Dequen (CP-2001)
Definition of DSOLS A A pair of latin squares i f l ti A=(a ij ) and B=(b ij ) are j j orthogonal ( A ┴ B ) iff ┴ the ordered pairs (a ij ,b ij ) p ( ij ) ij are distinct for all i and j DSOLS : a Latin square A which is orthogonal to g A ┴ A T A ┴ A T A ┴ A * A ┴ A both its transpose to the pairs (a ij ,a t ij ) are diagonal A T and its diagonal A and its (0,0) (2,3) (3,1) (1,2) (0,0) (2,3) (3,1) (1,2) (3,2) (1,1) (0,3) (2,0) transpose to the back (1,3) (3,0) (2,2) (0,1) diagonal A � (2,1) (0,2) (1,0) (3,3) ( , ) ( , ) ( , ) ( , ) diagonal A
First Order Logic Formulas of DSOLS g Latin Square Constraints: Latin Square Constraints: A(x,y) = A(x,z) → y = z A(x y) = A(z y) → x = z A(x,y) = A(z,y) → x = z A ┴ A T : A A : A(x 1 ,y 1 )=A(x 2 ,y 2 ) ∧ A(y 1 ,x 1 )=A(y 2 ,x 2 ) → x 1 =x 2 ∧ y 1 =y 2 A ┴ A * : A(x 1 ,y 1 )=A(x 2 ,y 2 ) ∧ A(n − 1 − y 1 ,n − 1 − x 1 )=A(n − 1 − y 2 ,n − 1 − x 2 ) → x 1 =x 2 ∧ y 1 =y 2
Finding DSOLS as SAT g Introduce n 3 boolean variables V ijk (i,j,k ∈ [0, n-1] ) V ijk = 1 iff A(i,j) = k ( ,j) ijk V ijk = 0 iff A(i,j) ≠ k Encode the DSOLS constraints into SAT clauses directly: O(n 6 ) clauses // but there are other kinds of encodings (Hantao Zhang)
Finding DSOLS as Classical CSP g classical CSP search framework Arc-consistency Li ht Light-weight implementation i ht i l t ti
A New Approach pp Cluster the cells which are possibly p y assigned the same value into a set S i Admissible Set: • The elements of S i are cells of the Th l t f S ll f th n × n table and |S i |=n • No two elements are in the same row or column: � (x 1 ,y 1 ),(x 2 ,y 2 ) ∈ Si, if (x 1 ,y 1 ) ≠ (x 2 ,y 2 ), then x 1 ≠ x 2 and y 1 ≠ y ≠ y 2 If (x,y) ∈ S i and (x,y) ≠ (x,y) T then • (x,y) T NOT IN S i If (x,y) ∈ S i and (x,y) ≠ (x,y) * then • (x,y) * NOT IN S i
If the cells in the same admissible set are assigned the same value, can the assignments in two sets be combined together without violating the constraints of DSOLS? DSOLS? S i and its compatible sets Compatible sets: Compatible sets: Admissible sets Si and Sj, i ≠ j are compatible iff compatible iff • S i ∩ S j = T | = 1 • | S i ∩ S j | S i ∩ S j | 1 � | = 1 • | S i ∩ S j
Choose n sets to construct a whole n × n table There exists a solution to DSOLS(n) iff there is a collection of n admissible sets each pair of which are compatible The cells in the same set are assigned the same value assigned the same value. The cells in different sets are assigned different values assigned different values.
Finding a clique in a graph • Constructing a graph: – admissible sets as vertices admissible sets as vertices – Two sets are compatible – There is an edge connecting them connecting them. • Finding a clique in the graph � too e pensi e � too expensive
Enumerate all admissible sets(less than n!). Backtrack Search : 1. Select a set from the candidate admissible sets; 2. Remove all sets not compatible to it from the candidate sets; 3. Combine this set with the sets selected in the previous search step to construct a partial solution; h t t t t ti l l ti 4. If a complete solution is found, stop; 5 If no candidate set remains Backtrack; 5. If no candidate set remains, Backtrack; 6. Repeat the above steps.
The constraints of compatible sets are very strong. The number of candidate admissible sets (compatible to the selected sets) drops dramatically with the search levels moving down .
Tools and Experiments p We developed a DSOLS generator named DSOLver and compared it to the famous SAT solver Minisat and a light- p g weight CSP solver written by ourselves.
These two tables show that DSOLver is quite efficient w r t These two tables show that DSOLver is quite efficient w.r.t. both CPU time and branching numbers. With the help of DSOLver, we were able to examine the whole search space of DSOLS(10) within one day and whole search space of DSOLS(10) within one day and proved the non-existence of DSOLS(10) which was an open case. p http://lcs.ios.ac.cn/~zj/dsolver_2010.zip � dsolver.cpp � DSOLS-SAT.cpp � d � dsols-csp.cpp l � dsols-checker.cpp
Conclusion Conclusion � Presented an approach and a tool for finding DSOLS � Presented an approach and a tool for finding DSOLS � Solved an open case: non-existence of DSOLS(10) � Solved an open case: non existence of DSOLS(10). � Other cases remain open: DSOLS(14), … p ( ), � Challenging benchmarks for constraint solving � Improvements to SAT and CSP approaches
Thank you! Thank you!
Recommend
More recommend