## 5.384. sum_ctr

 DESCRIPTION LINKS GRAPH
Origin

Arithmetic constraint.

Constraint

$\mathrm{\pi \pi \pi }_\mathrm{\pi \pi \pi }\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi },\mathrm{\pi ²\pi \pi },\mathrm{\pi  \pi °\pi }\right)$

Synonyms

$\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi }$, $\mathrm{\pi \pi \pi }$, $\mathrm{\pi \pi \pi \pi \pi \pi }$, $\mathrm{\pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi \pi \pi }$.

Arguments
 $\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 }$ $\mathrm{\pi  \pi °\pi }$ $\mathrm{\pi \pi \pi \pi }$
Restrictions
 $\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

Constraint the sum of a set of domain variables. More precisely, let $\mathrm{\pi }$ denote the sum of the variables of the $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ collection (when the collection is empty the corresponding sum is equal to 0). Enforce the following constraint to hold: $\mathrm{\pi }\mathrm{\pi ²\pi \pi }\mathrm{\pi  \pi °\pi }$.

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

The $\mathrm{\pi \pi \pi }_\mathrm{\pi \pi \pi }$ constraint holds since the condition $1+1+4=6$ is satisfied.

Typical
 $|\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }|>1$ $\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 }\beta \left[=,<,\beta ₯,>,\beta €\right]$
Symmetry

Items of $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ are permutable.

Arg. properties
• Contractible wrt. $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ when $\mathrm{\pi ²\pi \pi }\beta \left[<,\beta €\right]$ and $\mathrm{\pi \pi \pi \pi \pi \pi }\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }\right)\beta ₯0$.

• Contractible wrt. $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ when $\mathrm{\pi ²\pi \pi }\beta \left[\beta ₯,>\right]$ and $\mathrm{\pi \pi \pi ‘\pi \pi \pi }\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }\right)\beta €0$.

• Extensible wrt. $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ when $\mathrm{\pi ²\pi \pi }\beta \left[\beta ₯,>\right]$ and $\mathrm{\pi \pi \pi \pi \pi \pi }\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }\right)\beta ₯0$.

• Extensible wrt. $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ when $\mathrm{\pi ²\pi \pi }\beta \left[<,\beta €\right]$ and $\mathrm{\pi \pi \pi ‘\pi \pi \pi }\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }\right)\beta €0$.

• Aggregate: $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\left(\mathrm{\pi \pi \pi \pi \pi }\right)$, $\mathrm{\pi ²\pi \pi }\left(\mathrm{\pi \pi }\right)$, $\mathrm{\pi  \pi °\pi }\left(+\right)$.

Remark

When $\mathrm{\pi ²\pi \pi }$ corresponds to $=$ this constraint is referenced under the names $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi }$ in KOALOG (http://www.koalog.com/php/index.php) and $\mathrm{\pi \pi \pi }$ in JaCoP (http://www.jacop.eu/).

Systems
Used in
See also

generalisation: $\mathrm{\pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi \pi \pi }$Β (arithmetic constraint where all coefficients are not necessarly equal to 1).

Keywords
Cond. implications

$\beta ’$ $\mathrm{\pi \pi \pi }_\mathrm{\pi \pi \pi }\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi },\mathrm{\pi ²\pi \pi },\mathrm{\pi  \pi °\pi }\right)$

Β Β Β  withΒ  $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }\beta ₯0$

Β Β Β  andΒ Β  $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }\beta €1$

Β Β implies $\mathrm{\pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi }$$\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi },\mathrm{\pi ²\pi \pi },\mathrm{\pi  \pi °\pi }\right)$

Β Β Β  whenΒ  $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }\beta ₯0$

Β Β Β  andΒ Β  $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }\beta €1$.

$\beta ’$ $\mathrm{\pi \pi \pi }_\mathrm{\pi \pi \pi }\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi },\mathrm{\pi ²\pi \pi },\mathrm{\pi  \pi °\pi }\right)$

Β Β Β  withΒ  $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }\beta ₯-1$

Β Β Β  andΒ Β  $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }\beta €1$

Β Β implies $\mathrm{\pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi }$$\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi },\mathrm{\pi ²\pi \pi },\mathrm{\pi  \pi °\pi }\right)$

Β Β Β  whenΒ  $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }\beta ₯-1$

Β Β Β  andΒ Β  $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }\beta €1$.

$\beta ’$ $\mathrm{\pi \pi \pi }_\mathrm{\pi \pi \pi }\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi },\mathrm{\pi ²\pi \pi },\mathrm{\pi  \pi °\pi }\right)$

Β Β Β  withΒ  $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }\beta ₯-1$

Β Β Β  andΒ Β  $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }\beta €1$

Β Β implies $\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi },\mathrm{\pi ²\pi \pi },\mathrm{\pi  \pi °\pi }\right)$

Β Β Β  whenΒ  $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }\beta ₯-1$

Β Β Β  andΒ Β  $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }\beta €1$.

$\beta ’$ $\mathrm{\pi \pi \pi }_\mathrm{\pi \pi \pi }\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi },\mathrm{\pi ²\pi \pi },\mathrm{\pi  \pi °\pi }\right)$

Β Β Β  withΒ  $\mathrm{\pi ²\pi \pi }\beta \left[=\right]$

Β Β Β  andΒ Β  $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }$$\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\right)$

Β Β implies $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi }$$\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi },\mathrm{\pi  \pi °\pi }\right)$.

Arc input(s)

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

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 }\right)$

Arc arity
Arc constraint(s)
$\mathrm{\pi \pi \pi \pi ΄}$
Graph property(ies)
$\mathrm{\pi \pi \pi }$$\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi },\mathrm{\pi \pi \pi }\right)\mathrm{\pi ²\pi \pi }\mathrm{\pi  \pi °\pi }$

Graph model

Since we want to keep all the vertices of the initial graph we use the $\mathrm{\pi \pi Έ\pi Ώ\pi Ή}$ arc generator together with the $\mathrm{\pi \pi \pi \pi ΄}$ arc constraint. This predefined arc constraint always holds.

PartsΒ (A) andΒ (B) of FigureΒ 5.384.1 respectively show the initial and final graph associated with the Example slot. Since we use the $\mathrm{\pi \pi \pi \pi ΄}$ arc constraint both graphs are identical.