## 5.116. differ_from_at_most_k_pos

Origin
Constraint

$\mathrm{𝚍𝚒𝚏𝚏𝚎𝚛}_\mathrm{𝚏𝚛𝚘𝚖}_\mathrm{𝚊𝚝}_\mathrm{𝚖𝚘𝚜𝚝}_𝚔_\mathrm{𝚙𝚘𝚜}\left(𝙺,\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁}\mathtt{1},\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁}\mathtt{2}\right)$

Type
 $\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁}$ $\mathrm{𝚌𝚘𝚕𝚕𝚎𝚌𝚝𝚒𝚘𝚗}\left(\mathrm{𝚟𝚊𝚛}-\mathrm{𝚍𝚟𝚊𝚛}\right)$
Arguments
 $𝙺$ $\mathrm{𝚒𝚗𝚝}$ $\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁}\mathtt{1}$ $\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁}$ $\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁}\mathtt{2}$ $\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁}$
Restrictions
 $|\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁}|\ge 1$ $\mathrm{𝚛𝚎𝚚𝚞𝚒𝚛𝚎𝚍}$$\left(\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁},\mathrm{𝚟𝚊𝚛}\right)$ $𝙺\ge 0$ $𝙺\le |\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁}\mathtt{1}|$ $|\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁}\mathtt{1}|=|\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁}\mathtt{2}|$
Purpose

Enforce two vectors $\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁}\mathtt{1}$ and $\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁}\mathtt{2}$ to differ from at most $𝙺$ positions.

Example
$\left(3,〈2,5,2,0〉,〈3,6,2,0〉\right)$

The $\mathrm{𝚍𝚒𝚏𝚏𝚎𝚛}_\mathrm{𝚏𝚛𝚘𝚖}_\mathrm{𝚊𝚝}_\mathrm{𝚖𝚘𝚜𝚝}_𝚔_\mathrm{𝚙𝚘𝚜}$ constraint holds since the first and second vectors differ from 2 positions, which is less than or equal to $𝙺=3$.

Typical
 $𝙺>0$ $𝙺<|\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁}\mathtt{1}|$ $|\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁}\mathtt{1}|>1$
Symmetries
• Arguments are permutable w.r.t. permutation $\left(𝙺\right)$ $\left(\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁}\mathtt{1},\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁}\mathtt{2}\right)$.

• $𝙺$ can be increased to any value $\le |\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁}\mathtt{1}|$.

• Items of $\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁}\mathtt{1}$ and $\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁}\mathtt{2}$ are permutable (same permutation used).

Arg. properties

Contractible wrt. $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{1}$ and $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{2}$ (remove items from same position).

Used in

implied by: $\mathrm{𝚍𝚒𝚏𝚏𝚎𝚛}_\mathrm{𝚏𝚛𝚘𝚖}_\mathrm{𝚎𝚡𝚊𝚌𝚝𝚕𝚢}_𝚔_\mathrm{𝚙𝚘𝚜}$ ($\le 𝙺$ replaced by $=𝙺$).

Keywords
Arc input(s)

$\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁}\mathtt{1}$ $\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁}\mathtt{2}$

Arc generator
$\mathrm{𝑃𝑅𝑂𝐷𝑈𝐶𝑇}$$\left(=\right)↦\mathrm{𝚌𝚘𝚕𝚕𝚎𝚌𝚝𝚒𝚘𝚗}\left(\mathrm{𝚟𝚎𝚌𝚝𝚘𝚛}\mathtt{1},\mathrm{𝚟𝚎𝚌𝚝𝚘𝚛}\mathtt{2}\right)$

Arc arity
Arc constraint(s)
$\mathrm{𝚟𝚎𝚌𝚝𝚘𝚛}\mathtt{1}.\mathrm{𝚟𝚊𝚛}\ne \mathrm{𝚟𝚎𝚌𝚝𝚘𝚛}\mathtt{2}.\mathrm{𝚟𝚊𝚛}$
Graph property(ies)
$\mathrm{𝐍𝐀𝐑𝐂}$$\le 𝙺$

Graph model

Parts (A) and (B) of Figure 5.116.1 respectively show the initial and final graph associated with the Example slot. Since we use the $\mathrm{𝐍𝐀𝐑𝐂}$ graph property, the arcs of the final graph are stressed in bold.

##### Figure 5.116.1. Initial and final graph of the $\mathrm{𝚍𝚒𝚏𝚏𝚎𝚛}_\mathrm{𝚏𝚛𝚘𝚖}_\mathrm{𝚊𝚝}_\mathrm{𝚖𝚘𝚜𝚝}_𝚔_\mathrm{𝚙𝚘𝚜}$ constraint  (a) (b)