5.7. alldifferent_consecutive_values

DESCRIPTIONLINKSGRAPH
Origin

Derived from πšŠπš•πš•πšπš’πšπšπšŽπš›πšŽπš—πš.

Constraint

πšŠπš•πš•πšπš’πšπšπšŽπš›πšŽπš—πš_πšŒπš˜πš—πšœπšŽπšŒπšžπšπš’πšŸπšŽ_πšŸπšŠπš•πšžπšŽπšœ(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚)

Argument
πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(πšŸπšŠπš›-πšπšŸπšŠπš›)
Restrictions
πš›πšŽπššπšžπš’πš›πšŽπš(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚,πšŸπšŠπš›)
πšŠπš•πš•πšπš’πšπšπšŽπš›πšŽπš—πš(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚)
Purpose

Enforce (1)Β all variables of the collection πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ to take distinct values and (2)Β constraint the difference between the largest and the smallest values of the πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ collection to be equal to the number of variables minus one (i.e.,Β there is no holes at all within the used values).

Example
(5,4,3,6)

The πšŠπš•πš•πšπš’πšπšπšŽπš›πšŽπš—πš_πšŒπš˜πš—πšœπšŽπšŒπšžπšπš’πšŸπšŽ_πšŸπšŠπš•πšžπšŽπšœ constraint holds since (1)Β all the values 5, 4, 3 and 6 are distinct and since (2)Β all values between value 3 and value 6 are effectively used.

Typical
|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|>2
Symmetries
  • Items of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ are permutable.

  • Two distinct values of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš› can be swapped.

  • One and the same constant can be added to the πšŸπšŠπš› attribute of all items of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.

See also

implies: πšŠπš•πš•πšπš’πšπšπšŽπš›πšŽπš—πš, πšŒπš˜πš—πšœπšŽπšŒπšžπšπš’πšŸπšŽ_πšŸπšŠπš•πšžπšŽπšœ.

Keywords

characteristic of a constraint: all different, disequality.

combinatorial object: permutation.

constraint type: value constraint.

Arc input(s)

πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚

Arc generator
π‘†πΈπΏπΉβ†¦πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(πšŸπšŠπš›πš’πšŠπš‹πš•πšŽπšœ)

Arc arity
Arc constraint(s)
πšƒπšπš„π™΄
Graph property(ies)
𝐑𝐀𝐍𝐆𝐄(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚,πšŸπšŠπš›)=|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|-1