5.344. set_value_precede

DESCRIPTIONLINKS
Origin

[YatChiuLawJimmyLee04]

Constraint

𝚜𝚎𝚝_πšŸπšŠπš•πšžπšŽ_πš™πš›πšŽπšŒπšŽπšπšŽ(πš‚,πšƒ,πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚)

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

If there exists a set variable v 1 of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ such that πš‚ does not belong to v 1 and πšƒ does, then there also exists a set variable v 2 preceding v 1 such that πš‚ belongs to v 2 and πšƒ does not.

Example
(2,1,πšŸπšŠπš›-{0,2},πšŸπšŠπš›-{0,1},πšŸπšŠπš›-βˆ…,πšŸπšŠπš›-{1})
(0,1,πšŸπšŠπš›-{0,2},πšŸπšŠπš›-{0,1},πšŸπšŠπš›-βˆ…,πšŸπšŠπš›-{1})
(0,2,πšŸπšŠπš›-{0,2},πšŸπšŠπš›-{0,1},πšŸπšŠπš›-βˆ…,πšŸπšŠπš›-{1})
(0,4,πšŸπšŠπš›-{0,2},πšŸπšŠπš›-{0,1},πšŸπšŠπš›-βˆ…,πšŸπšŠπš›-{1})

The following examples are taken fromΒ [Law05]:

  • The 𝚜𝚎𝚝_πšŸπšŠπš•πšžπšŽ_πš™πš›πšŽπšŒπšŽπšπšŽ(2,1,〈{0,2},{0,1},{},{1}βŒͺ) constraint holds since the first occurrence of value 2 precedes the first occurrence of value 1 (i.e.,Β the set {0,2} occurs before the set {0,1}).

  • The 𝚜𝚎𝚝_πšŸπšŠπš•πšžπšŽ_πš™πš›πšŽπšŒπšŽπšπšŽ(0,1,〈{0,2},{0,1},{},{1}βŒͺ) constraint holds since the first occurrence of value 0 precedes the first occurrence of value 1 (i.e.,Β the set {0,2} occurs before the set {0,1}).

  • The 𝚜𝚎𝚝_πšŸπšŠπš•πšžπšŽ_πš™πš›πšŽπšŒπšŽπšπšŽ(0,2,〈{0,2},{0,1},{},{1}βŒͺ) constraint holds since β€œthere is no set in 〈{0,2},{0,1},{},{1}βŒͺ that contains 2 but not 0”.

  • The 𝚜𝚎𝚝_πšŸπšŠπš•πšžπšŽ_πš™πš›πšŽπšŒπšŽπšπšŽ(0,4,〈{0,2},{0,1},{},{1}βŒͺ) constraint holds since no set in 〈{0,2},{0,1},{},{1}βŒͺ contains value 4.

Typical
πš‚<πšƒ
|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|>1
Arg. properties

Suffix-contractible wrt. πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.

Algorithm

A filtering algorithm for maintaining value precedence on a sequence of set variables is presented inΒ [YatChiuLawJimmyLee04]. Its complexity is linear to the number of variables of the collection πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.

Systems

precede in Gecode.

See also

specialisation: πš’πš—πš_πšŸπšŠπš•πšžπšŽ_πš™πš›πšŽπšŒπšŽπšπšŽΒ (πšœπšŽπššπšžπšŽπš—πšŒπšŽ of 𝚜𝚎𝚝 πšŸπšŠπš›πš’πšŠπš‹πš•πšŽπšœ replaced by πšœπšŽπššπšžπšŽπš—πšŒπšŽ of πšπš˜πš–πšŠπš’πš— πšŸπšŠπš›πš’πšŠπš‹πš•πšŽπšœ).

Keywords

constraint arguments: constraint involving set variables.

constraint type: order constraint.

symmetry: symmetry, indistinguishable values, value precedence.