Constraints

The following constraints are used in this example:

  • bounds on variables

  • $\displaystyle { \Variable{TotalBenefit} = \sum _{i \in \text {DEPTS}} \sum _{j \in \text {CITIES}} \Argument{benefit[i,j]} \cdot \Variable{Assign[i,j]} }$

  • $\displaystyle { \Variable{TotalCost} = \sum _{(i,j,k,l) \in \text {IJKL}} \Argument{comm[i,k]} \cdot \Argument{cost[j,l]} \cdot \Variable{Product[i,j,k,l]} }$

  • for $\text {dept} \in \text {DEPTS}$,

    \[  \sum _{\text {city} \in \text {CITIES}} \Variable{Assign[dept,city]} = 1  \]
  • for $\text {city} \in \text {CITIES}$,

    \[  \sum _{\text {dept} \in \text {DEPTS}} \Variable{Assign[dept,city]} \le \Argument{max\_ num\_ depts}  \]
  • for $(i,j,k,l) \in \text {IJKL}$,

    \[  \Variable{Assign[i,j]} + \Variable{Assign[k,l]} - 1 \le \Variable{Product[i,j,k,l]}  \]
  • for $(i,j,k,l) \in \text {IJKL}$,

    \[  \Variable{Product[i,j,k,l]} \le \Variable{Assign[i,j]}  \]
  • for $(i,j,k,l) \in \text {IJKL}$,

    \[  \Variable{Product[i,j,k,l]} \le \Variable{Assign[k,l]}  \]
  • for $i \in \text {DEPTS}$ and $k \in \text {DEPTS}$ and $l \in \text {CITIES}$ such that $i < k$,

    \[  \sum _{(i,j,k,l) \in \text {IJKL}} \Variable{Product[i,j,k,l]} = \Variable{Assign[k,l]}  \]
  • for $k \in \text {DEPTS}$ and $i \in \text {DEPTS}$ and $j \in \text {CITIES}$ such that $i < k$,

    \[  \sum _{(i,j,k,l) \in \text {IJKL}} \Variable{Product[i,j,k,l]} = \Variable{Assign[i,j]}  \]