Optional Intervals and Presence Literals

An optional interval is an interval variable equipped with a Boolean presence literal indicating whether the interval is scheduled. Constraints involving an optional interval apply only when the interval is present; absent intervals are ignored. This lesson covers the defining presence relation, counting and total-duration sums built from presence literals, and how NoOverlap and makespan behave with optional intervals.

Step 1 of 157%

Tutorial

Optional Intervals and Presence Literals

An optional interval is an interval variable that may or may not be scheduled. Each optional interval carries a Boolean presence literal p{0,1}p \in \{0, 1\}:

  • If p=1p = 1, the interval is present, and its variables must satisfy the usual size relation start+size=end\text{start} + \text{size} = \text{end}.
  • If p=0p = 0, the interval is absent, and is ignored by every constraint involving it.

We denote an optional interval by the tuple I=(s,d,e,p)I = (s, d, e, p), where ss is the start, dd is the size, ee is the end, and pp is the presence literal.

The defining rule of an optional interval is

p=1    s+d=e.p = 1 \;\Longrightarrow\; s + d = e.

When p=0p = 0, the start, size, and end variables may still take any values in their domains, but those values have no effect on the rest of the model.

For example, suppose s[0,6]s \in [0, 6], d[2,4]d \in [2, 4], e[0,10]e \in [0, 10], p{0,1}p \in \{0, 1\}. Then:

  • (s,d,e,p)=(1,3,4,1)(s, d, e, p) = (1, 3, 4, 1) is valid: p=1p = 1 and 1+3=41 + 3 = 4. \checkmark
  • (s,d,e,p)=(1,3,5,1)(s, d, e, p) = (1, 3, 5, 1) is invalid: p=1p = 1 but 1+351 + 3 \neq 5. ×\times
  • (s,d,e,p)=(1,3,5,0)(s, d, e, p) = (1, 3, 5, 0) is valid: p=0p = 0, so the relation s+d=es + d = e need not hold. \checkmark
navigate · Enter open · Esc close · ⌘K/Ctrl K toggle