Weitere Kapitel dieses Buchs durch Wischen aufrufen
This chapter describes more advanced techniques of constraint modeling in Picat, as well as some tips about performance and debugging. The Langford number problem shows the use of the global constraint element and the concepts of reversibility and symmetry breaking. Reification, or reasoning about constraints, is exemplified with a decomposition of all_different_except_0, as well as the Who Killed Agatha problem. A separate section describes the importance of declaring domains to be as small as possible (but not smaller). This is followed by a section about search strategies, in which the magic squares problem is used for systematically testing many search strategies. The cumulative constraint is used for scheduling furniture moving, including precedences. Then, the magic sequences problem shows how to use the global constraint global_cardinality, and explains that the order of constraints in a model might matter. The circuit constraint is used for modeling the knight’s tour problem. The regular constraint, defined by a Deterministic Finite Automaton, is used in two models, first for a decomposition of the global_contiguity constraint, and then for modeling a nurse rostering problem. This is followed by an alternative approach of the nurse rostering problem that uses the table_in constraint. The chapter ends with some general tips about how to debug constraint models, when the models don’t give a solution, or when the solution is not correct.
Bitte loggen Sie sich ein, um Zugang zu diesem Inhalt zu erhalten
Sie möchten Zugang zu diesem Inhalt erhalten? Dann informieren Sie sich jetzt über unsere Produkte:
Taken with permission from http://www.csplib.org/Problems/prob024/.
This section only applies to the cp module. The sat module ignores the search strategies.
This example was inspired by the nurse rostering example in the MiniZinc Tutorial.
- Advanced Constraint Modeling
- Chapter 3
Neuer Inhalt/© ITandMEDIA