## 5.122. disj

Origin
Constraint

$\mathrm{𝚍𝚒𝚜𝚓}\left(\mathrm{𝚃𝙰𝚂𝙺𝚂}\right)$

Argument
 $\mathrm{𝚃𝙰𝚂𝙺𝚂}$ $\mathrm{𝚌𝚘𝚕𝚕𝚎𝚌𝚝𝚒𝚘𝚗}\left(\begin{array}{c}\mathrm{𝚜𝚝𝚊𝚛𝚝}-\mathrm{𝚍𝚟𝚊𝚛},\hfill \\ \mathrm{𝚍𝚞𝚛𝚊𝚝𝚒𝚘𝚗}-\mathrm{𝚍𝚟𝚊𝚛},\hfill \\ \mathrm{𝚋𝚎𝚏𝚘𝚛𝚎}-\mathrm{𝚜𝚟𝚊𝚛},\hfill \\ \mathrm{𝚙𝚘𝚜𝚒𝚝𝚒𝚘𝚗}-\mathrm{𝚍𝚟𝚊𝚛}\hfill \end{array}\right)$
Restrictions
 $\mathrm{𝚛𝚎𝚚𝚞𝚒𝚛𝚎𝚍}$$\left(\mathrm{𝚃𝙰𝚂𝙺𝚂},\left[\mathrm{𝚜𝚝𝚊𝚛𝚝},\mathrm{𝚍𝚞𝚛𝚊𝚝𝚒𝚘𝚗},\mathrm{𝚋𝚎𝚏𝚘𝚛𝚎},\mathrm{𝚙𝚘𝚜𝚒𝚝𝚒𝚘𝚗}\right]\right)$ $\mathrm{𝚃𝙰𝚂𝙺𝚂}.\mathrm{𝚍𝚞𝚛𝚊𝚝𝚒𝚘𝚗}\ge 1$ $\mathrm{𝚃𝙰𝚂𝙺𝚂}.\mathrm{𝚙𝚘𝚜𝚒𝚝𝚒𝚘𝚗}\ge 0$ $\mathrm{𝚃𝙰𝚂𝙺𝚂}.\mathrm{𝚙𝚘𝚜𝚒𝚝𝚒𝚘𝚗}<|\mathrm{𝚃𝙰𝚂𝙺𝚂}|$
Purpose

All the tasks of the collection $\mathrm{𝚃𝙰𝚂𝙺𝚂}$ should not overlap. For a given task $t$ the attributes $\mathrm{𝚋𝚎𝚏𝚘𝚛𝚎}$ and $\mathrm{𝚙𝚘𝚜𝚒𝚝𝚒𝚘𝚗}$ respectively correspond to the set of tasks starting before task $t$ (assuming that the first task is labelled by 1) and to the position of task $t$ (assuming that the first task has position 0).

Example
$\left(\begin{array}{c}〈\begin{array}{cccc}\mathrm{𝚜𝚝𝚊𝚛𝚝}-1\hfill & \mathrm{𝚍𝚞𝚛𝚊𝚝𝚒𝚘𝚗}-3\hfill & \mathrm{𝚋𝚎𝚏𝚘𝚛𝚎}-\varnothing \hfill & \mathrm{𝚙𝚘𝚜𝚒𝚝𝚒𝚘𝚗}-0,\hfill \\ \mathrm{𝚜𝚝𝚊𝚛𝚝}-9\hfill & \mathrm{𝚍𝚞𝚛𝚊𝚝𝚒𝚘𝚗}-1\hfill & \mathrm{𝚋𝚎𝚏𝚘𝚛𝚎}-\left\{1,3,4\right\}\hfill & \mathrm{𝚙𝚘𝚜𝚒𝚝𝚒𝚘𝚗}-3,\hfill \\ \mathrm{𝚜𝚝𝚊𝚛𝚝}-7\hfill & \mathrm{𝚍𝚞𝚛𝚊𝚝𝚒𝚘𝚗}-2\hfill & \mathrm{𝚋𝚎𝚏𝚘𝚛𝚎}-\left\{1,4\right\}\hfill & \mathrm{𝚙𝚘𝚜𝚒𝚝𝚒𝚘𝚗}-2,\hfill \\ \mathrm{𝚜𝚝𝚊𝚛𝚝}-4\hfill & \mathrm{𝚍𝚞𝚛𝚊𝚝𝚒𝚘𝚗}-1\hfill & \mathrm{𝚋𝚎𝚏𝚘𝚛𝚎}-\left\{1\right\}\hfill & \mathrm{𝚙𝚘𝚜𝚒𝚝𝚒𝚘𝚗}-1\hfill \end{array}〉\hfill \end{array}\right)$

Figure 5.122.1 shows the tasks of the example. Since these tasks do not overlap the $\mathrm{𝚍𝚒𝚜𝚓}$ constraint holds.

##### Figure 5.122.1. Tasks corresponding to the Example slot Typical
$|\mathrm{𝚃𝙰𝚂𝙺𝚂}|>1$
Symmetries
• One and the same constant can be added to the $\mathrm{𝚜𝚝𝚊𝚛𝚝}$ attribute of all items of $\mathrm{𝚃𝙰𝚂𝙺𝚂}$.

• $\mathrm{𝚃𝙰𝚂𝙺𝚂}.\mathrm{𝚍𝚞𝚛𝚊𝚝𝚒𝚘𝚗}$ can be decreased to any value $\ge 1$.

Usage

The $\mathrm{𝚍𝚒𝚜𝚓}$ constraint was originally applied [MonetteDevilleDupont07] to solve the open-shop problem.

Remark

This constraint is similar to the $\mathrm{𝚍𝚒𝚜𝚓𝚞𝚗𝚌𝚝𝚒𝚟𝚎}$ constraint. In addition to the $\mathrm{𝚜𝚝𝚊𝚛𝚝}$ and the $\mathrm{𝚍𝚞𝚛𝚊𝚝𝚒𝚘𝚗}$ attributes of a task $t$, the $\mathrm{𝚍𝚒𝚜𝚓}$ constraint introduces a set variable $\mathrm{𝚋𝚎𝚏𝚘𝚛𝚎}$ that represents the set of tasks that end before the start of task $t$ as well as a domain variable $\mathrm{𝚙𝚘𝚜𝚒𝚝𝚒𝚘𝚗}$ that gives the absolute order of task $t$ in the resource. Since it assumes that the first task has position 0 we have that, for a given task $t$, the number of elements of its $\mathrm{𝚋𝚎𝚏𝚘𝚛𝚎}$ attribute is equal to the value of its $\mathrm{𝚙𝚘𝚜𝚒𝚝𝚒𝚘𝚗}$ attribute.

Algorithm

The main idea of the algorithm is to apply in a systematic way shaving on the $\mathrm{𝚙𝚘𝚜𝚒𝚝𝚒𝚘𝚗}$ attribute of a task. It is implemented in

Keywords
Arc input(s)

$\mathrm{𝚃𝙰𝚂𝙺𝚂}$

Arc generator
$\mathrm{𝐶𝐿𝐼𝑄𝑈𝐸}$$\left(\ne \right)↦\mathrm{𝚌𝚘𝚕𝚕𝚎𝚌𝚝𝚒𝚘𝚗}\left(\mathrm{𝚝𝚊𝚜𝚔𝚜}\mathtt{1},\mathrm{𝚝𝚊𝚜𝚔𝚜}\mathtt{2}\right)$

Arc arity
Arc constraint(s)
 $•\bigvee \left(\begin{array}{c}\mathrm{𝚝𝚊𝚜𝚔𝚜}\mathtt{1}.\mathrm{𝚜𝚝𝚊𝚛𝚝}+\mathrm{𝚝𝚊𝚜𝚔𝚜}\mathtt{1}.\mathrm{𝚍𝚞𝚛𝚊𝚝𝚒𝚘𝚗}\le \mathrm{𝚝𝚊𝚜𝚔𝚜}\mathtt{2}.\mathrm{𝚜𝚝𝚊𝚛𝚝},\hfill \\ \mathrm{𝚝𝚊𝚜𝚔𝚜}\mathtt{2}.\mathrm{𝚜𝚝𝚊𝚛𝚝}+\mathrm{𝚝𝚊𝚜𝚔𝚜}\mathtt{2}.\mathrm{𝚍𝚞𝚛𝚊𝚝𝚒𝚘𝚗}\le \mathrm{𝚝𝚊𝚜𝚔𝚜}\mathtt{1}.\mathrm{𝚜𝚝𝚊𝚛𝚝}\hfill \end{array}\right)$ $•\begin{array}{c}\mathrm{𝚝𝚊𝚜𝚔𝚜}\mathtt{1}.\mathrm{𝚜𝚝𝚊𝚛𝚝}+\mathrm{𝚝𝚊𝚜𝚔𝚜}\mathtt{1}.\mathrm{𝚍𝚞𝚛𝚊𝚝𝚒𝚘𝚗}\le \mathrm{𝚝𝚊𝚜𝚔𝚜}\mathtt{2}.\mathrm{𝚜𝚝𝚊𝚛𝚝}⇔\hfill \\ \mathrm{𝚒𝚗}_\mathrm{𝚜𝚎𝚝}\left(\mathrm{𝚝𝚊𝚜𝚔𝚜}\mathtt{1}.\mathrm{𝚔𝚎𝚢},\mathrm{𝚝𝚊𝚜𝚔𝚜}\mathtt{2}.\mathrm{𝚋𝚎𝚏𝚘𝚛𝚎}\right)\hfill \end{array}$ $•\begin{array}{c}\mathrm{𝚝𝚊𝚜𝚔𝚜}\mathtt{1}.\mathrm{𝚜𝚝𝚊𝚛𝚝}+\mathrm{𝚝𝚊𝚜𝚔𝚜}\mathtt{1}.\mathrm{𝚍𝚞𝚛𝚊𝚝𝚒𝚘𝚗}\le \mathrm{𝚝𝚊𝚜𝚔𝚜}\mathtt{2}.\mathrm{𝚜𝚝𝚊𝚛𝚝}⇔\hfill \\ \mathrm{𝚝𝚊𝚜𝚔𝚜}\mathtt{1}.\mathrm{𝚙𝚘𝚜𝚒𝚝𝚒𝚘𝚗}<\mathrm{𝚝𝚊𝚜𝚔𝚜}\mathtt{2}.\mathrm{𝚙𝚘𝚜𝚒𝚝𝚒𝚘𝚗}\hfill \end{array}$
Graph property(ies)
$\mathrm{𝐍𝐀𝐑𝐂}$$=|\mathrm{𝚃𝙰𝚂𝙺𝚂}|*|\mathrm{𝚃𝙰𝚂𝙺𝚂}|-|\mathrm{𝚃𝙰𝚂𝙺𝚂}|$

Graph model

We generate a clique with a non-overlapping constraint between each pair of distinct tasks and state that the number of arcs of the final graph should be equal to the number of arcs of the initial graph. For two tasks ${t}_{1}$ and ${t}_{2}$, the three conditions of the arc constraint respectively correspond to:

• The fact that ${t}_{1}$ ends before the start of ${t}_{2}$ or that ${t}_{2}$ ends before the start of ${t}_{1}$.

• The equivalence between the fact that ${t}_{1}$ ends before the start of ${t}_{2}$ and the fact that the identifier of task ${t}_{1}$ belongs to the $\mathrm{𝚋𝚎𝚏𝚘𝚛𝚎}$ attribute of task ${t}_{2}$.

• The equivalence between the fact that ${t}_{1}$ ends before the start of ${t}_{2}$ and the fact that the $\mathrm{𝚙𝚘𝚜𝚒𝚝𝚒𝚘𝚗}$ attribute of task ${t}_{1}$ is strictly less than the $\mathrm{𝚙𝚘𝚜𝚒𝚝𝚒𝚘𝚗}$ attribute of task ${t}_{2}$.

Parts (A) and (B) of Figure 5.122.2 respectively show the initial and final graph associated with the Example slot. The $\mathrm{𝚍𝚒𝚜𝚓}$ constraint holds since all the arcs of the initial graph belong to the final graph: all the non-overlapping constraints holds.

##### Figure 5.122.2. Initial and final graph of the $\mathrm{𝚍𝚒𝚜𝚓}$ constraint  (a) (b)