5.420. weighted_partial_alldiff

DESCRIPTIONLINKSGRAPH
Origin

[Thiel04]

Constraint

πš πšŽπš’πšπš‘πšπšŽπš_πš™πšŠπš›πšπš’πšŠπš•_πšŠπš•πš•πšπš’πšπš(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚,πš„π™½π™³π™΄π™΅π™Έπ™½π™΄π™³,πš…π™°π™»πš„π™΄πš‚,π™²π™Ύπš‚πšƒ)

Synonyms

πš πšŽπš’πšπš‘πšπšŽπš_πš™πšŠπš›πšπš’πšŠπš•_πšŠπš•πš•πšπš’πšπšπšŽπš›πšŽπš—πš, πš πšŽπš’πšπš‘πšπšŽπš_πš™πšŠπš›πšπš’πšŠπš•_πšŠπš•πš•πšπš’πšœπšπš’πš—πšŒπš, πš πš™πšŠ.

Arguments
πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(πšŸπšŠπš›-πšπšŸπšŠπš›)
πš„π™½π™³π™΄π™΅π™Έπ™½π™΄π™³πš’πš—πš
πš…π™°π™»πš„π™΄πš‚πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(πšŸπšŠπš•-πš’πš—πš,πš πšŽπš’πšπš‘πš-πš’πš—πš)
π™²π™Ύπš‚πšƒπšπšŸπšŠπš›
Restrictions
πš›πšŽπššπšžπš’πš›πšŽπš(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚,πšŸπšŠπš›)
|πš…π™°π™»πš„π™΄πš‚|>0
πš›πšŽπššπšžπš’πš›πšŽπš(πš…π™°π™»πš„π™΄πš‚,[πšŸπšŠπš•,πš πšŽπš’πšπš‘πš])
πš’πš—_πšŠπšπšπš›(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚,πšŸπšŠπš›,πš…π™°π™»πš„π™΄πš‚,πšŸπšŠπš•)
πšπš’πšœπšπš’πš—πšŒπš(πš…π™°π™»πš„π™΄πš‚,πšŸπšŠπš•)
Purpose

All variables of the πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ collection that are not assigned to value πš„π™½π™³π™΄π™΅π™Έπ™½π™΄π™³ must have pairwise distinct values from the πšŸπšŠπš• attribute of the πš…π™°π™»πš„π™΄πš‚ collection. In addition π™²π™Ύπš‚πšƒ is the sum of the πš πšŽπš’πšπš‘πš attributes associated with the values assigned to the variables of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚. Within the πš…π™°π™»πš„π™΄πš‚ collection, value πš„π™½π™³π™΄π™΅π™Έπ™½π™΄π™³ must be explicitly defined with a weight of 0.

Example
4,0,1,2,0,0,0,πšŸπšŠπš•-0πš πšŽπš’πšπš‘πš-0,πšŸπšŠπš•-1πš πšŽπš’πšπš‘πš-2,πšŸπšŠπš•-2πš πšŽπš’πšπš‘πš--1,πšŸπšŠπš•-4πš πšŽπš’πšπš‘πš-7,πšŸπšŠπš•-5πš πšŽπš’πšπš‘πš--8,πšŸπšŠπš•-6πš πšŽπš’πšπš‘πš-2,8

The πš πšŽπš’πšπš‘πšπšŽπš_πš™πšŠπš›πšπš’πšŠπš•_πšŠπš•πš•πšπš’πšπš constraint holds since:

  • No value, except value πš„π™½π™³π™΄π™΅π™Έπ™½π™΄π™³=0, is used more than once.

  • π™²π™Ύπš‚πšƒ=8 is equal to the sum of the weights 2, -1 and 7 of the values 1, 2 and 4 assigned to the variables of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚=〈4,0,1,2,0,0βŒͺ.

Typical
|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|>0
πšŠπšπš•πšŽπšŠπšœπš(1,πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚,πš„π™½π™³π™΄π™΅π™Έπ™½π™΄π™³)
|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|≀|πš…π™°π™»πš„π™΄πš‚|+2
Symmetries
  • Items of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ are permutable.

  • Items of πš…π™°π™»πš„π™΄πš‚ are permutable.

  • All occurrences of two distinct values in πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš› or πš…π™°π™»πš„π™΄πš‚.πšŸπšŠπš• that are both different from πš„π™½π™³π™΄π™΅π™Έπ™½π™΄π™³ can be swapped; all occurrences of a value in πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš› or πš…π™°π™»πš„π™΄πš‚.πšŸπšŠπš• that is different from πš„π™½π™³π™΄π™΅π™Έπ™½π™΄π™³ can be renamed to any unused value that is also different from πš„π™½π™³π™΄π™΅π™Έπ™½π™΄π™³.

Arg. properties

Functional dependency: π™²π™Ύπš‚πšƒ determined by πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ and πš…π™°π™»πš„π™΄πš‚.

Usage

In his PhD thesisΒ [Thiel04], Sven Thiel describes the following three potential scenarios of the πš πšŽπš’πšπš‘πšπšŽπš_πš™πšŠπš›πšπš’πšŠπš•_πšŠπš•πš•πšπš’πšπš constraint:

  • Given a set of tasks (i.e.,Β the items of the πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ collection), assign to each task a resource (i.e.,Β an item of the πš…π™°π™»πš„π™΄πš‚ collection). Except for the resource associated with value πš„π™½π™³π™΄π™΅π™Έπ™½π™΄π™³, every resource can be used at most once. The cost of a resource is independent from the task to which the resource is assigned. The cost of value πš„π™½π™³π™΄π™΅π™Έπ™½π™΄π™³ is equal to 0. The total cost π™²π™Ύπš‚πšƒ of an assignment corresponds to the sum of the costs of the resources effectively assigned to the tasks. Finally we impose an upper bound on the total cost.

  • Given a set of persons (i.e.,Β the items of the πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ collection), select for each person an offer (i.e.,Β an item of the πš…π™°π™»πš„π™΄πš‚ collection). Except for the offer associated with value πš„π™½π™³π™΄π™΅π™Έπ™½π™΄π™³, every offer should be selected at most once. The profit associated with an offer is independent from the person that selects the offer. The profit of value πš„π™½π™³π™΄π™΅π™Έπ™½π™΄π™³ is equal to 0. The total benefit π™²π™Ύπš‚πšƒ is equal to the sum of the profits of the offers effectively selected. In addition we impose a lower bound on the total benefit.

  • The last scenario deals with an application to an over-constraint problem involving the πšŠπš•πš•πšπš’πšπšπšŽπš›πšŽπš—πš constraint. Allowing some variables to take an "undefined" value is done by setting all weights of all the values different from πš„π™½π™³π™΄π™΅π™Έπ™½π™΄π™³ to 1. As a consequence all variables assigned to a value different from πš„π™½π™³π™΄π™΅π™Έπ™½π™΄π™³ will have to take distinct values. The π™²π™Ύπš‚πšƒ variable allows to control the number of such variables.

Remark

It was shown inΒ [Thiel04] that, finding out whether the πš πšŽπš’πšπš‘πšπšŽπš_πš™πšŠπš›πšπš’πšŠπš•_πšŠπš•πš•πšπš’πšπš constraint has a solution or not is NP-hard. This was achieved by reduction from subset sum.

Algorithm

A filtering algorithm is given inΒ [Thiel04]. After showing that, deciding whether the πš πšŽπš’πšπš‘πšπšŽπš_πš™πšŠπš›πšπš’πšŠπš•_πšŠπš•πš•πšπš’πšπš has a solution is NP-complete,Β [Thiel04] gives the following results of his filtering algorithm with respect to consistency under the 3 scenarios previously described:

  • For scenario 1, if there is no restriction of the lower bound of the π™²π™Ύπš‚πšƒ variable, the filtering algorithm achieves arc-consistency for all variables of the πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ collection (but not for the π™²π™Ύπš‚πšƒ variable itself).

  • For scenario 2, if there is no restriction of the upper bound of the π™²π™Ύπš‚πšƒ variable, the filtering algorithm achieves arc-consistency for all variables of the πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ collection (but not for the π™²π™Ύπš‚πšƒ variable itself).

  • Finally, for scenario 3, the filtering algorithm achieves arc-consistency for all variables of the πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ collection as well as for the π™²π™Ύπš‚πšƒ variable.

See also

attached to cost variant: πšŠπš•πš•πšπš’πšπšπšŽπš›πšŽπš—πš, πšŠπš•πš•πšπš’πšπšπšŽπš›πšŽπš—πš_πšŽπš‘πšŒπšŽπš™πš_0.

common keyword: πšπš•πš˜πš‹πšŠπš•_πšŒπšŠπš›πšπš’πš—πšŠπš•πš’πšπš’_πš πš’πšπš‘_𝚌𝚘𝚜𝚝𝚜 (weighted assignment), πš–πš’πš—πš’πš–πšžπš–_πš πšŽπš’πšπš‘πš_πšŠπš•πš•πšπš’πšπšπšŽπš›πšŽπš—πšΒ (cost filtering constraint,weighted assignment), 𝚜𝚘𝚏𝚝_πšŠπš•πš•πšπš’πšπšπšŽπš›πšŽπš—πš_πšŸπšŠπš›Β (soft constraint),

πšœπšžπš–_𝚘𝚏_πš πšŽπš’πšπš‘πšπšœ_𝚘𝚏_πšπš’πšœπšπš’πš—πšŒπš_πšŸπšŠπš•πšžπšŽπšœΒ (weighted assignment).

Keywords

application area: assignment.

characteristic of a constraint: all different, joker value.

complexity: subset sum.

constraint type: soft constraint, relaxation.

filtering: cost filtering constraint.

modelling: functional dependency.

problems: weighted assignment.

Arc input(s)

πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ πš…π™°π™»πš„π™΄πš‚

Arc generator
π‘ƒπ‘…π‘‚π·π‘ˆπΆπ‘‡β†¦πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(πšŸπšŠπš›πš’πšŠπš‹πš•πšŽπšœ,πšŸπšŠπš•πšžπšŽπšœ)

Arc arity
Arc constraint(s)
β€’ πšŸπšŠπš›πš’πšŠπš‹πš•πšŽπšœ.πšŸπšŠπš›β‰ πš„π™½π™³π™΄π™΅π™Έπ™½π™΄π™³
β€’ πšŸπšŠπš›πš’πšŠπš‹πš•πšŽπšœ.πšŸπšŠπš›=πšŸπšŠπš•πšžπšŽπšœ.πšŸπšŠπš•
Graph property(ies)
β€’ πŒπ€π—_πˆπƒβ‰€1
β€’ π’π”πŒ(πš…π™°π™»πš„π™΄πš‚,πš πšŽπš’πšπš‘πš)=π™²π™Ύπš‚πšƒ

Graph model

PartsΒ (A) andΒ (B) of FigureΒ 5.420.1 respectively show the initial and final graph associated with the Example slot. Since we also use the π’π”πŒ graph property we show the vertices of the final graph from which we compute the total cost in a box.

Figure 5.420.1. Initial and final graph of the πš πšŽπš’πšπš‘πšπšŽπš_πš™πšŠπš›πšπš’πšŠπš•_πšŠπš•πš•πšπš’πšπš constraint
ctrs/weighted_partial_alldiffActrs/weighted_partial_alldiffB
(a) (b)