## 5.320. period_except_0

Origin
Constraint

$\mathrm{\pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi ‘\pi \pi \pi \pi }_\mathtt{0}\left(\mathrm{\pi Ώ\pi ΄\pi \pi Έ\pi Ύ\pi ³},\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi },\mathrm{\pi ²\pi \pi }\right)$

Arguments
 $\mathrm{\pi Ώ\pi ΄\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)$ $\mathrm{\pi ²\pi \pi }$ $\mathrm{\pi \pi \pi \pi }$
Restrictions
 $\mathrm{\pi Ώ\pi ΄\pi \pi Έ\pi Ύ\pi ³}\beta ₯1$ $\mathrm{\pi Ώ\pi ΄\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

Let us note ${V}_{0},{V}_{1},\beta ―,{V}_{m-1}$ the variables of the $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ collection. $\mathrm{\pi Ώ\pi ΄\pi \pi Έ\pi Ύ\pi ³}$ is the period of the sequence ${V}_{0}{V}_{1}\beta ―{V}_{m-1}$ according to constraint $\mathrm{\pi ²\pi \pi }$. This means that $\mathrm{\pi Ώ\pi ΄\pi \pi Έ\pi Ύ\pi ³}$ is the smallest natural number such that ${V}_{i}\mathrm{\pi ²\pi \pi }{V}_{i+\mathrm{\pi Ώ\pi ΄\pi \pi Έ\pi Ύ\pi ³}}\beta ¨{V}_{i}=0\beta ¨{V}_{i+\mathrm{\pi Ώ\pi ΄\pi \pi Έ\pi Ύ\pi ³}}=0$ holds for all $i\beta 0,1,\beta ―,m-\mathrm{\pi Ώ\pi ΄\pi \pi Έ\pi Ύ\pi ³}-1$.

Example
$\left(3,β©1,1,4,1,1,0,1,1βͺ,=\right)$

The $\mathrm{\pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi ‘\pi \pi \pi \pi }_\mathtt{0}$ constraint holds since, as depicted by FigureΒ 5.320.1, its first argument $\mathrm{\pi Ώ\pi ΄\pi \pi Έ\pi Ύ\pi ³}=3$ is equal (i.e.,Β since $\mathrm{\pi ²\pi \pi }$ is set to $=$) to the period of the sequence $11411011$; value 0 is assumed to be equal to any other value.

Typical
 $\mathrm{\pi Ώ\pi ΄\pi \pi Έ\pi Ύ\pi ³}>1$ $\mathrm{\pi Ώ\pi ΄\pi \pi Έ\pi Ύ\pi ³}<|\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }|$ $|\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }|>2$ $\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 }$$\left(1,\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi },0\right)$ $\mathrm{\pi ²\pi \pi }\beta \left[=\right]$
Symmetries
• Items of $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ can be reversed.

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

• All occurrences of two distinct values of $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }$ that are both different from 0 can be swapped; all occurrences 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 renamed to any unused value that is also different from 0.

Arg. properties
• Functional dependency: $\mathrm{\pi Ώ\pi ΄\pi \pi Έ\pi Ύ\pi ³}$ determined by $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ and $\mathrm{\pi ²\pi \pi }$.

• Contractible wrt. $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ when $\mathrm{\pi ²\pi \pi }\beta \left[=\right]$ and $\mathrm{\pi Ώ\pi ΄\pi \pi Έ\pi Ύ\pi ³}=1$.

• Prefix-contractible wrt. $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$.

• Suffix-contractible wrt. $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$.

Usage

Useful for timetabling problems where a person should repeat some work pattern over an over except when he is unavailable for some reason. The value 0 represents the fact that he is unavailable, while the other values are used in the work pattern.

Algorithm

SeeΒ [BeldiceanuPoder04].