Generalizing alldifferent: the somedifferent constraint

  • Authors:
  • Yossi Richter;Ari Freund;Yehuda Naveh

  • Affiliations:
  • IBM Haifa Research Lab, Haifa University Campus, Haifa, Israel;IBM Haifa Research Lab, Haifa University Campus, Haifa, Israel;IBM Haifa Research Lab, Haifa University Campus, Haifa, Israel

  • Venue:
  • CP'06 Proceedings of the 12th international conference on Principles and Practice of Constraint Programming
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

We introduce the SomeDifferent constraint as a generalization of AllDifferent. SomeDifferent requires that values assigned to some pairs of variables will be different. It has many practical applications. For example, in workforce management, it may enforce the requirement that the same worker is not assigned to two jobs which are overlapping in time. Propagation of the constraint for hyper-arc consistency is NP hard. We present a propagation algorithm with worst case time complexity O(n3βn) where n is the number of variables and β≈3.5 (ignoring a trivial dependence on the representation of the domains). We also elaborate on several heuristics which greatly reduce the algorithm's running time in practice. We provide experimental results, obtained on a real-world workforce management problem and on synthetic data, which demonstrate the feasibility of our approach.