## 5.111. distance_change

Origin
Constraint

$\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi \pi }\left(\mathrm{\pi ³\pi Έ\pi \pi },\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\mathtt{1},\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\mathtt{2},\mathrm{\pi ²\pi \pi }\right)$

Synonym

$\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi }$.

Arguments
 $\mathrm{\pi ³\pi Έ\pi \pi }$ $\mathrm{\pi \pi \pi \pi }$ $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\mathtt{1}$ $\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 }\mathtt{2}$ $\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 }\beta ₯0$ $\mathrm{\pi ³\pi Έ\pi \pi }<|\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\mathtt{1}|$ $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi }$$\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\mathtt{1},\mathrm{\pi \pi \pi }\right)$ $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi }$$\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\mathtt{2},\mathrm{\pi \pi \pi }\right)$ $|\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\mathtt{1}|=|\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\mathtt{2}|$
Purpose

$\mathrm{\pi ³\pi Έ\pi \pi }$ is equal to the number of times one of the following two conditions is true $\left(1\beta €i:

• $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\mathtt{1}\left[i\right].\mathrm{\pi \pi \pi }\mathrm{\pi ²\pi \pi }\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\mathtt{1}\left[i+1\right].\mathrm{\pi \pi \pi }$ holds and $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\mathtt{2}\left[i\right].\mathrm{\pi \pi \pi }\mathrm{\pi ²\pi \pi }\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\mathtt{2}\left[i+1\right].\mathrm{\pi \pi \pi }$ does not hold,

• $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\mathtt{2}\left[i\right].\mathrm{\pi \pi \pi }\mathrm{\pi ²\pi \pi }\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\mathtt{2}\left[i+1\right].\mathrm{\pi \pi \pi }$ holds and $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\mathtt{1}\left[i\right].\mathrm{\pi \pi \pi }\mathrm{\pi ²\pi \pi }\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\mathtt{1}\left[i+1\right].\mathrm{\pi \pi \pi }$ does not hold.

Example

The $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi \pi }$ constraint holds since the following condition ($\mathrm{\pi ³\pi Έ\pi \pi }=1$) is verified: .

Typical
 $\mathrm{\pi ³\pi Έ\pi \pi }>0$ $|\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\mathtt{1}|>1$
Symmetries
• Arguments are permutable w.r.t. permutation $\left(\mathrm{\pi ³\pi Έ\pi \pi }\right)$ $\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\mathtt{1},\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\mathtt{2}\right)$ $\left(\mathrm{\pi ²\pi \pi }\right)$.

• 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 }\mathtt{1}$.

• 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 }\mathtt{2}$.

Usage

Measure the distance between two sequences according to the $\mathrm{\pi \pi \pi \pi \pi \pi }$ constraint.

Remark

We measure that distance with respect to a given constraint and not according to the fact that the variables are assigned distinct values.

Keywords
Arc input(s)

$\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\mathtt{1}$/ $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\mathtt{2}$

Arc generator
$\mathrm{\pi \pi ΄\pi \pi »}$$\beta ¦\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }\left(\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi }\mathtt{1},\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi }\mathtt{2}\right)$

Arc arity
Arc constraint(s)
$\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi }\mathtt{1}.\mathrm{\pi \pi \pi }\mathrm{\pi ²\pi \pi }\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi }\mathtt{2}.\mathrm{\pi \pi \pi }$
Graph property(ies)
$\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi }$$=\mathrm{\pi ³\pi Έ\pi \pi }$

Graph model

Within the Arc input(s) slot, the character / indicates that we generate two distinct graphs. The graph property $\mathrm{\pi ³\pi Έ\pi \pi \pi °\pi ½\pi ²\pi ΄}$ measures the distance between two digraphs ${G}_{1}$ and ${G}_{2}$. This distance is defined as the sum of the following quantities:

• The number of arcs of ${G}_{1}$ that do not belong to ${G}_{2}$,

• The number of arcs of ${G}_{2}$ that do not belong to ${G}_{1}$.

PartΒ (A) of FigureΒ 5.111.1 gives the final graph associated with the sequence $\mathrm{\pi \pi \pi }$-3,$\mathrm{\pi \pi \pi }$-3,$\mathrm{\pi \pi \pi }$-1,$\mathrm{\pi \pi \pi }$-2,$\mathrm{\pi \pi \pi }$-2 (i.e.,Β the second argument of the constraint of the Example slot), while partΒ (B) shows the final graph corresponding to $\mathrm{\pi \pi \pi }$-4,$\mathrm{\pi \pi \pi }$-4,$\mathrm{\pi \pi \pi }$-3,$\mathrm{\pi \pi \pi }$-3,$\mathrm{\pi \pi \pi }$-3 (i.e.,Β the third argument of the constraint of the Example slot). Since arc $3\beta 4$ belongs to the first final graph but not to the second one, the distance between the two final graphs is equal to 1.

Automaton

FigureΒ 5.111.2 depicts the automaton associated with the $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi \pi }$ constraint. Let $\left(\mathrm{\pi  \pi °\pi }{\mathtt{1}}_{i},\mathrm{\pi  \pi °\pi }{\mathtt{1}}_{i+1}\right)$ and $\left(\mathrm{\pi  \pi °\pi }{\mathtt{2}}_{i},\mathrm{\pi  \pi °\pi }{\mathtt{2}}_{i+1}\right)$ respectively be the ${i}^{th}$ pairs of consecutive variables of the collections $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\mathtt{1}$ and $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\mathtt{2}$. To each quadruple $\left(\mathrm{\pi  \pi °\pi }{\mathtt{1}}_{i},\mathrm{\pi  \pi °\pi }{\mathtt{1}}_{i+1},\mathrm{\pi  \pi °\pi }{\mathtt{2}}_{i},\mathrm{\pi  \pi °\pi }{\mathtt{2}}_{i+1}\right)$ corresponds a 0-1 signature variable ${\mathrm{\pi }}_{i}$. The following signature constraint links these variables:

.