5.302. soft_same_var
| DESCRIPTION | LINKS | GRAPH |
- Origin
- Constraint
soft_same_var(C,VARIABLES1,VARIABLES2)
- Synonym(s)
- Argument(s)
-
C dvar VARIABLES1 collection(var−dvar) VARIABLES2 collection(var−dvar) - Restriction(s)
-
C≥0 C≤|VARIABLES1| |VARIABLES1|=|VARIABLES2| required(VARIABLES1,var) required(VARIABLES2,var) - Purpose
C is the minimum number of values to change in the VARIABLES1 and VARIABLES2 collections so that the variables of the VARIABLES2 collection correspond to the variables of the VARIABLES1 collection according to a permutation.
- Example
-
(
)4,〈9,9,9,9,9,1〉, 〈9,1,1,1,1,8〉 As illustrated by Figure 5.302.1, there is a correspondence between two pairs of values of the collections 〈9,9,9,9,9,1〉 and 〈9,1,1,1,1,8〉. Consequently, we must unset at least 6−2 items (6 is the number of items of the VARIABLES1 and VARIABLES2 collections). The soft_same_var constraint holds since its first argument C is set to 6−2.
Figure 5.302.1. Correspondence between collection 〈9,9,9,9,9,1〉 and collection 〈9,1,1,1,1,8〉

- Usage
A soft same constraint.
- Algorithm
- See also
same.
- Key words
constraint arguments: constraint between two collections of variables.
constraint type: soft constraint, relaxation, variable-based violation measure.
- Arc input(s)
VARIABLES1 VARIABLES2
- Arc generator
-
PRODUCT↦collection(variables1,variables2) - Arc arity
-
2 - Arc constraint(s)
-
variables1.var=variables2.var - Graph property(ies)
-
NSINK_NSOURCE=|VARIABLES1|−C
- Graph model
Parts (A) and (B) of Figure 5.302.2 respectively show the initial and final graph associated with the Example slot. Since we use the NSINK_NSOURCE graph property, the source and sink vertices of the final graph are stressed with a double circle. The soft_same_var constraint holds since the cost 4 corresponds to the difference between the number of variables of VARIABLES1 and the sum over the different connected components of the minimum number of sources and sinks.
Figure 5.302.2. Initial and final graph of the soft_same_var constraint

(a) 
(b)