Solving Hierarchies of Finite-Domain Constraints1 2

2 downloads 0 Views 264KB Size Report
These systems of algebraic equalities and inequalities over ..... sets. To manage these cases we decided to represent the solution sets implicitly as finite ...
Solving Hierarchies of Finite-Domain Constraints1 2 Armin Wolf GMD { German National Research Center for Information Technology GMD FIRST, Rudower Chaussee 5, D-12489 Berlin, Germany Phone: +49 30 63 92-18 64 Fax: +49 30 63 92-18 05 e-mail: www:

1

http://www.first.gmd.de

The research in this paper is a result of the projects WISPRO and VERMEIL

funded by the

nology 2

[email protected]

German Federal Ministry for Education, Science, Research, and Tech-

(BMBF) under grant no. 01 IW 206 and no. 01 IN 507 B.

This work will be published in a special issue on Non-Standard Constraint Pro-

cessing in the

Journal on Experimental and Theoretical Arti cial Intelligence , 1997.

Abstract In the past we presented an algorithm to solve ordered constraint hierarchies based on a non-trivial error function using standard constraint satisfaction techniques. We extended this previous work and herewith present a new method to transform hierarchies of inequalities over the integers based on global comparators into equivalent ordered constraint hierarchies. The correctness of this method is proven. Using the results of our previous work, we present another method transforming the resulting ordered constraint hierarchies into ordinary constraint systems. These systems of algebraic equalities and inequalities over the integer domain are soluble with available nite-domain constraint solvers. At last we propose some modi cations and simpli cations of the considered constraint hierarchies improving the search for solutions and being useful in practical applications like job-shop scheduling. The modi cations are the combinations of consecutive hierarchy levels in one level where the constraints are considered with di erent priorities/weights. The simpli cations are incomplete search strategies resulting in run-time improvements and in sub-optimal solutions, too.

Solving Hierarchies of Finite-Domain Constraints

1

1 Introduction Wide areas in which constraint systems are successfully applied, are computer graphics, especially automatic layout generation [Borning and Duisberg, 1986, Newberry-Paulisch and Tichy, 1990], con guration, and planning, for example assembling of technical systems [Mittal and Falkenhainer, 1990, Stumptner et al., 1994], and scheduling [Caseau and Laburthe, 1994, Goltz, 1995]. In practical applications, we often are confronted with over-constrained problem speci cations which are unsolvable. However, a solution in the form of a layout, plan, schedule, and so on has to be generated. One possibility to solve this con ict is the introduction of constraint hierarchies [Wilson and Borning, 1993]. Constraint hierarchies consist of required constraints which have to be satis ed, and non-required constraints which only have to be satis ed as well as possible.

2 State-of-the-Art The formal foundations of constraint hierarchies are presented in [Borning et al., 1987]. Further developments where made by Molly Ann Wilson in her PhD thesis [Wilson, 1993], especially the extension of constraint logic programming (s.a. [Wilson and Borning, 1993]). For constraint hierarchies based on the trivial error function that returns 0 if the considered constraint is satis ed and 1 if it is not (cf. [Wilson, 1993], page 7), a lot of algorithms to solve such hierarchies are known [Sannella, 1994, Satoh and Aiba, 1991, Tsusumi, 1994]. The rst solution uses method graphs, the second one is a model theoretic approach to the problem, and the third one is based on deductive database techniques. The only algorithm known to the author for constraint hierarchies based on a non-trivial error function { we call an error function non-trivial if its codomain is in nite { is based on the constraint solver DeltaStar [Freeman-Benson et al., 1992] and the Simplex algorithm for linear constraints over the reals. The basics of the algorithm are sketched in Wilson's PhD thesis. Another algorithm for ordered constraint hierarchies based on a non-trivial error function and consisting of algebraic nite domain constraints was presented in [Wolf, 1996]. The use of constraint hierarchies is one possibility to formalize overconstrained systems. The evaluation of solutions of constraint hierarchies requires non-standard constraint processing methods. Both, over-constrained systems, and non-standard constraint processing, are fairly new areas of research [Hower and Ruttkay, 1996, Jampel et al., 1996a]. Besides constraint hierarchies, there are other theoretical approaches to specifying and solving overconstrained problems using non-standard constraint processing techniques. The developed theories have in common that there is some kind of \softness" or

Solving Hierarchies of Finite-Domain Constraints

2

\fuzziness" of constraints, and some \measures" for these properties, for example error and membership values, priorities, and so on. An overview of the di erent approaches is presented in [Jampel, 1996a]. Recent works in this area deal with a uniform theory subsuming di erent approaches [Bistarelli et al., 1996, Jampel et al., 1996b], a compositional theory of constraint hierarchies [Jampel, 1996b] and their incremental solving [Menezes and Barahona, 1995, Holzbaur et al., 1996].

3 De nitions In this section we give a brief overview of the constraint hierarchy theory presented in [Borning et al., 1987]. For more details [Wilson, 1993] is recommended. A constraint hierarchy H consists of a nite sequence of hierarchy levels H ; H ; : : : ; Hn. Each hierarchy level is a nite sequence of constraints (c ; : : : ; ck ). All constraints at level 0 are required constraints. They have to be satis ed. H is the sequence of the strongest non-required constraints. After considering the constraints at level 0 they have to be satis ed as well as possible. Then the non-required constraints at level 2 are considered and so forth. A valuation is a substitution mapping variables to values of the variables' domains. The application of a valuation  to a constraint c is c. In the following we assume that the valuation  maps (at least) the variables in the considered constraints to values. Given a valuation , a variable x, and a set of variables V we write jx and jV for the valuations having the restricted domains fxg and V , respectively. The application of a valuation  to a sequence of constraints C = (c ; : : : ; ck ) is de ned as C := (c ; : : : ; ck ). An error function e maps any valuated constraint c to a non-negative real value. It holds that e(c) = 0 if and only if the valuation  satis es the constraint c. A generalization of an error function e is a function E mapping valuated sequences of constraints to real-valued vectors. For any sequence of constraints C = (c ; : : : ; ck ) and any valuation  it is de ned as E (C) := [e(c ); : : : ; e(ck )] The error sequence of a constraint hierarchy H = H ; H ; : : : ; Hn with respect to a generalized error function E , and a valuation  is the sequence [E (H ); : : : ; E (Hn)]. An error combining function g \combines" the individual errors e(c ); : : : ; e(ck ) at each hierarchy level Hi to the \error" g(E (Hi)). If the individual errors are really combined to one value, we call the combining function global and the value g(E (Hi)) the error (of the valuation ) at level Hi. A generalization of an error combining function g is a function G de ned as G([E (H ); : : : ; E (Hn)]) := [g(E (H )); : : : ; g(E (Hn))]: 0

1

1

1

1

1

1

1

0

1

1

1

1

1

Solving Hierarchies of Finite-Domain Constraints

3

The result [g(E (H )); : : : ; g(E (Hn))] is called a combined error sequence , and represents the \total error" of a valuation  in a hierarchy H . Di erent valuations of a hierarchy are compared with respect to their errors. Therefore, the combined error sequences are compared lexicographically. This requires two binary relations g and 1 result in simpli ed evaluations and sub-optimal solutions. Only c = 1 guarantees to obtain optimal solutions. The complexity of the evaluation of the representatives depends on the number of hierarchy levels. We propose a combination of consecutive hierarchy levels in one level respecting constraints of di erent levels with di erent weights. Replacing the hierarchy levels p; : : : ; q by the hierarchy level p, renaming the variables zp; : : : ; zq to zp, and replacing the constraints ij := (tji ? zj  bji ) for i = 1; : : : ; kj and j = p; : : : ; q in H 0 by ij := (tji ? cj  zp  bji ) for i = 1; : : : ; kj and j = p; : : : ; q 1

1

1

0

1

Solving Hierarchies of Finite-Domain Constraints

14

results in such a combination if we assume that the combining function g is de ned as g(x ; : : : ; xm ) := maxmi xi (for other global comparators the replacement has to be accomplished analogously). We also propose either constant, linearly, or exponentially growing values cj (w.r.t. j ). It is obvious that the error of the resulting hierarchy of a valuation  at level Hp00 which represents the levels (Hp; : : : ; Hq ) is 1

=1

(

)

e(ij ) j i = 1; : : : ; k and j = p; : : : ; q : j p cj Reduced complexity is one advantage of this combination; another advantage is the consideration of constraints at lower levels during the minimization of the global errors at higher levels. g(E (H 00)) := max

9 Conclusion and Future Work In this paper we present a new method to transform algebraic constraint hierarchies based on a global comparator into ordered hierarchies. We also prove the correctness of the transformation. The presented methods are implemented in ECLi PSe, the constraint logic programming system of the ECRC [ECR, 1995b] using the build-in nite-domain constraint solver [ECR, 1995a]. We used the prototype implementation to solve some small over-constrained scheduling problems. We are now investigating some e orts to formalize the \softness" of composite and global constraints, for example cumulative constraints [Aggoun and Beldiceanu, 1993], which are necessary to model nite capacity scheduling problems. Further we try to improve the optimizations which are necessary to evaluate the representatives. Incremental Search [van Hentenryck and le Provost, 1991] seems to be a good candidate to replace the used branch-and-bound algorithm. In future we plan to apply the given results to model and solve overconstrained real-world scheduling and con guration problems. To model these problems adequately it seems necessary to use di erent comparators in the same constraint hierarchy. Having the adapted transformations for the global comparators in mind, it is easy to choose di erent comparators for di erent levels. In this application context we want to integrate a rule-based component which supports the modeling, especially the assembly of the hierarchies and some heuristics reducing the time complexity.

Acknowledgments

This work originates from the German National Research Center for Information Technology (GMD), Research Institute for Computer Architecture and Software

Solving Hierarchies of Finite-Domain Constraints

15

Technology (FIRST) and was supported by the German Federal Ministry for Education, Science, Research, and Technology (BMBF). Many thanks to the members of the constraint logic programming group at FIRST for fruitful discussions helping to improve this paper.

References [Aggoun and Beldiceanu, 1993] A. Aggoun and N. Beldiceanu. Extending CHIP in order to solve complex scheduling and placement problems. Journal of Mathematical and Computer Modelling, 17(7):57{73, 1993. [Bistarelli et al., 1996] Stefano Bistarelli, Helene Fargier, Ugo Montanari, Francesca Rossi, Thomas Schiex, and Gerard Verfaillie. Semiring-based CSPs and valued CSPs: Basic properties and comparison. In Michael Jampel, Eugene Freuder, and Michael Maher, editors, Over-Constrained Systems, volume 1106 of Lecture Notes in Computer Science, pages 111{150. Springer Verlag, August 1996. [Borning and Duisberg, 1986] Alan Borning and Robert Duisberg. Constraintbased tools for building user interfaces. ACM Transactions on Graphics, 5(4):345{374, October 1986. [Borning et al., 1987] Alan Borning, Robert Duisberg, Bjorn Freeman-Benson, Axel Kramer, and Michael Woolf. Constraint hierarchies. In Proceedings of the 1987 ACM Conference on Object-Oriented Programming Systems, Languages, and Applications { OOPSLA'87, pages 48{60. ACM, October 1987. [Caseau and Laburthe, 1994] Yves Caseau and Francois Laburthe. Improved CLP scheduling with task intervals. In Pascal van Hentenryck, editor, Proceedings of the Eleventh International Conference on Logic Programming, ICLP'94, pages 369{383. MIT Press, 1994. [COS, 1996] COSYTEC, Orsay Cedex, France. CHIP V5, User Manual, 1996. [ECR, 1995a] ECRC, Munchen. ECLiPSe 3.5, Extensions User Manual, 1995. [ECR, 1995b] ECRC, Munchen. ECLiPSe 3.5, User Manual, 1995. [Freeman-Benson et al., 1992] Bjorn Freeman-Benson, Molly Wilson, and Alan Borning. DeltaStar: A general algorithm for incremental satisfaction of constraint hierarchies. In Proceedings of the 11th Annual IEEE Phoenix Conference on Computers and Communication, pages 561{568, March 1992. [Goltz, 1995] H.-J. Goltz. Reducing domains for search in CLP(FD) and its application to job-shop scheduling. In Ugo Montanari and Francesca Rossi,

Solving Hierarchies of Finite-Domain Constraints

16

editors, Proceedings of the First International Conference on Principles and Practice of Constraint Programming 1995, number 976 in Lecture Notes in Computer Science, pages 549{562. Springer Verlag, 1995. [Holzbaur et al., 1996] Christian Holzbaur, Fransisco Menezes, and Pedro Barahona. Defeasibility in CLP(Q) through generalized slack variables. In Eugence C. Freuder, editor, Proceedings of the Second International Conference on Principles and Practice of Constraint Programming { CP96, number 1118 in Lecture Notes in Computer Science, pages 209{223, Cambrigde, MA, USA, August 1996. Springer Verlag. [Hower and Ruttkay, 1996] Walter Hower and Zso a Ruttkay, editors. NonStandard Constraint Processing, working notes of the ECAI-96 workshop W27, Budapest, Hungary, August 1996. [Jampel et al., 1996a] Michael Jampel, Eugene Freuder, and Michael Maher, editors. Over-Constrained Systems, number 1106 in Lecture Notes in Computer Science. Springer Verlag, August 1996. [Jampel et al., 1996b] Michael Jampel, Jean-Marie Jacquet, David Gilbert, and Sebastian Hunt. Transformations between HCLP and PCSP. In Eugene C. Freuder, editor, Proceedings of the Second International Conference on Principles and Practice of Constraint Programming { CP96, number 1118 in Lecture Notes in Computer Science, pages 252{267, Cambrigde, MA, USA, August 1996. Springer Verlag. [Jampel, 1996a] Michael Jampel. A brief overview of over-constrained systems. In Over-Constrained Systems, number 1106 in Lecture Notes in Computer Science, pages 1{22. Springer Verlag, 1996. [Jampel, 1996b] Michael Jampel. A compositional theory of constraint hierarchies. In Over-Constrained Systems, number 1106 in Lecture Notes in Computer Science, pages 189{206. Springer Verlag, 1996. [Menezes and Barahona, 1995] Fransisco Menezes and Pedro Barahona. An Incremental Hierarchical Constraint Solver, chapter 16, pages 291{316. The MIT Press, 1995. [Mittal and Falkenhainer, 1990] Sanjay Mittal and Brian Falkenhainer. Dynamic Constraint Satisfaction Problems. In Proceedings of the AAAI'90, pages 25{32, 1990. [Newberry-Paulisch and Tichy, 1990] Francis Newberry-Paulisch and Walter F. Tichy. Edge: An extendible graph editor. Software | Practice and Experience, 20(S1):63{88, June 1990.

Solving Hierarchies of Finite-Domain Constraints

17

[Sannella, 1994] Michael Sannella. The SkyBlue constraint solver and its applications. In Vijay A. Saraswat and Pascal van Hentenryck, editors, Proceedings of the 1993 Workshop on Principles and Practice of Constraint Programming, pages 385{406. The MIT Press, 1994. [Satoh and Aiba, 1991] Ken Satoh and Akira Aiba. Computing soft constraints by hierarchical constraint logic programming. Technical Report 610, Institute for New Generation Computer Technology (ICOT), 1991. [Stumptner et al., 1994] Markus Stumptner, Alois Haselbock, and Gerhard Friedrich. COCOS - a tool for constraint-based, dynamic con guration. In 10th IEEE Conference on AI Applications (CAIA), 1994. [Tsusumi, 1994] Fujio Tsusumi. An ecient algorithm of logic programming with constraint hierarchy. In Jean-Pierre Jouannaud, editor, Proceedings of the First International Conference on Constraints in Computational Logics, number 845 in Lecture Notes in Computer Science, pages 170{182. Springer Verlag, September 1994. [van Hentenryck and le Provost, 1991] Pascal van Hentenryck and Thierry le Provost. Incremental search in constraint logic programming. New Generation Computing, pages 257{275, 1991. [Wilson and Borning, 1993] Molly Ann Wilson and Alan Borning. Hierachical constraint logic programming. The Journal of Logic Programming, 16(3 & 4):277{318, July and August 1993. [Wilson, 1993] Molly Ann Wilson. Hierarchical Constraint Logic Programming. PhD thesis, Department of Computer Science and Engineering, University of Washington, 1993. [Wolf, 1996] Armin Wolf. Transforming ordered constraint hierarchies into ordinary constraint systems. In Michael Jampel, Eugene Freuder, and Michael Maher, editors, Over-Constrained Systems, pages 171{188. Springer Verlag, 1996.