## 5.51. big_peak

Origin
Constraint

$\mathrm{\pi \pi \pi }_\mathrm{\pi \pi \pi \pi }\left(\mathrm{\pi ½},\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\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)$ $\mathrm{\pi \pi Ύ\pi »\pi ΄\pi \pi °\pi ½\pi ²\pi ΄}$ $\mathrm{\pi \pi \pi }$
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)$ $\mathrm{\pi \pi Ύ\pi »\pi ΄\pi \pi °\pi ½\pi ²\pi ΄}\beta ₯0$
Purpose

A variable ${V}_{p}$ ($1) of the sequence of variables $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }={V}_{1},\beta ―,{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}=\beta ―={V}_{p}$ and ${V}_{p}>{V}_{p+1}$. Similarly 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}=\beta ―={V}_{v}$ and ${V}_{v}<{V}_{v+1}$. A peak variable ${V}_{p}$ ($1) is a potential big peak wrt a non-negative integer $\mathrm{\pi \pi Ύ\pi »\pi ΄\pi \pi °\pi ½\pi ²\pi ΄}$ if and only if:

1. ${V}_{p}$ is a peak,

2. $\beta i,j\beta \left[1,m\right]|i, ${V}_{i}$ is a valley (or $i=1$ if there is no valley before position $p$), ${V}_{j}$ is a valley (or $i=m$ if there is no valley after position $p$), ${V}_{p}-{V}_{i}>\mathrm{\pi \pi Ύ\pi »\pi ΄\pi \pi °\pi ½\pi ²\pi ΄}$, and ${V}_{p}-{V}_{j}>\mathrm{\pi \pi Ύ\pi »\pi ΄\pi \pi °\pi ½\pi ²\pi ΄}$.

Let ${i}_{p}$ and ${j}_{p}$ be the largest $i$ and the smallest $j$ satisfying conditionΒ 2. Now a potential big peak ${V}_{p}$ ($1) is a big peak if and only if the interval $\left[i,j\right]$ does not contain any potential big peak that is strictly higher than ${V}_{p}$. The constraint $\mathrm{\pi \pi \pi }_\mathrm{\pi \pi \pi \pi }$ holds if and only if $\mathrm{\pi ½}$ is the total number of big peaks of the sequence of variables $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$.

Example
 $\left(7,β©4,2,2,4,3,8,6,7,7,9,5,6,3,12,12,6,6,8,4,5,1βͺ,0\right)$ $\left(4,β©4,2,2,4,3,8,6,7,7,9,5,6,3,12,12,6,6,8,4,5,1βͺ,1\right)$

As shown part PartΒ (A) of FigureΒ 5.51.1, the first $\mathrm{\pi \pi \pi }_\mathrm{\pi \pi \pi \pi }$ constraint holds since the sequence $42243867795631212668451$ contains seven big peaks wrt a tolerance of 0 (i.e., we consider standard peaks).

As shown part PartΒ (B) of FigureΒ 5.51.1, the second $\mathrm{\pi \pi \pi }_\mathrm{\pi \pi \pi \pi }$ constraint holds since the same sequence $42243867795631212668451$ contains only four big peaks wrt a tolerance of 1.

Typical
 $\mathrm{\pi ½}\beta ₯1$ $|\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }|>6$ $\mathrm{\pi \pi \pi \pi \pi }$$\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }\right)>1$ $\mathrm{\pi \pi Ύ\pi »\pi ΄\pi \pi °\pi ½\pi ²\pi ΄}>1$
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 }$.

Arg. properties
• Functional dependency: $\mathrm{\pi ½}$ determined by $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ and $\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 ½}=0$ and $\mathrm{\pi \pi Ύ\pi »\pi ΄\pi \pi °\pi ½\pi ²\pi ΄}=0$.

Usage

Useful for constraining the number of big peaks of a sequence of domain variables, by ignoring too small valleys that artificially create small peaks wrt $\mathrm{\pi \pi Ύ\pi »\pi ΄\pi \pi °\pi ½\pi ²\pi ΄}$.

specialisation: $\mathrm{\pi \pi \pi \pi }$Β (the tolerance is set to 0 and removed).
FigureΒ 5.51.2 depicts the automaton associated with the $\mathrm{\pi \pi \pi }_\mathrm{\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 ${S}_{i}$. The following signature constraint links ${\mathrm{\pi  \pi °\pi }}_{i}$, ${\mathrm{\pi  \pi °\pi }}_{i+1}$ and ${S}_{i}$: $\left({\mathrm{\pi  \pi °\pi }}_{i}<{\mathrm{\pi  \pi °\pi }}_{i+1}\beta {S}_{i}=0\right)\beta §\left({\mathrm{\pi  \pi °\pi }}_{i}={\mathrm{\pi  \pi °\pi }}_{i+1}\beta {S}_{i}=1\right)\beta §\left({\mathrm{\pi  \pi °\pi }}_{i}>{\mathrm{\pi  \pi °\pi }}_{i+1}\beta {S}_{i}=2\right)$.