5.269. 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},...,{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}...{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,...,m-\mathrm{\pi Ώ\pi ΄\pi \pi Έ\pi Ύ\pi ³}-1$.

Example
$\left(\begin{array}{c}3,β©\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 }-1,\hfill \\ \mathrm{\pi \pi \pi }-1,\hfill \\ \mathrm{\pi \pi \pi }-0,\hfill \\ \mathrm{\pi \pi \pi }-1,\hfill \\ \mathrm{\pi \pi \pi }-1\hfill \end{array}βͺ,=\hfill \end{array}\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.269.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.

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.

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].