5.3. all_equal

DESCRIPTIONLINKSGRAPH
Origin

Derived from 𝚜𝚘𝚏𝚝_πšŠπš•πš•_πšŽπššπšžπšŠπš•_πš–πš’πš—_πšŒπšπš›

Constraint

πšŠπš•πš•_πšŽπššπšžπšŠπš•(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚)

Synonym

πš›πšŽπš•.

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

Enforce all variables of the collection πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ to take the same value.

Example
(5,5,5,5)

The πšŠπš•πš•_πšŽπššπšžπšŠπš• constraint holds since all its variables are fixed to value 5.

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

  • All occurrences of a value of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš› can be renamed to any unused value.

Systems

atMostNValue in Choco, rel in Gecode.

See also

generalisation: πš—πšŸπšŠπš•πšžπšŽΒ (a variable counting the number of distinct values is introduced).

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

negation: πš—πš˜πš_πšŠπš•πš•_πšŽπššπšžπšŠπš•.

soft variant: 𝚜𝚘𝚏𝚝_πšŠπš•πš•_πšŽπššπšžπšŠπš•_πš–πšŠπš‘_πšŸπšŠπš›,

𝚜𝚘𝚏𝚝_πšŠπš•πš•_πšŽπššπšžπšŠπš•_πš–πš’πš—_πšŒπšπš›Β (decomposition-based violation measure), 𝚜𝚘𝚏𝚝_πšŠπš•πš•_πšŽπššπšžπšŠπš•_πš–πš’πš—_πšŸπšŠπš›Β (variable-based violation measure).

specialisation: 𝚎𝚚 (equality between just two variables).

Keywords

constraint type: value constraint.

Arc input(s)

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

Arc generator
π‘ƒπ΄π‘‡π»β†¦πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(πšŸπšŠπš›πš’πšŠπš‹πš•πšŽπšœ1,πšŸπšŠπš›πš’πšŠπš‹πš•πšŽπšœ2)

Arc arity
Arc constraint(s)
πšŸπšŠπš›πš’πšŠπš‹πš•πšŽπšœ1.πšŸπšŠπš›=πšŸπšŠπš›πš’πšŠπš‹πš•πšŽπšœ2.πšŸπšŠπš›
Graph property(ies)
𝐍𝐀𝐑𝐂=|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|-1

Graph model

We use the arc generator 𝑃𝐴𝑇𝐻 in order to link consecutive variables of the collection πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ by a binary equality constraint.

PartsΒ (A) andΒ (B) of FigureΒ 5.3.1 respectively show the initial and final graph of the Example slot. Since we use the 𝐍𝐀𝐑𝐂 graph property, the arcs of the final graph are stressed in bold.

Figure 5.3.1. Initial and final graph of the πšŠπš•πš•_πšŽπššπšžπšŠπš• constraint
ctrs/all_equalActrs/all_equalB
(a) (b)