Presentation is loading. Please wait.

Presentation is loading. Please wait.

Alan M. Frisch Artificial Intelligence Group Department of Computer Science University of York Extending the Reach of Constraint Technology through Reformulation.

Similar presentations


Presentation on theme: "Alan M. Frisch Artificial Intelligence Group Department of Computer Science University of York Extending the Reach of Constraint Technology through Reformulation."— Presentation transcript:

1 Alan M. Frisch Artificial Intelligence Group Department of Computer Science University of York Extending the Reach of Constraint Technology through Reformulation

2 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation2 Combination of Two Papers Matrix Modelling: Exploiting Common Patterns in Constraint Programming. Pierre Flener, Alan M. Frisch, Brahim Hnich, Zeynep Kiziltan, Ian Miguel, Toby Walsh Towards CSP Model Reformulation at Multiple Levels of Abstraction. Alan M. Frisch, Brahim Hnich, Ian Miguel, Barbara Smith, Toby Walsh

3 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation3 Formulation Bottleneck Useful for solving a wide range of important, complex problems including scheduling, allocation, layout. Modelling a problem as a constraint program requires moderate/great expertise. Hence constraint technology is used almost exclusively by large enterprises on problems with large payoff.

4 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation4 Reducing the Formulation Bottleneck Systematise the knowledge of the expert. –Can recognise patterns in problems and match them to patterns of problem formulations. –Can choose among alternatives. Embed this knowledge in a “compiler” that can reformulate a high-level problem specification into a set of constraints that can be executed efficiently.

5 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation5 Matrix Models A problem formulation involving one or more (multi-dimensional) matrices of decision variables. Often has row and column symmetry. 0 vs 72 vs 72 vs 60 vs 41 vs 63 vs 54 vs 5Period 3 0 vs 5 1 vs 4 3 vs 7 Week 5 3 vs 4 0 vs 6 1 vs 5 Week 6 1 vs 31 vs 22 vs 54 vs 66 vs 7Period 4 5 vs 65 vs 70 vs 31 vs 72 vs 3Period 2 2 vs 43 vs 64 vs 70 vs 20 vs 1Period 1 Week 7Week 4Week 3Week 2Week 1 Round Robin Tournament Schedule

6 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation6 Matrix Models are Prevalent Commonly used to implement sets, subsets, partitions, relations, functions, permutations… Of 31 problems in CSPlib (www.csplib.org), 27 have natural matrix models, most already published and arguably the most natural models. Many have row and column symmetries.

7 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation7 Overview I Transforming a CSP instance. II Refining a problem formulation. III Matrix Models – Symmetry breaking & channelling IV Conclusions

8 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation8 Part I: Transforming a CSP Instance

9 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation9 CGRASS A system that automatically transforms a CSP instance to one that can be solved more efficiently Transformations: –Introduce implied constraints. –Replace constraints with more powerful ones. –Remove redundant constraints. –Introduce new variables. –Introduce symmetry-breaking constraints.

10 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation10 Performance of CGRASS Given the naïve model of an instance of the Golomb Ruler Problem, CGRASS can automatically transform it to an efficient CSP formulation (roughly that of Smith, Stergiou & Walsh, 1999). As Golomb Ruler instances grow in size the time it takes CGRASS to transform the instance grows rapidly.

11 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation11 What Else? Transform problems, not problem instances However, transforming the Golomb Ruler problem (formulated as a CSP) requires sophisticated mathematical reasoning. But transforming an abstract, set-based formulation (sets, subsets, cardinality…) of the Golomb ruler problem is much simpler !

12 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation12 The Moral of the Story Transformations must be made at the appropriate level of abstraction. (Some may be best at level of CSP instances.) Refinement rules as well as transformation rules are needed.

13 Part II: Refining a Problem Formulation

14 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation14 Two Steps to Automatic Refinement F Competency: Formulate formal rules for generating alternative refinements. The goal is to generate a set of models that include those generated by experts (perhaps some that are better!). Following on from F [Hnich, forthcoming]. Performance: Generate only the good ones.

15 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation15 SONET Fibre-Optic Communications Problem In a communications network there are client nodes and it is known which pairs of nodes must communicate. Traffic can only be routed between pairs of distinct nodes if they are installed on the same SONET ring. Each node may be installed on multiple rings with each installation requiring a dedicated ADM. There are a fixed number of rings available, and each can service a maximum number of ADMs. Configure the network so as to minimize the number of ADMs used.

16 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation16 An Instance of the SONET Problem Three rings and five nodes (n1, n2, n3, n4, n5) Communication between n1 & n3, n1 & n4, n2 & n3, n2 & n4, n3 & n5 Each ring holds maximum of four nodes. n2 n1 n3 n4 n3 n5

17 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation17 Abstract Mathematical Formulation Given: c: ring capacity, R: set of rings, N: set of nodes, D: set of unordered pairs of nodes that communicate Find: rings-nodes: R  N Such that: 1)| rings-nodes| is minimised 2)|rings-nodes(r,_)|  c, for all r in R 3)rings-nodes(_,n)  rings-nodes(_,n)   for all {n,n’} in D

18 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation18 Refinement: Alternative 1 0..1 Nodes Rings rings-nodes  r,n   rings-nodes iff rings-nodes[r,n] = 1

19 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation19 Refinement: Alternative 1 1.| rings-nodes| is minimised Minimise(  r  R, n  N rings-nodes[r,n] ) 2.|rings-nodes(r,_)|  c, for all r  R (  n  N rings-nodes[r,n])  c, for all r  R 3.(rings-nodes(_,n)  rings-nodes(_,n)   for all {n,n}  D  r  R (rings-nodes[r,n]  rings-nodes[r,n])  0 for all {n,n,}  D

20 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation20 Refinement Creates Symmetry R and N are sets. They are refined to indices of a matrix, which are totally ordered. Unless some constraint differentiates the elements of a set, our refinement has distinguished indistinguishable objects; it has introduced symmetry.

21 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation21 Refinement Should Break Symmetry Elements of R are indistinguishable. n1 and n2 are indistinguishable. Other elements of N are distinguished by D. In rings-nodes, two rows are indistinguishable and all columns are indistinguishable. Need to break row and column symmetries.

22 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation22 Refinement: Alternative 2 Set of nodes NodesOnRing Rings  r,n   rings-nodes iff N  NodesOnRing[r]

23 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation23 Refinement: Alternative 2 Constraints (1) and (3) can be translated to this representation. Constraint (2) cannot be expressed directly with this representation. So use 2D matrix from first alternative and channel.

24 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation24 Summary of SONET Reformulation Refinement paper presents five different refinements, including that of Smith [ ERCIM 2002]. All produced somewhat systematically by hand. The first uses a single representation, others channel among two or three representations. Three complex implied constraints have been added to the abstract formulation and have been refined to each concrete formulation.

25 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation25 Refinement Rules 3.rings-nodes(_,n)  rings-nodes(_,n)   for all {n,n}  D  r  R (rings-nodes[r,n]  rings-nodes[r,n])  0 for all {n,n}  D

26 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation26 Refinement Rules Atomic :  (R) = i 1, …, i n . R m [i 1, …, i n ] Intersect :  (   ’   i 1, …, i n .  (  i 1, …, i n  )  (  ’  i 1, …, i n  Cardinality :  (|   i 1, …, i n   X 1  …  X n  (  i 1, …, i n 

27 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation27 Example of Refinement Refine |A  B|, where A, B are relations over X 1  X 2.  ( |   |  Apply cardinality rule    i 1, i 2   X 1  X 2  (   i 1, i 2  Apply intersect rule and lambda reduction    i 1, i 2   X 1  X 2  (  i 1, i 2  (  i 1, i 2  Apply atomic rule and lambda reduction    i 1, i 2   X 1  X 2 A m [i 1, i 2 ]  B m [i 1, i 2 ]

28 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation28 Automatic Generation of Channelling Constraints  r,n  in rings-nodes iff rings-nodes[r,n] = 1  r,n  in rings-nodes iff n  NodesOnRing[r] rings-nodes[r,n] = 1 iff n  NodesOnRing[r]

29 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation29 Part III: Matrix Models -- Symmetry Breaking and Channelling

30 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation30 Index Symmetry in One Dimension Indistinguishable Rows ABC DEF GHI [A B C]  lex [D E F]  lex [G H I]

31 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation31 Index Symmetry in Multiple Dimensions Remove row and column symmetry by adding constraints that rows and cols are lex ordered. Are these always consistent? (yes) Does this remove all symmetry? (only sometimes) Breaking Row and Column Symmetries in Matrix Models P. Flener, A.M. Frisch, B. Hnich, Z. Kiziltan, I. Miguel, J. Pearson, T. Walsh

32 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation32 Enforcing Lex Ordering Constraint How efficiently can one maintain GAC on a lex ordering constraint? (linear in size of vectors) Global Constraints for Lexicographic Orderings A.M. Frisch, B. Hnich, Z. Kiziltan, I. Miguel, T. Walsh

33 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation33 Channelling Many matrix models involve channelling Matrix paper identifies four types of channelling between matrices and discusses efficient implementation.

34 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation34 Part IV: Conclusion

35 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation35 Hypothesis It is possible to build a compiler that can take a problem specified in an abstract, high-level language and refine and transform it into a constraint program that can be efficiently executed.

36 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation36 Evidence in Support of Hypothesis CGRASS can take a CSP instance and perform certain simple transformations to make it easier to solve. Our formal rules for refining an abstractly-specified problem into an executable specification. Hnich’s compiler refines function variables. The executable specifications that are generated often contain matrices of decision variables. We are developing new technology for solving such matrix models (symmetry breaking, channelling and other patterns).

37 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation37 Hypotheses Without reasoning at a high level of abstraction, automatically transforming a constraint program to an efficient one is unreasonably difficult.

38 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation38 Evidence in Support of Hypotheses We have observed that the complexity of a transformation varies greatly with the level of abstraction of a problem specification.

39 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation39 Major Open Questions Can complex transformations that increase efficiency be automated? Can the choice among alternative refinements be automated? If we succeed in building such a compiler would the reach of constraint programming be extended?

40 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation40 The End

41 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation41 Exploiting Common Patterns Published in journals with analyses of properties. Catalogued in textbooks with guidance on selection. Implemented in program libraries. Supported by high-level languages. Exploited by intelligent compilers. This would bring constraint technology to BSc’s.

42 CP'2002: 8 Sept 2002Extending the Reach of Constraint Technology through Reformulation42 Example of Refinement Refine |A  B|, where A, B are relations over X 1  X 2.  ( |   |     i 1, i 2   X 1  X 2  (   i 1, i 2     i 1, i 2   X 1  X 2  i 1, i 2 .(  (  i 1, i 2  (  i 1, i 2  i 1, i 2     i 1, i 2   X 1  X 2  (  i 1, i 2  (  i 1, i 2     i 1, i 2   X 1  X 2 i 1, i 2 .(A m [i 1, i 2 ]) (  i 1, i 2  )  i 1, i 2 .(B m [i 1, i 2 ]) (  i 1, i 2  )    i 1, i 2   X 1  X 2 A m [i 1, i 2 ]  B m [i 1, i 2 ]


Download ppt "Alan M. Frisch Artificial Intelligence Group Department of Computer Science University of York Extending the Reach of Constraint Technology through Reformulation."

Similar presentations


Ads by Google