## 5.326. sum_ctr

 DESCRIPTION LINKS GRAPH
Origin

Arithmetic constraint.

Constraint

$\mathrm{𝚜𝚞𝚖}_\mathrm{𝚌𝚝𝚛}\left(\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂},\mathrm{𝙲𝚃𝚁},\mathrm{𝚅𝙰𝚁}\right)$

Synonyms

$\mathrm{𝚌𝚘𝚗𝚜𝚝𝚊𝚗𝚝}_\mathrm{𝚜𝚞𝚖}$, $\mathrm{𝚜𝚞𝚖}$, $\mathrm{𝚕𝚒𝚗𝚎𝚊𝚛}$, $\mathrm{𝚜𝚌𝚊𝚕𝚊𝚛}_\mathrm{𝚙𝚛𝚘𝚍𝚞𝚌𝚝}$.

Arguments
 $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}$ $\mathrm{𝚌𝚘𝚕𝚕𝚎𝚌𝚝𝚒𝚘𝚗}\left(\mathrm{𝚟𝚊𝚛}-\mathrm{𝚍𝚟𝚊𝚛}\right)$ $\mathrm{𝙲𝚃𝚁}$ $\mathrm{𝚊𝚝𝚘𝚖}$ $\mathrm{𝚅𝙰𝚁}$ $\mathrm{𝚍𝚟𝚊𝚛}$
Restrictions
 $\mathrm{𝚛𝚎𝚚𝚞𝚒𝚛𝚎𝚍}$$\left(\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂},\mathrm{𝚟𝚊𝚛}\right)$ $\mathrm{𝙲𝚃𝚁}\in \left[=,\ne ,<,\ge ,>,\le \right]$
Purpose

Constraint the sum of a set of domain variables. More precisely, let $𝚂$ denote the sum of the variables of the $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}$ collection (when the collection is empty the corresponding sum is equal to 0). Enforce the following constraint to hold: $𝚂\mathrm{𝙲𝚃𝚁}\mathrm{𝚅𝙰𝚁}$.

Example
$\left(〈1,1,4〉,=,6\right)$

The $\mathrm{𝚜𝚞𝚖}_\mathrm{𝚌𝚝𝚛}$ constraint holds since the condition $1+1+4=6$ is satisfied.

Symmetry

Items of $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}$ are permutable.

Remark

When $\mathrm{𝙲𝚃𝚁}$ corresponds to $=$ this constraint is referenced under the names $\mathrm{𝚌𝚘𝚗𝚜𝚝𝚊𝚗𝚝}_\mathrm{𝚜𝚞𝚖}$ in KOALOG (http://www.koalog.com/php/index.php) and $\mathrm{𝚜𝚞𝚖}$ in JaCoP (http://www.jacop.eu/).

Systems
Used in
See also

assignment dimension added: $\mathrm{𝚒𝚗𝚝𝚎𝚛𝚟𝚊𝚕}_\mathrm{𝚊𝚗𝚍}_\mathrm{𝚜𝚞𝚖}$ (assignment dimension corresponding to intervals is added).

generalisation: $\mathrm{𝚜𝚌𝚊𝚕𝚊𝚛}_\mathrm{𝚙𝚛𝚘𝚍𝚞𝚌𝚝}$ (arithmetic constraint where all coefficients are not necessarly equal to 1).

Keywords
Arc input(s)

$\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}$

Arc generator
$\mathrm{𝑆𝐸𝐿𝐹}$$↦\mathrm{𝚌𝚘𝚕𝚕𝚎𝚌𝚝𝚒𝚘𝚗}\left(\mathrm{𝚟𝚊𝚛𝚒𝚊𝚋𝚕𝚎𝚜}\right)$

Arc arity
Arc constraint(s)
$\mathrm{𝚃𝚁𝚄𝙴}$
Graph property(ies)
$\mathrm{𝐒𝐔𝐌}$$\left(\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂},\mathrm{𝚟𝚊𝚛}\right)\mathrm{𝙲𝚃𝚁}\mathrm{𝚅𝙰𝚁}$

Graph model

Since we want to keep all the vertices of the initial graph we use the $\mathrm{𝑆𝐸𝐿𝐹}$ arc generator together with the $\mathrm{𝚃𝚁𝚄𝙴}$ arc constraint. This predefined arc constraint always holds.

Parts (A) and (B) of Figure 5.326.1 respectively show the initial and final graph associated with the Example slot. Since we use the $\mathrm{𝚃𝚁𝚄𝙴}$ arc constraint both graphs are identical.

##### Figure 5.326.1. Initial and final graph of the $\mathrm{𝚜𝚞𝚖}_\mathrm{𝚌𝚝𝚛}$ constraint  (a) (b)