## 5.218. minimum_except_0

Origin
Constraint

$\mathrm{\pi \pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi ‘\pi \pi \pi \pi }_\mathtt{0}\left(\mathrm{\pi Ό\pi Έ\pi ½},\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi },\mathrm{\pi ³\pi ΄\pi ΅\pi °\pi \pi »\pi }\right)$

Arguments
 $\mathrm{\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)$ $\mathrm{\pi ³\pi ΄\pi ΅\pi °\pi \pi »\pi }$ $\mathrm{\pi \pi \pi }$
Restrictions
 $\mathrm{\pi Ό\pi Έ\pi ½}>0$ $\mathrm{\pi Ό\pi Έ\pi ½}\beta €\mathrm{\pi ³\pi ΄\pi ΅\pi °\pi \pi »\pi }$ $|\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }|>0$ $\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 }.\mathrm{\pi \pi \pi }\beta ₯0$ $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }\beta €\mathrm{\pi ³\pi ΄\pi ΅\pi °\pi \pi »\pi }$ $\mathrm{\pi ³\pi ΄\pi ΅\pi °\pi \pi »\pi }>0$
Purpose

All variables of the collection $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ are assigned a value that belongs to interval $\left[0,\mathrm{\pi ³\pi ΄\pi ΅\pi °\pi \pi »\pi }\right]$. $\mathrm{\pi Ό\pi Έ\pi ½}$ is the minimum value of the collection of domain variables $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$, ignoring all variables that take 0 as value. When all variables of the collection $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ are assigned value 0, $\mathrm{\pi Ό\pi Έ\pi ½}$ is set to the default value $\mathrm{\pi ³\pi ΄\pi ΅\pi °\pi \pi »\pi }$.

Example
 $\left(\begin{array}{c}3,β©\begin{array}{c}\mathrm{\pi \pi \pi }-3,\hfill \\ \mathrm{\pi \pi \pi }-7,\hfill \\ \mathrm{\pi \pi \pi }-6,\hfill \\ \mathrm{\pi \pi \pi }-7,\hfill \\ \mathrm{\pi \pi \pi }-4,\hfill \\ \mathrm{\pi \pi \pi }-7\hfill \end{array}βͺ,1000000\hfill \end{array}\right)$ $\left(\begin{array}{c}2,β©\begin{array}{c}\mathrm{\pi \pi \pi }-3,\hfill \\ \mathrm{\pi \pi \pi }-2,\hfill \\ \mathrm{\pi \pi \pi }-0,\hfill \\ \mathrm{\pi \pi \pi }-7,\hfill \\ \mathrm{\pi \pi \pi }-2,\hfill \\ \mathrm{\pi \pi \pi }-6\hfill \end{array}βͺ,1000000\hfill \end{array}\right)$ $\left(\begin{array}{c}1000000,β©\begin{array}{c}\mathrm{\pi \pi \pi }-0,\hfill \\ \mathrm{\pi \pi \pi }-0,\hfill \\ \mathrm{\pi \pi \pi }-0,\hfill \\ \mathrm{\pi \pi \pi }-0,\hfill \\ \mathrm{\pi \pi \pi }-0,\hfill \\ \mathrm{\pi \pi \pi }-0\hfill \end{array}βͺ,1000000\hfill \end{array}\right)$

The three examples of the $\mathrm{\pi \pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi ‘\pi \pi \pi \pi }_\mathtt{0}$ constraint respectively hold since:

• Within the first example, $\mathrm{\pi Ό\pi Έ\pi ½}$ is set to the minimum value 3 of the collection $\beta ©3,7,6,7,4,7\beta ͺ$.

• Within the second example, $\mathrm{\pi Ό\pi Έ\pi ½}$ is set to the minimum value 2 (ignoring value 0) of the collection $\beta ©3,2,0,7,2,6\beta ͺ$.

• Finally within the third example, $\mathrm{\pi Ό\pi Έ\pi ½}$ is set to the default value 1000000 since all items of the collection $\beta ©0,0,0,0,0,0\beta ͺ$ are set to 0.

Symmetries
• Items of $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ are permutable.

• All occurrences of two distinct values of $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }$ can be swapped.

Remark

The joker value 0 makes sense only because we restrict the variables of the $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ collection to take non -negative values.

Reformulation

By (1)Β associating to each variable ${V}_{i}$ $\left(i\beta \left[1,|\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }|\right]\right)$ of the $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ collection a rank variable ${R}_{i}\beta \left[0,|\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }|-1\right]$ with the reified constraint ${R}_{i}=1\beta {V}_{i}=\mathrm{\pi Ό\pi Έ\pi ½}$, and by creating for each pair of variables ${V}_{i},{V}_{j}$ $\left(i,j the reified constraints

Β Β Β ${V}_{i}<{V}_{j}\beta {R}_{i}<{R}_{j}$,

Β Β Β ${V}_{i}={V}_{j}\beta {R}_{i}={R}_{j}$,

Β Β Β ${V}_{i}>{V}_{j}\beta {R}_{i}>{R}_{j}$,

and by (2)Β creating the reified constraint

Β Β Β ${V}_{1}=0\beta §{V}_{2}=0\beta §...\beta §{V}_{n}=0\beta \mathrm{\pi Ό\pi Έ\pi ½}=\mathrm{\pi ³\pi ΄\pi ΅\pi °\pi \pi »\pi }$,

one can reformulate the $\mathrm{\pi \pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi ‘\pi \pi \pi \pi }_\mathtt{0}$ constraint in term of $3Β·\frac{|\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }|Β·\left(|\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }|-1\right)}{2}+2$ reified constraints.

hard version: $\mathrm{\pi \pi \pi \pi \pi \pi \pi }$Β (value 0 is not ignored any more).

Keywords
Arc input(s)

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

Arc generator
$\mathrm{\pi Ά\pi Ώ\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)
 $\beta ’\beta \left(\begin{array}{c}\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 ’},\hfill \\ \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 }\hfill \end{array}\right)$
Graph property(ies)
$\mathrm{\pi \pi \pi \pi \pi }$$\left(0,\mathrm{\pi ³\pi ΄\pi ΅\pi °\pi \pi »\pi },\mathrm{\pi \pi \pi }\right)=\mathrm{\pi Ό\pi Έ\pi ½}$

Graph model

Because of the first two conditions of the arc constraint, all vertices that correspond to 0 will be removed from the final graph.

PartsΒ (A) andΒ (B) of FigureΒ 5.218.1 respectively show the initial and final graph of the second example of the Example slot. Since we use the $\mathrm{\pi \pi \pi \pi \pi }$ graph property, the vertices of rank 0 (without considering the loops) of the final graph are outlined with a thick circle.

Since the graph associated with the third example does not contain any vertex, $\mathrm{\pi \pi \pi \pi \pi }$ returns the default value $\mathrm{\pi ³\pi ΄\pi ΅\pi °\pi \pi »\pi }$.

Automaton

FigureΒ 5.218.2 depicts the automaton associated with the $\mathrm{\pi \pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi ‘\pi \pi \pi \pi }_\mathtt{0}$ constraint. Let ${\mathrm{\pi  \pi °\pi }}_{i}$ be the ${i}^{th}$ variable of the $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ collection. To each pair $\left(\mathrm{\pi Ό\pi Έ\pi ½},{\mathrm{\pi  \pi °\pi }}_{i}\right)$ corresponds a signature variable ${\mathrm{\pi }}_{i}$ as well as the following signature constraint:

$\left(\left({\mathrm{\pi  \pi °\pi }}_{i}=0\right)\beta §\left(\mathrm{\pi Ό\pi Έ\pi ½}=\mathrm{\pi ³\pi ΄\pi ΅\pi °\pi \pi »\pi }\right)\right)\beta {\mathrm{\pi }}_{i}=1\beta §$

.