5.330. range_ctr

DESCRIPTIONLINKSGRAPH
Origin

Arithmetic constraint.

Constraint

πš›πšŠπš—πšπšŽ_πšŒπšπš›(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚,π™²πšƒπš,𝚁)

Arguments
πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(πšŸπšŠπš›-πšπšŸπšŠπš›)
π™²πšƒπšπšŠπšπš˜πš–
πšπšπšŸπšŠπš›
Restrictions
|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|>0
πš›πšŽπššπšžπš’πš›πšŽπš(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚,πšŸπšŠπš›)
π™²πšƒπšβˆˆ[=,β‰ ,<,β‰₯,>,≀]
Purpose

Constraint the difference between the maximum value and the minimum value of a set of domain variables. More precisely, let πšπ™°π™½π™Άπ™΄ denote the difference between the largest and the smallest variables of the πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ collection plus one. Enforce the following constraint to hold: πšπ™°π™½π™Άπ™΄ π™²πšƒπš 𝚁.

Example
(1,9,4,=,9)

The πš›πšŠπš—πšπšŽ_πšŒπšπš› constraint holds since max(1,9,4)-min(1,9,4)+1 is equal (i.e.,Β π™²πšƒπš is set to =) to its last argument 𝚁=9.

Figure 5.330.1. Illustration of the Example slot: three variables respectively fixed to values 1, 9 and 4, and their corresponding range 𝚁=9
ctrs/range_ctr-1-tikz
Typical
|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|>1
πš›πšŠπš—πšπšŽ(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš›)>1
π™²πšƒπšβˆˆ[=,<,β‰₯,>,≀]
Symmetries
  • Items of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ are permutable.

  • All occurrences of two distinct values of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš› can be swapped.

  • One and the same constant can be added to the πšŸπšŠπš› attribute of all items of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.

Arg. properties
  • Contractible wrt. πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ when π™²πšƒπšβˆˆ[<,≀].

  • Extensible wrt. πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ when π™²πšƒπšβˆˆ[β‰₯,>].

Used in

πšœπš‘πš’πšπš.

See also

common keyword: πš™πš›πš˜πšπšžπšŒπš_πšŒπšπš›, πšœπšžπš–_πšŒπšπš›Β (arithmetic constraint).

Keywords

characteristic of a constraint: range.

constraint type: arithmetic constraint.

Arc input(s)

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

Arc generator
π‘†πΈπΏπΉβ†¦πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(πšŸπšŠπš›πš’πšŠπš‹πš•πšŽπšœ)

Arc arity
Arc constraint(s)
πšƒπšπš„π™΄
Graph property(ies)
𝐑𝐀𝐍𝐆𝐄(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚,πšŸπšŠπš›) π™²πšƒπš 𝚁

Graph model

Since we want to keep all the vertices of the initial graph we use the 𝑆𝐸𝐿𝐹 arc generator together with the πšƒπšπš„π™΄ arc constraint. This predefined arc constraint always holds.

PartsΒ (A) andΒ (B) of FigureΒ 5.330.2 respectively show the initial and final graph associated with the Example slot. Since we use the πšƒπšπš„π™΄ arc constraint both graphs are identical.

Figure 5.330.2. Initial and final graph of the πš›πšŠπš—πšπšŽ_πšŒπšπš› constraint
ctrs/range_ctrActrs/range_ctrB
(a) (b)