850 likes | 986 Views
Global Constraints for Lexicographic Orderings. Alan Frisch, Ian Miguel (University of York) Brahim Hnich, Toby Walsh (4C) Zeynep Kiziltan (Uppsala University). GACLex. A new family of global constraints. GACLex. A new family of global constraints.
E N D
Global Constraints for Lexicographic Orderings Alan Frisch, Ian Miguel (University of York) Brahim Hnich, Toby Walsh (4C) Zeynep Kiziltan (Uppsala University)
GACLex • A new family of global constraints.
GACLex • A new family of global constraints. Non-binary constraint. Specialised propagator.
GACLex • A new family of global constraints. Non-binary constraint. Specialised propagator. GACLex maintains Generalised Arc Consistency: Given an assignment to any constrained variable, we can find consistent assignments for the remainder.
GACLex • A new family of global constraints. • Linear time complexity.
GACLex • A new family of global constraints. • Linear time complexity. • Ensures that a pair of vectors of variables are lexicographically ordered.
GACLex • A new family of global constraint. • Linear time complexity. • Ensures that a pair of vectors of variables are lexicographically ordered. lex
Motivation • Many problems can be modelled by matrices of decision variables.
Motivation • Many problems can be modelled by matrices of decision variables. • E.g. Combinatorial Problems • Balanced Incomplete Block Design.
Motivation • Many problems can be modelled by matrices of decision variables. • E.g. Configuration Problems: • Rack Configuration.
Motivation • Many problems can be modelled by matrices of decision variables. • E.g. Scheduling Problems: • Social Golfers.
Motivation • Many problems can be modelled by matrices of decision variables. • E.g. Design Problems: • Steel Mill Slab Design.
Motivation • Many problems can be modelled by matrices of decision variables. • Frequently these matrices exhibit row and/or column symmetry.
Motivation • Many problems can be modelled by matrices of decision variables. • Frequently these matrices exhibit row and/or column symmetry. • We can permute the rows/columns in any (non)solution to obtain another (non)solution.
Motivation • Many problems can be modelled by matrices of decision variables. • Frequently these matrices exhibit row and/or column symmetry. • We can permute the rows/columns in any (non)solution to obtain another (non)solution. • It can be very expensive to search fruitless symmetric branches of the search tree.
Motivation • Many problems can be modelled by matrices of decision variables. • Frequently these matrices exhibit row and/or column symmetry. • Lexicographic ordering is an effective way to break a lot of this symmetry.
Example • Consider 2 identical bins: A B
Example • Consider 2 identical bins: A B • We must pack 6 items: 1 2 3 4 5 6
Example • Here is one solution: 5 6 3 4 1 2 A B
Example • Here is another: 6 5 4 3 2 1 A B
Example • Is there any fundamental difference? 5 6 a) 3 4 1 2 A B 6 5 b) 4 3 2 1 A B
Example • Consider a matrix model: 5 6 a) 3 4 1 2 A B 6 5 b) 4 3 2 1 A B
Example NB: ‘1’ means place this item in this bin: • Consider a matrix model: 5 6 a) 3 4 1 2 A B 6 5 b) 4 3 2 1 A B
If we insist that row A lex row B, we remove a) from the solution set. Example • Consider a matrix model: 6 5 b) 4 3 2 1 A B
Example • Notice that items 3 and 4 are identical. 6 5 b) 4 3 2 1 A B 6 5 c) 3 4 2 1 A B
If we insist that col 3 lex col 4, we remove c) from the solution set. Example • Notice that items 3 and 4 are identical. 6 5 b) 4 3 2 1 A B
How GACLex Works • Consider the following example. • We have two vectors of decision variables:
How GACLex Works • Consider the following example. • We have two vectors of decision variables:
How GACLex Works • Consider the following example. • We have two vectors of decision variables: • We want to enforce GAC on: xlexy.
A Tale of Two Pointers • We use two pointers, α and β, to avoid repeatedly traversing the vectors.
A Tale of Two Pointers • We use two pointers, α and β, to avoid repeatedly traversing the vectors. • We index the vectors as follows:
Most Significant Index A Tale of Two Pointers • We use two pointers, α and β, to avoid repeatedly traversing the vectors. • We index the vectors as follows:
A Tale of Two Pointers • We use two pointers, α and β, to avoid repeatedly traversing the vectors. • α: index such that all variables at more significant indices are ground and equal.
A Tale of Two Pointers • We use two pointers, α and β, to avoid repeatedly traversing the vectors. • α: index such that all variables at more significant indices are ground and equal. • β: most significant index from which the two vectors’ tails necessarily violate the constraint.
A Tale of Two Pointers • We use two pointers, α and β, to avoid repeatedly traversing the vectors. • α: index such that all variables at more significant indices are ground and equal. • β: If tails never violate the constraint:
Pointer Initialisation • Needs one traversal of the vectors (linear). • Details in the paper. • α: index such that all variables at more significant indices are ground and equal. • β: most significant index from which the two vectors’ tails necessarily violate the constraint.
Pointer Initialisation • Needs one traversal of the vectors (linear). α • α: index such that all variables at more significant indices are ground and equal. • β: most significant index from which the two vectors’ tails necessarily violate the constraint.
Pointer Initialisation • Needs one traversal of the vectors (linear). α β • α: index such that all variables at more significant indices are ground and equal. • β: most significant index from which the two vectors’ tails necessarily violate the constraint.
Failure • Inconsistent if βα. • α: index such that all variables at more significant indices are ground and equal. • β: most significant index from which the two vectors’ tails necessarily violate the constraint.
How GACLex Works • We maintain α and β as assignments made. • α: index such that all variables at more significant indices are ground and equal. • β: most significant index from which the two vectors’ tails necessarily violate the constraint.
How GACLex Works • We maintain α and β as assignments made. • When β = α + 1 we enforce bounds consistency on: xα < yα • α: index such that all variables at more significant indices are ground and equal. • β: most significant index from which the two vectors’ tails necessarily violate the constraint.
The variable at the αth element of each vector. How GACLex Works • We maintain α and β as assignments made. • When β = α + 1 we enforce bounds consistency on: xα < yα • α: index such that all variables at more significant indices are ground and equal. • β: most significant index from which the two vectors’ tails necessarily violate the constraint.
How GACLex Works • We maintain α and β as assignments made. • When β = α + 1 we enforce bounds consistency on: xα < yα • When β > α + 1 we enforce bounds consistency on: xαyα • α: index such that all variables at more significant indices are ground and equal. • β: most significant index from which the two vectors’ tails necessarily violate the constraint.
How GACLex Works • We maintain α and β as assignments made. • Key: we reduce GAC on vectors to BC on binary constraints. • α: index such that all variables at more significant indices are ground and equal. • β: most significant index from which the two vectors’ tails necessarily violate the constraint.
How GACLex Works • 0, 1 removed from yα. α β • α: index such that all variables at more significant indices are ground and equal. • β: most significant index from which the two vectors’ tails necessarily violate the constraint.
How GACLex Works • 0, 1 removed from yα. α β • α: index such that all variables at more significant indices are ground and equal. • β: most significant index from which the two vectors’ tails necessarily violate the constraint.
How GACLex Works • Update α. α β • α: index such that all variables at more significant indices are ground and equal. • β: most significant index from which the two vectors’ tails necessarily violate the constraint.
How GACLex Works • Update α. α β • α: index such that all variables at more significant indices are ground and equal. • β: most significant index from which the two vectors’ tails necessarily violate the constraint.
How GACLex Works • 3, 4 removed from xα. α β • α: index such that all variables at more significant indices are ground and equal. • β: most significant index from which the two vectors’ tails necessarily violate the constraint.
How GACLex Works • 3, 4 removed from xα. α β • α: index such that all variables at more significant indices are ground and equal. • β: most significant index from which the two vectors’ tails necessarily violate the constraint.