An optimal arc consistency algorithm for a particular case of sequence constraint
The AtMostSeqCard constraint is the conjunction of a cardinality constraint on a sequence of n variables and of n -aEuro parts per thousand q + 1 constraints AtMost u on each subsequence of size q. This constraint is useful in car-sequencing and crew-rostering problems. In van Hoeve et al. (Constraints 14(2):273-292, 2009), two algorithms designed for the AmongSeq constraint were adapted to this constraint with an O(2 (q) n) and O(n (3)) worst case time complexity, respectively. In Maher et al. (2008), another algorithm similarly adaptable to filter the AtMostSeqCard constraint with a time complexity of O(n (2)) was proposed. In this paper, we introduce an algorithm for achieving arc consistency on the AtMostSeqCard constraint with an O(n) (hence optimal) worst case time complexity. Next, we show that this algorithm can be easily modified to achieve arc consistency on some extensions of this constraint. In particular, the conjunction of a set of m AtMostSeqCard constraints sharing the same scope can be filtered in O(nm). We then empirically study the efficiency of our propagator on instances of the car-sequencing and crew-rostering problems.
arc consistency sequencing constraints filtering algorithm car sequencing