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

## 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 X_{ 1 },..., *X* _{ n }, Y_{ 1 },*Y* _{ n } from a linearly ordered set *D* Let *S* denote the set of all tuples *t ∈ X* _{ 1 } × · · · × *X* _{ n } × Y_{ 1 } · · · × *Y* _{ n } 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 *Z* _{ 1 },..., Z_{ n }. Let T denote all tuples *t ∈* Z_{ 1 } · · · × *Z* _{ n } 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. *Z* _{ i } ⊆ - [1; *n*] for all *i*, the running time is linear. This also improves upon previous results.

## Keywords

Perfect Match Priority Queue Intersection Graph Free Node Matched Node## Preview

Unable to display preview. Download preview PDF.

## References

- AHU74.Alfred V. Aho, John E. Hopcroft, and Jeffrey D. Ullman.
*The Design and Analysis of Computer Algorithms*. Addison-Wesley, Reading, MA, 1974.zbMATHGoogle Scholar - BGC97.N. Bleuzen-Guernalec and A. Colmerauer. Narrowing a 2n-block of sortings in $O(n log n)$.
*Lecture Notes in Computer Science*, 1330:2–16, 1997.CrossRefGoogle Scholar - BGC00.N. Bleuzen-Guernalec and A. Colmerauer. Optimal narrowing of a block of sortings in optimal time.
*Constraints: An international Journal*, 5(1–2):85–118, 2000.zbMATHCrossRefMathSciNetGoogle Scholar - CM96.Joseph Cheriyan and Kurt Mehlhorn. Algorithms for dense graphs and networks on the random access computer.
*Algorithmica*, 15(5):521–549, 1996.zbMATHMathSciNetCrossRefGoogle Scholar - Glo67.F. Glover. Maximum matchings in a convex bipartite graph.
*Naval Res. Logist. Quart.*, 14:313–316, 1967.zbMATHCrossRefGoogle Scholar - GT83.H. N. Gabow and R. E. Tarjan. A linear-time algorithm for a special case of disjoint set union. In
*ACM Symposium on Theory of Computing (STOC’ 83)*, pages 246–251. ACM Press, 1983.Google Scholar - Law76.Eugene L. Lawler.
*Combinatorial Optimization: Networks and Matroids*. Holt, New York; Chicago; San Francisco, 1976.Google Scholar - MN99.Kurt Mehlhorn and Stefan Naher.
*LED A: a platform for combinatorial and geometric computing*. Cambridge University Press, Cambridge, November 1999.Google Scholar - Moz.The Mozart Programming System, http://www.MOZ-oz.org.
- Pug98.Jean Puget. A fast algorithm for the bound consistency of alldiff constraints. In
*Proceedings of the 15th National Conference on Artificial Intelligence (AAAI-98) and of the 10th Conference on Innovative Applications of Artificial Intelligence (IAAI-98)*, pages 359–366, Menio Park, July 26–30 1998. AAAI Press.Google Scholar - Reg94.J.-C. Regin. A filtering algorithm for constraints of difference in CSPs. In
*Proc. 12th Conf. American Assoc. Artificial Intelligence*, volume 1, pages 362–367. Amer. Assoc. Artificial Intelligence, 1994.Google Scholar