5.109. distance

DESCRIPTIONLINKS
Origin

Arithmetic constraint.

Constraint

𝚍𝚒𝚜𝚝𝚊𝚗𝚌𝚎(𝚇,𝚈,𝚉)

Arguments
𝚇𝚍𝚟𝚊𝚛
𝚈𝚍𝚟𝚊𝚛
𝚉𝚍𝚟𝚊𝚛
Restriction
𝚉0
Purpose

Enforce the fact that 𝚉 is equal to |𝚇-𝚈|.

Example
(5,7,2)

The 𝚍𝚒𝚜𝚝𝚊𝚗𝚌𝚎 constraint holds since 2=|5-7|.

Typical
𝚉>0
Symmetry

Arguments are permutable w.r.t. permutation (𝚇,𝚈) (𝚉).

Systems

distanceEQ in Choco, distance in JaCoP, distance2 in JaCoP.

See also

related: 𝚊𝚕𝚕_𝚖𝚒𝚗_𝚍𝚒𝚜𝚝 (fixed minimum distance between all pairs of variables of a collection of variables), 𝚜𝚖𝚘𝚘𝚝𝚑.

Keywords

constraint arguments: ternary constraint.

constraint type: arithmetic constraint, predefined constraint.