## 5.350. valley

Origin
Constraint

$\mathrm{\pi \pi \pi \pi \pi \pi ’}\left(\mathrm{\pi ½},\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\right)$

Arguments
 $\mathrm{\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 ½}\beta ₯0$ $2*\mathrm{\pi ½}\beta €\mathrm{\pi \pi \pi ‘}\left(|\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }|-1,0\right)$ $\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

A variable ${V}_{k}$ $\left(1 of the sequence of variables $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }={V}_{1},...,{V}_{m}$ is a valley if and only if there exists an $i$ $\left(1 such that ${V}_{i-1}>{V}_{i}$ and ${V}_{i}={V}_{i+1}=...={V}_{k}$ and ${V}_{k}<{V}_{k+1}$. $\mathrm{\pi ½}$ is the total number of valleys of the sequence of variables $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$.

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

The $\mathrm{\pi \pi \pi \pi \pi \pi ’}$ constraint holds since the sequence $11488271$ contains one valley that corresponds to the variable that is assigned to value 2.

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

• One and the same constant can be added to the $\mathrm{\pi \pi \pi }$ attribute of all items of $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$.

Usage

Useful for constraining the number of valleys of a sequence of domain variables.

Remark

Since the arity of the arc constraint is not fixed, the $\mathrm{\pi \pi \pi \pi \pi \pi ’}$ constraint cannot be currently described. However, this would not hold anymore if we were introducing a slot that specifies how to merge adjacent vertices of the final graph.

specialisation: $\mathrm{\pi \pi }_\mathrm{\pi \pi \pi \pi \pi \pi ’}$Β (the variable counting the number of valleys is set to 0 and removed).
FigureΒ 5.350.2 depicts the automaton associated with the $\mathrm{\pi \pi \pi \pi \pi \pi ’}$ constraint. To each pair of consecutive variables $\left({\mathrm{\pi  \pi °\pi }}_{i},{\mathrm{\pi  \pi °\pi }}_{i+1}\right)$ of the collection $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ corresponds a signature variable ${\mathrm{\pi }}_{i}$. The following signature constraint links ${\mathrm{\pi  \pi °\pi }}_{i}$, ${\mathrm{\pi  \pi °\pi }}_{i+1}$ and ${\mathrm{\pi }}_{i}$: $\left({\mathrm{\pi  \pi °\pi }}_{i}<{\mathrm{\pi  \pi °\pi }}_{i+1}\beta {\mathrm{\pi }}_{i}=0\right)\beta §\left({\mathrm{\pi  \pi °\pi }}_{i}={\mathrm{\pi  \pi °\pi }}_{i+1}\beta {\mathrm{\pi }}_{i}=1\right)\beta §\left({\mathrm{\pi  \pi °\pi }}_{i}>{\mathrm{\pi  \pi °\pi }}_{i+1}\beta {\mathrm{\pi }}_{i}=2\right)$.