Faster Algorithms for Bound-Consistency of the Sortedness and the Alldifferent Constraint

  • Authors:
  • Kurt Mehlhorn;Sven Thiel

  • Affiliations:
  • -;-

  • Venue:
  • CP '02 Proceedings of the 6th International Conference on Principles and Practice of Constraint Programming
  • Year:
  • 2000

Quantified Score

Hi-index 0.01

Visualization

Abstract

We present narrowing algorithms for the sortedness and the alldifferent constraint which achieve bound-consistency. The algorithm for the sortedness constraint takes as input 2n intervals X1, ... , Xn, Y1, ... , Yn from a linearly ordered set D. Let S denote the set of all tuples t ∈ X1 × ... × Xn × Y1 × ... × Yn such that the last n components of t are obtained by sorting the first n components. Our algorithm determines whether S is non-empty and if so reduces the intervals to bound-consistency. The running time of the algorithm is asymptotically the same as for sorting the interval endpoints. In problems where this is faster than O(n log n), this improves upon previous results. The algorithm for the alldifferent constraint takes as input n integer intervals Z1, ... , Zn. Let T denote all tuples t ∈ Z1 × ... × Zn where all components are pairwise different. The algorithm checks whether T is non-empty and if so reduces the ranges to bound-consistency. The running time is also asymptotically the same as for sorting the interval endpoints. When the constraint is for example a permutation constraint, i.e. Zi ⊆ [1; n] for all i, the running time is linear. This also improves upon previous results.