## 5.24. among_diff_0

Origin

Used in the automaton of $\mathrm{\pi \pi \pi \pi \pi \pi }$.

Constraint

$\mathrm{\pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi \pi }_\mathtt{0}\left(\mathrm{\pi ½\pi  \pi °\pi },\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\right)$

Arguments
 $\mathrm{\pi ½\pi  \pi °\pi }$ $\mathrm{\pi \pi \pi \pi }$ $\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 }\beta ₯0$ $\mathrm{\pi ½\pi  \pi °\pi }\beta €|\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }|$ $\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)$
Purpose

$\mathrm{\pi ½\pi  \pi °\pi }$ is the number of variables of the collection $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ that take a value different from 0.

Example
 $\left(3,β©0,5,5,0,1βͺ\right)$ $\left(0,β©0,0,0,0,0βͺ\right)$ $\left(1,β©0,0,0,6,0βͺ\right)$

The first $\mathrm{\pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi \pi }_\mathtt{0}$ constraint holds since exactly 3 values of the collection of values $\beta ©0,5,5,0,1\beta ͺ$ are different from 0.

Typical
 $\mathrm{\pi ½\pi  \pi °\pi }>0$ $\mathrm{\pi ½\pi  \pi °\pi }<|\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }|$ $|\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }|>1$ $\mathrm{\pi \pi \pi \pi \pi \pi \pi }$$\left(1,\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi },0\right)$ $2*\mathrm{\pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi \pi }_\mathtt{0}\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 }|$
Symmetries
• Items of $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ are permutable.

• An occurrence of a value of $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }$ that is different from 0 can be replaced by any other value that is also different from 0.

Arg. properties
• Functional dependency: $\mathrm{\pi ½\pi  \pi °\pi }$ determined by $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$.

• Contractible wrt. $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ when $\mathrm{\pi ½\pi  \pi °\pi }=0$.

• Contractible wrt. $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ when $\mathrm{\pi ½\pi  \pi °\pi }=|\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }|$.

• Aggregate: $\mathrm{\pi ½\pi  \pi °\pi }\left(+\right)$, $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\left(\mathrm{\pi \pi \pi \pi \pi }\right)$.

Counting
 Length ($n$) 2 3 4 5 6 7 8 Solutions 9 64 625 7776 117649 2097152 43046721

Number of solutions for $\mathrm{\pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi \pi }_\mathtt{0}$: domains $0..n$

Length ($n$)2345678
Total9646257776117649209715243046721
 Parameter value

01111111
1491625364964
24279625054010291792
3-27256125043201200528672
4--25631251944084035286720
5---3125466563529471835008
6----466568235437340032
7-----82354316777216
8------16777216

Solution count for $\mathrm{\pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi \pi }_\mathtt{0}$: domains $0..n$

generalisation: $\mathrm{\pi \pi \pi \pi \pi }$Β ( replaced by $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi }\beta \mathrm{\pi \pi \pi \pi \pi \pi }$).

Keywords
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 }\right)$

Arc arity
Arc constraint(s)
Graph property(ies)
$\mathrm{\pi \pi \pi \pi }$$=\mathrm{\pi ½\pi  \pi °\pi }$

Graph model

Since this is a unary constraint we employ the $\mathrm{\pi \pi Έ\pi Ώ\pi Ή}$ arc generator in order to produce an initial graph with a single loop on each vertex.

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

Automaton

FigureΒ 5.24.2 depicts the automaton associated with the $\mathrm{\pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi \pi }_\mathtt{0}$ constraint. To each variable ${\mathrm{\pi  \pi °\pi }}_{i}$ of the collection $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ corresponds a 0-1 signature variable ${S}_{i}$. The following signature constraint links ${\mathrm{\pi  \pi °\pi }}_{i}$ and ${S}_{i}$: . The automaton counts the number of variables of the $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ collection that take a value different from 0 and finally assigns this number to $\mathrm{\pi ½\pi  \pi °\pi }$.