Constraints

The following constraints are used in this example:

  • bounds on variables

  • for $(i,j) \in \text {PAIRS}$ and $k \in \{ i,\dots ,j-1\}  \setminus \{ (i+j-1)/2\} $,

    \[  \Variable{IsMatch[i,j]} + \Variable{IsFold[k]} \le 1  \]
  • for $(i,j) \in \text {PAIRS}$,

    \[  \Variable{IsMatch[i,j]} \le \Variable{IsFold[(i+j-1)/2]}  \]