A Modelling Pearl with Sortedness Constraints

Some constraint programming solvers and constraint modelling languages feature the Sort(L, P , S ) constraint, which holds if S is a nondecreasing rearrangement of the list L, the permutation being made explicit by the optional list P. However, such sortedness constraints do not seem to be used much in practice. We argue that reasons for this neglect are that it is impossible to require the underlying sort to be stable, so that Sort cannot be guaranteed to be a total-function constraint, and that L cannot contain tuples of variables, some of which form the key for the sort. To overcome these limitations, we introduce the StableKeysort constraint, decompose it using existing constraints, and propose a propagator. This new constraint enables a powerful modelling idiom, which we illustrate by elegant and scalable models of two problems that are otherwise hard to encode as constraint programs.

[1]  Sven Thiel Efficient algorithms for constraint propagation and for processing tree descriptions , 2004 .

[2]  Peter J. Stuckey,et al.  Finite Domain Bounds Consistency Revisited , 2004, Australian Conference on Artificial Intelligence.

[3]  Mateu Villaret,et al.  Scheduling B2B Meetings , 2014, CP.

[4]  Julian Scott Yeomans,et al.  A linear time algorithm for maximum matchings in convex, bipartite graphs☆ , 1996 .

[5]  Jianyang Zhou A Permutation-Based Approach for Solving the Job-Shop Problem , 2004, Constraints.

[6]  Toby Walsh,et al.  Handbook of Constraint Programming , 2006, Handbook of Constraint Programming.

[7]  Nicolas Beldiceanu,et al.  Extending CHIP in order to solve complex scheduling and placement problems , 1993, JFPL.

[8]  Mats Carlsson,et al.  Revisiting the Lexicographic Ordering Constraint , 2002 .

[9]  A. Colmerauer,et al.  Narrowing a 2n-block of sortings in O (n logn) , 1997 .

[10]  CarlssonMats,et al.  Sicstus prolog-the first 25 years , 2012 .

[11]  Jean-Charles Régin,et al.  Generalized Arc Consistency for Global Cardinality Constraint , 1996, AAAI/IAAI, Vol. 1.

[12]  Yves Deville,et al.  Bound-Consistent Deviation Constraint , 2007, CP.

[13]  Jianyang Zhou,et al.  A Constraint Program for Solving the Job-Shop Problem , 1996, CP.

[14]  Patrick Pekczynski Implementation and Evaluation of Advanced Propagation Algorithms for Global Constraints , 2006 .

[15]  W. Older,et al.  Getting to the real problem : experience with BNR Prolog in OR , 2015 .

[16]  Mats Carlsson,et al.  Revisiting the Cardinality Operator and Introducing the Cardinality-Path Constraint Family , 2001, ICLP.

[17]  Pierre Lopez,et al.  Project scheduling under resource constraints: Application of the cumulative global constraint , 2009, 2009 International Conference on Computers & Industrial Engineering.

[18]  Kurt Mehlhorn,et al.  Faster Algorithms for Bound-Consistency of the Sortedness and the Alldifferent Constraint , 2000, CP.

[19]  Peter J. Stuckey,et al.  MiniZinc: Towards a Standard CP Modelling Language , 2007, CP.

[20]  Mats Carlsson,et al.  On the reification of global constraints , 2012, Constraints.

[21]  Gilles Pesant,et al.  A Regular Language Membership Constraint for Finite Sequences of Variables , 2004, CP.

[22]  Irena Rusu NP-hardness of sortedness constraints , 2015, ArXiv.

[23]  V. S. Costa,et al.  Theory and Practice of Logic Programming , 2010 .

[24]  Michael A. Trick A Dynamic Programming Approach for Consistency and Propagation for Knapsack Constraints , 2003, Ann. Oper. Res..

[25]  Noëlle Bleuzen-Guernalec,et al.  Optimal Narrowing of a Block of Sortings in Optimal Time , 2004, Constraints.

[26]  Nicolas Barnier,et al.  Slot allocation with constraint programming : models and results , 2001 .

[27]  Mats Carlsson,et al.  An Open-Ended Finite Domain Constraint Solver , 1997, PLILP.

[28]  N. Guernalec,et al.  Narrowing a 2 n -block of sortings in O ( n log n ) , 1997 .

[29]  Kish Shen,et al.  Under consideration for publication in Theory and Practice of Logic Programming , 2003 .

[30]  Sylvain Bouveret,et al.  New Constraint Programming Approaches for the Computation of Leximin-Optimal Solutions in Constraint Networks , 2007, IJCAI.