5.29. among_var

DESCRIPTIONLINKSGRAPH
Origin

Generalisation of πšŠπš–πš˜πš—πš

Constraint

πšŠπš–πš˜πš—πš_πšŸπšŠπš›(π™½πš…π™°πš,πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚,πš…π™°π™»πš„π™΄πš‚)

Arguments
π™½πš…π™°πšπšπšŸπšŠπš›
πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(πšŸπšŠπš›-πšπšŸπšŠπš›)
πš…π™°π™»πš„π™΄πš‚πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(πšŸπšŠπš•-πšπšŸπšŠπš›)
Restrictions
π™½πš…π™°πšβ‰₯0
π™½πš…π™°πšβ‰€|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|
πš›πšŽπššπšžπš’πš›πšŽπš(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚,πšŸπšŠπš›)
πš›πšŽπššπšžπš’πš›πšŽπš(πš…π™°π™»πš„π™΄πš‚,πšŸπšŠπš•)
Purpose

π™½πš…π™°πš is the number of variables of the collection πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ that are equal to one of the variables of the collection πš…π™°π™»πš„π™΄πš‚.

Example
(3,4,5,5,4,1,1,5,8,1)

The πšŠπš–πš˜πš—πš_πšŸπšŠπš› constraint holds since exactly 3 values of the collection of variables 〈4,5,5,4,1βŒͺ occurs within the collection 〈1,5,8,1βŒͺ.

Typical
|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|>1
|πš…π™°π™»πš„π™΄πš‚|>1
|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|>|πš…π™°π™»πš„π™΄πš‚|
Symmetries
  • Items of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ are permutable.

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

  • All occurrences of two distinct values in πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš› or πš…π™°π™»πš„π™΄πš‚.πšŸπšŠπš• can be swapped; all occurrences of a value in πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš› or πš…π™°π™»πš„π™΄πš‚.πšŸπšŠπš• can be renamed to any unused value.

  • An occurrence of a value of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš› that belongs to πš…π™°π™»πš„π™΄πš‚.πšŸπšŠπš• (resp. does not belong to πš…π™°π™»πš„π™΄πš‚.πšŸπšŠπš•) can be replaced by any other value in πš…π™°π™»πš„π™΄πš‚.πšŸπšŠπš• (resp. not in πš…π™°π™»πš„π™΄πš‚.πšŸπšŠπš•).

Arg. properties
  • Functional dependency: π™½πš…π™°πš determined by πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ and πš…π™°π™»πš„π™΄πš‚.

  • Contractible wrt. πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ when π™½πš…π™°πš=0.

  • Contractible wrt. πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ when π™½πš…π™°πš=|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|.

  • Aggregate: π™½πš…π™°πš(+), πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚(πšžπš—πš’πš˜πš—), πš…π™°π™»πš„π™΄πš‚(πšžπš—πš’πš˜πš—).

Systems

among in Choco, count in Gecode, amongvar in JaCoP.

See also

implied by: πšŠπš–πš˜πš—πš.

related: πšŒπš˜πš–πš–πš˜πš—.

specialisation: πšŠπš–πš˜πš—πšΒ (πšŸπšŠπš›πš’πšŠπš‹πš•πšŽ replaced by πšŒπš˜πš—πšœπšπšŠπš—πš within list of πšŸπšŠπš•πšžπšŽπšœ πš…π™°π™»πš„π™΄πš‚).

uses in its reformulation: πš–πš’πš—_πš—.

Keywords

constraint arguments: pure functional dependency.

constraint type: counting constraint.

final graph structure: acyclic, bipartite, no loop.

modelling: functional dependency.

Arc input(s)

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

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

Arc arity
Arc constraint(s)
πšŸπšŠπš›πš’πšŠπš‹πš•πšŽπšœ.πšŸπšŠπš›=πšŸπšŠπš•πšžπšŽπšœ.πšŸπšŠπš•
Graph property(ies)
ππ’πŽπ”π‘π‚π„=π™½πš…π™°πš

Graph class
β€’ π™°π™²πšˆπ™²π™»π™Έπ™²
β€’ π™±π™Έπ™Ώπ™°πšπšƒπ™Έπšƒπ™΄
β€’ 𝙽𝙾_𝙻𝙾𝙾𝙿

Graph model

PartsΒ (A) andΒ (B) of FigureΒ 5.29.1 respectively show the initial and final graph associated with the Example slot. Since we use the ππ’πŽπ”π‘π‚π„ graph property, the source vertices of the final graph are stressed with a double circle. Since the final graph has only 3 sources the variables π™½πš…π™°πš is fixed to 3.

Figure 5.29.1. Initial and final graph of the πšŠπš–πš˜πš—πš_πšŸπšŠπš› constraint
ctrs/among_varActrs/among_varB
(a) (b)