2.5.18. Soft variant
Constraint is a soft variant of constraint .
Note that, from an academic point of view,
a soft constraint is usually defined with a cost variable that quantifies how much
the constraint is violated.
We exceptionally breaks this rule when it seems to make sense from an application point of view.
For instance, within the constraint, we reference the
since it can be seen as a kind
of relaxation of the constraint where we allow to use
value 0 several times.
EXAMPLE:
As an example,
one of the possible soft variant of
constraint
(i.e.,Β the constraint enforces all variables of a collection to take distinct values)
is the constraint ,
where the cost is the minimum number of variables that need to be unassigned
to satisfy the constraint.