## 5.52. big_valley

Origin

Derived from $\mathrm{𝚟𝚊𝚕𝚕𝚎𝚢}$.

Constraint

$\mathrm{𝚋𝚒𝚐}_\mathrm{𝚟𝚊𝚕𝚕𝚎𝚢}\left(𝙽,\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂},\mathrm{𝚃𝙾𝙻𝙴𝚁𝙰𝙽𝙲𝙴}\right)$

Arguments
 $𝙽$ $\mathrm{𝚍𝚟𝚊𝚛}$ $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}$ $\mathrm{𝚌𝚘𝚕𝚕𝚎𝚌𝚝𝚒𝚘𝚗}\left(\mathrm{𝚟𝚊𝚛}-\mathrm{𝚍𝚟𝚊𝚛}\right)$ $\mathrm{𝚃𝙾𝙻𝙴𝚁𝙰𝙽𝙲𝙴}$ $\mathrm{𝚒𝚗𝚝}$
Restrictions
 $𝙽\ge 0$ $2*𝙽\le \mathrm{𝚖𝚊𝚡}\left(|\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}|-1,0\right)$ $\mathrm{𝚛𝚎𝚚𝚞𝚒𝚛𝚎𝚍}$$\left(\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂},\mathrm{𝚟𝚊𝚛}\right)$ $\mathrm{𝚃𝙾𝙻𝙴𝚁𝙰𝙽𝙲𝙴}\ge 0$
Purpose

A variable ${V}_{v}$ ($1) 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}=\cdots ={V}_{v}$ and ${V}_{v}<{V}_{v+1}$. Similarly a variable ${V}_{p}$ ($1) of the sequence of variables $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}={V}_{1},\cdots ,{V}_{m}$ is a peak if and only if there exists an $i$ ($1) such that ${V}_{i-1}<{V}_{i}$ and ${V}_{i}={V}_{i+1}=\cdots ={V}_{p}$ and ${V}_{p}>{V}_{p+1}$. A valley variable ${V}_{v}$ ($1) is a potential big valley wrt a non-negative integer $\mathrm{𝚃𝙾𝙻𝙴𝚁𝙰𝙽𝙲𝙴}$ if and only if:

1. ${V}_{v}$ is a valley,

2. $\exists i,j\in \left[1,m\right]|i, ${V}_{i}$ is a peak (or $i=1$ if there is no peak before position $p$), ${V}_{j}$ is a peak (or $i=m$ if there is no peak after position $p$), ${V}_{i}-{V}_{v}>\mathrm{𝚃𝙾𝙻𝙴𝚁𝙰𝙽𝙲𝙴}$, and ${V}_{j}-{V}_{v}>\mathrm{𝚃𝙾𝙻𝙴𝚁𝙰𝙽𝙲𝙴}$.

Let ${i}_{v}$ and ${j}_{v}$ be the largest $i$ and the smallest $j$ satisfying condition 2. Now a potential big valley ${V}_{v}$ ($1) is a big valley if and only if the interval $\left[i,j\right]$ does not contain any potential big valley that is strictly less than ${V}_{v}$. The constraint $\mathrm{𝚋𝚒𝚐}_\mathrm{𝚟𝚊𝚕𝚕𝚎𝚢}$ holds if and only if $𝙽$ is the total number of big valleys of the sequence of variables $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}$.

Example
 $\left(7,〈9,11,11,9,10,5,7,6,6,4,8,7,10,1,1,7,7,5,9,8,12〉,0\right)$ $\left(4,〈9,11,11,9,10,5,7,6,6,4,8,7,10,1,1,7,7,5,9,8,12〉,1\right)$

As shown part Part (A) of Figure 5.52.1, the first $\mathrm{𝚋𝚒𝚐}_\mathrm{𝚟𝚊𝚕𝚕𝚎𝚢}$ constraint holds since the sequence $91111910576648710117759812$ contains seven big valleys wrt a tolerance of 0 (i.e., we consider standard valleys).

As shown part Part (B) of Figure 5.52.1, the second $\mathrm{𝚋𝚒𝚐}_\mathrm{𝚟𝚊𝚕𝚕𝚎𝚢}$ constraint holds since the same sequence $91111910576648710117759812$ contains only four big valleys wrt a tolerance of 1.

##### Figure 5.52.1. Illustration of the Example slot: Part (A) a sequence of 21 variables ${V}_{1}$, ${V}_{2}$, ..., ${V}_{21}$ respectively fixed to values 9, 11, 11, 9, 10, 5, 7, 6, 6, 4, 8, 7, 10, 1, 1, 7, 7, 5, 9, 8, 12 and its corresponding 7 valleys ($\mathrm{𝚃𝙾𝙻𝙴𝚁𝙰𝙽𝙲𝙴}=0$ corresponds to standard valleys) with their respective depths ${d}_{1}^{0}=1$, ${d}_{2}^{0}=2$, ${d}_{3}^{0}=3$, ${d}_{4}^{0}=1$, ${d}_{5}^{0}=6$, ${d}_{6}^{0}=2$, ${d}_{7}^{0}=1$ (the left and right hand sides of each valley are coloured in light orange and light red) Part (B) the same sequence of variables and its 4 big valleys when $\mathrm{𝚃𝙾𝙻𝙴𝚁𝙰𝙽𝙲𝙴}=1$ with their respective depths ${d}_{1}^{1}=2$, ${d}_{2}^{1}=3$, ${d}_{3}^{1}=6$, ${d}_{4}^{1}=2$ Typical
 $𝙽\ge 1$ $|\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}|>6$ $\mathrm{𝚛𝚊𝚗𝚐𝚎}$$\left(\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}.\mathrm{𝚟𝚊𝚛}\right)>1$ $\mathrm{𝚃𝙾𝙻𝙴𝚁𝙰𝙽𝙲𝙴}>1$
Symmetries
• Items of $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}$ can be reversed.

• One and the same constant can be added to the $\mathrm{𝚟𝚊𝚛}$ attribute of all items of $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}$.

Arg. properties
• Functional dependency: $𝙽$ determined by $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}$ and $\mathrm{𝚃𝙾𝙻𝙴𝚁𝙰𝙽𝙲𝙴}$.

• Contractible wrt. $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}$ when $𝙽=0$ and $\mathrm{𝚃𝙾𝙻𝙴𝚁𝙰𝙽𝙲𝙴}=0$.

Usage

Useful for constraining the number of big valleys of a sequence of domain variables, by ignoring too small peaks that artificially create small valleys wrt $\mathrm{𝚃𝙾𝙻𝙴𝚁𝙰𝙽𝙲𝙴}$.

specialisation: $\mathrm{𝚟𝚊𝚕𝚕𝚎𝚢}$ (the tolerance is set to 0 and removed).
Figure 5.52.2 depicts the automaton associated with the $\mathrm{𝚋𝚒𝚐}_\mathrm{𝚟𝚊𝚕𝚕𝚎𝚢}$ constraint. To each pair of consecutive variables $\left({\mathrm{𝚅𝙰𝚁}}_{i},{\mathrm{𝚅𝙰𝚁}}_{i+1}\right)$ of the collection $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}$ corresponds a signature variable ${S}_{i}$. The following signature constraint links ${\mathrm{𝚅𝙰𝚁}}_{i}$, ${\mathrm{𝚅𝙰𝚁}}_{i+1}$ and ${S}_{i}$: $\left({\mathrm{𝚅𝙰𝚁}}_{i}<{\mathrm{𝚅𝙰𝚁}}_{i+1}⇔{S}_{i}=0\right)\wedge \left({\mathrm{𝚅𝙰𝚁}}_{i}={\mathrm{𝚅𝙰𝚁}}_{i+1}⇔{S}_{i}=1\right)\wedge \left({\mathrm{𝚅𝙰𝚁}}_{i}>{\mathrm{𝚅𝙰𝚁}}_{i+1}⇔{S}_{i}=2\right)$.
##### Figure 5.52.2. Automaton for the $\mathrm{𝚋𝚒𝚐}_\mathrm{𝚟𝚊𝚕𝚕𝚎𝚢}$ where $C$, $S$, $V$, $\mathrm{𝑚𝑎𝑥}$ and $\Delta$ respectively stand for the number of big valleys already encountered, the altitude at the start of the current potential big valley, the altitude of the current potential big valley, the largest value that can be assigned to a variable of $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}$, the $\mathrm{𝚃𝙾𝙻𝙴𝚁𝙰𝙽𝙲𝙴}$ parameter 