## 5.5. all_equal

Origin
Constraint

$\mathrm{\pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi }\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\right)$

Synonym

$\mathrm{\pi \pi \pi }$.

Argument
 $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }\left(\mathrm{\pi \pi \pi }-\mathrm{\pi \pi \pi \pi }\right)$
Restrictions
 $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi }$$\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi },\mathrm{\pi \pi \pi }\right)$ $|\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }|>0$
Purpose

Enforce all variables of the collection $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ to take the same value.

Example
$\left(β©5,5,5,5βͺ\right)$

The $\mathrm{\pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi }$ constraint holds since all its variables are fixed to value 5.

All solutions

FigureΒ 5.5.1 gives all solutions to the following non ground instance of the $\mathrm{\pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi }$ constraint: ${V}_{1}\beta \left[0,6\right]$, ${V}_{2}\beta \left[0,2\right]$, ${V}_{3}\beta \left[0,2\right]$, ${V}_{4}\beta \left[1,4\right]$, $\mathrm{\pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi }$$\left(\beta ©{V}_{1},{V}_{2},{V}_{3},{V}_{4}\beta ͺ\right)$.

Typical
 $|\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }|>2$ $\mathrm{\pi \pi \pi \pi \pi \pi }$
Symmetries
• Items of $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ are permutable.

• All occurrences of a value of $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }$ can be renamed to any unused value.

Arg. properties

Contractible wrt. $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$.

Counting
 Length ($n$) 2 3 4 5 6 7 8 Solutions 3 4 5 6 7 8 9

Number of solutions for $\mathrm{\pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi }$: domains $0..n$

Systems

generalisation: $\mathrm{\pi \pi \pi \pi \pi \pi }$Β (a variable counting the number of distinct values is introduced).

specialisation: $\mathrm{\pi \pi }$Β (equality between just two variables).

Keywords
Cond. implications

$\mathrm{\pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi }\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\right)$

Β Β Β  withΒ  $|\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }|>1$

Β Β implies $\mathrm{\pi \pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi }$$\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\right)$.

Arc input(s)

$\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$

Arc generator
$\mathrm{\pi \pi ΄\pi \pi »}$$\beta ¦\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }\left(\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi }\mathtt{1},\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi }\mathtt{2}\right)$

Arc arity
Arc constraint(s)
$\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi }\mathtt{1}.\mathrm{\pi \pi \pi }=\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi }\mathtt{2}.\mathrm{\pi \pi \pi }$
Graph property(ies)
$\mathrm{\pi \pi \pi \pi }$$=|\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }|-1$

Graph model

We use the arc generator $\mathrm{\pi \pi ΄\pi \pi »}$ in order to link consecutive variables of the collection $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ by a binary equality constraint.

PartsΒ (A) andΒ (B) of FigureΒ 5.5.2 respectively show the initial and final graph of the Example slot. Since we use the $\mathrm{\pi \pi \pi \pi }$ graph property, the arcs of the final graph are stressed in bold.