310 likes | 438 Views
Symmetry Breaking Ordering Constraints. Zeynep Kiziltan Department of Information Science Uppsala University, Sweden http://www.dis.uu.se/~zeykiz A progress report on work in collaboration with Alan Frisch, Brahim Hnich, Chris Jefferson, Ian Miguel, Toby Walsh. Motivations (1).
E N D
Symmetry Breaking Ordering Constraints Zeynep Kiziltan Department of Information Science Uppsala University, Sweden http://www.dis.uu.se/~zeykiz A progress report on work in collaboration with Alan Frisch, Brahim Hnich, Chris Jefferson, Ian Miguel, Toby Walsh
Motivations (1) • An important class of symmetries in CP • matrices of decision variables • rows/columns represent indistinguishable objects, hence symmetric • Rows and columns are subject to permutation • An nXm matrix model with row and column symmetry has n! Xm! symmetries • grows super-exponentially • Too many symmetric search states • It can be very expensive to visit all the symmetric branches of a search tree
Motivations (2) • Breaking symmetry is very important! • Breaking all row and column symmetries is difficult • No one has an effective way of dealing with all row and column symmetries. • Symmetry breaking methods have to deal with very large number of symmetries. • The effort required could easily be exponential.
Aims • Main Goal • Eliminate row and column symmetries effectively and efficiently. • Aims: • Investigate types of ordering constraints to break row and column symmetries. • Devise global constraints to easily pose and efficiently solve the ordering constraints. • Examine the effectiveness of the ordering constraint.
Disvantages of the Ordering Constraints • May conflict with the search strategy • Increase in the size of the search tree • May already be implied during search • No change in the size of the search tree • Theory may not meet practise • Theory: posing lex ordering on the rows breaks row symmetry • Practise: posing lex ordering on the rows creates a search tree bigger than or equal to no symmetry breaking
Advantages of the Ordering Constraints • Given a ”good” search strategy, many symmetries are eliminated effectively and efficiently. • The effort for breaking symmetry is polynomial • posing • solving • Significant reductions in the size of the search tree • Very practical for large matrices
Outline of Rest of Talk Ordering Constraints Lexicographic Ordering Lexicographic Ordering Combined with Sum Constraints Multiset Ordering Permutation Ordering Future Work
Lexicographic Ordering • Used to order dictionaries [A,B,C] ≤ lex [D,E,F] • A<D or • (A=D and B<E ) or • (A=D and B=E and C<F) or • (A=D and B=E and C=F)
Breaking Row (Column) Symmetry • Lexicographic ordering is total. • Enforcing the rows to be lexicographically ordered breaks all row symmetry. • anti-lexicographic ordering • lexicographic ordering • [A B C] lex [D E F] lex [G H I] • [G H I] lex [D E F] lex [A B C]
Breaking Row and Column Symmetries • Each symmetry class of assignments has at least one element where both the rows and the columns are lexicographically ordered • But there may be no element with rows lex ordered and columns anti-lex ordered • To break row and column symmetries, we can insist that the rows and columns are both lexicographically ordered (double-lex) • Double-lex breaks some but not necessarily all row and column symmetries
Lexicographic Ordering for a Pair of Vectors (1) • Given A=[a1,...,an] B=[b1,...,bn] taking values from {1,...d} A≤lexB↔ (dn-1a1+ ... + d0an) ≤ (dn-1b1+ ... + d0bn) • BC(≤) ↔ GAC(≤lex) • Feasible for small n
Many solvers use FC =\ GAC GAC schema is expensive Lexicographic Ordering for a Pair of Vectors (2) • Or decomposition A≤lexB↔ (a1 < b1) Or (a1 = b1 And a2 < b2 ) ... (a1 = b1 And a2 = b2 ... an ≤ bn) • And decomposition A≤lexB↔ (a1 ≤ b1) And (a1 = b1 -> a2 ≤ b2 ) ... (a1 = b1 And a2 = b2 ... -> an ≤ bn)
Global Constraints for Lexicographic Orderings • Design of global constraints for lexicographic orderings • ≤lex • <lex • Consistency: GAC • Complexity • Worst case: O(n) Amortised:0(1) • Shared Variables • Inferior to decompisitons and arithmetic constraint
∑=S1 ∑=S2 ≤lex ∑=S3 ∑=S4 Lexicographic Ordering with Sum Constraints • Quite often we have a 0/1 matrix to model a collection of sets of fixed cardinality • row (column) symmetry • sum constraints on the rows (columns) • BIBDs, Steiner Systems, Rack Design, Steel Mill Design, ... • LexAndSum for a pair of vectors
Global Constraints for LexAndSum Orderings • Design of global constraints for LexAndSum orderings • ≤LexAndSum • <LexAndSum • 0/1 variables • Sums are non-ground • Consistency: GAC • Complexity • O(n)
Rows as Multisets • A multiset is a set with repetitions • M = {{0, 1, 1, 2, 2, 3}} • Treat each row as a multiset • anti-multiset ordering • multiset ordering • [A B C] m [D E F] m [G H I] • [G H I] m [D E F] m [A B C]
Multiset Ordering • Equal sized multisets • M <m N iff • x=max(M), y=max(N) • x<y OR (x=y AND M-{{x}} <m N-{{y}} ) R1=[1,2,3,2,3,1,1,2] R2=[1,1,3,1,3,1,1,3] R1<m R2
Breaking Row (Column) Symmetry • Multiset ordering is partial. • Enforcing multiset ordering on the rows breaks some but not necessarily all row (column) symmetry
Breaking Row and Column Symmetries • Multiset ordering the rows is invariant to column permutation. • To break row and column symmetries, we can insist that the rows and columns are both multiset ordered (double-multiset) • Double-multiset breaks some but not necessarily all row and column symmetries
Lex +multiset lex M1 M2 M1≤m M2≤mM3≤m M4 ≤m M3 M4 M4
Comparison: Lex vs Multiset • Lexicograhic ordering vs multiset ordering • incomparable • double-lex vs double-multiset • incomparable • double-lex vs lex+multiset • incomparable
Multiset Ordering for a Pair of Vectors (1) • Given A=[a1,...,an] B=[b1,...,bn] A≤mB↔ (na1+ ... + nan ) ≤ (nb1+ ... + nbn ) • BC(≤) ↔ GAC(≤m) • Feasible for small n
Multiset Ordering for a Pair of Vectors (2) • Given A=[a1,...,an] B=[b1,...,bn] taking values from {1,...d} • Construct occurrence vectors via Regin’s gcc M=[m1,...,md] N=[n1,...,nd] where mi=occurrences(i,A) and ni=occurrences(i,B) • A≤mB↔M≤lex N • GAC(≤m)→ GAC(gcc) /\ GAC(≤lex)
Global Constraints for Multiset Orderings • Design of global constraints for multiset orderings • ≤m • <m • Consistency: GAC • Complexity • O(n) for m<n • O(nlogn) for m>>n • Shared Variables
Permutation Ordering • Given A=[a1,...,an] B=[b1,...,bn] A≤permB↔ A ≤lexB1And A ≤lexB2And ... A ≤lexBn! B1...Bn!are permutations of B
Breaking Row and Column Symmetries • Permutation ordering is neither total nor partial • not reflexive • anti-symmetric • transitive • rowi≤perm rowjfor all i<j • may eliminate solutions • row1≤perm rowifor all i>1 (first-row perm) • does not eliminate solutions • breaks some but not necessarily all row and column symmetries • first-row perm + first-column perm • may eliminate solutions
Comparisons • Permutation ordering > lexicographic ordering • first-row perm vs double-lex • incomparable • First-row perm vs double-multiset • incomparable
Breaking More Row and Column Symmetries • double-lex + first-row perm • double-lex + row1≤perm rowifor all i>1 • does not eliminate solutions • breaks more symmetry than either of them • does not break all symmetries
How to pose Permutation Ordering? • Design of a global constraint for permutation ordering • ≤perm • <perm • Consistency: GAC • Complexity: • O(nlogn) • Question: Can the 0(nlogn) multiset ordering algorithm easily be modified to obtain permutation ordering? • No!
M1 lex M2 M1=M2 Future Work • Multiset and lex when equal • LexAndLambda A ≤lex B ∑ (Ai=Bi)=k
Future Work write my thesis!