### 2.6.19. Soft variant

Constraint ${C}_{\mathrm{𝑎𝑙𝑠𝑜}}$ is a soft variant of constraint ${C}_{\mathrm{𝑒𝑛𝑡𝑟𝑦}}$. Note that, from an academic point of view, a soft constraint ${C}_{\mathrm{𝑎𝑙𝑠𝑜}}=$ is usually defined with a cost variable that quantifies how much the constraint ${C}_{\mathrm{𝑒𝑛𝑡𝑟𝑦}}=$ is violated. We exceptionally breaks this rule when it seems to make sense from an application point of view. For instance, within the $\mathrm{𝚊𝚕𝚕𝚍𝚒𝚏𝚏𝚎𝚛𝚎𝚗𝚝}$ constraint, we reference the $\mathrm{𝚊𝚕𝚕𝚍𝚒𝚏𝚏𝚎𝚛𝚎𝚗𝚝}_\mathrm{𝚎𝚡𝚌𝚎𝚙𝚝}_\mathtt{0}$ since it can be seen as a kind of relaxation of the $\mathrm{𝚊𝚕𝚕𝚍𝚒𝚏𝚏𝚎𝚛𝚎𝚗𝚝}$ constraint where we allow to use value 0 several times.

EXAMPLE: As an example, one of the possible soft variants of constraint ${C}_{\mathrm{𝑒𝑛𝑡𝑟𝑦}}=$ $\mathrm{𝚊𝚕𝚕𝚍𝚒𝚏𝚏𝚎𝚛𝚎𝚗𝚝}$ (i.e., the $\mathrm{𝚊𝚕𝚕𝚍𝚒𝚏𝚏𝚎𝚛𝚎𝚗𝚝}$ constraint forces all variables of a collection to take distinct values) is the constraint ${C}_{\mathrm{𝑎𝑙𝑠𝑜}}=$ $\mathrm{𝚜𝚘𝚏𝚝}_\mathrm{𝚊𝚕𝚕𝚍𝚒𝚏𝚏𝚎𝚛𝚎𝚗𝚝}_\mathrm{𝚟𝚊𝚛}$, where the cost is the minimum number of variables that need to be assigned differently to satisfy the $\mathrm{𝚊𝚕𝚕𝚍𝚒𝚏𝚏𝚎𝚛𝚎𝚗𝚝}$ constraint.