Milk Collection: How to Route and Assign Milk Collection Lorries to Farms


Constraints

The following constraints are used in this example:

  • bounds on variables

  • for $d \in \text {DAYS}$,

    \[  \sum _{i \in \text {NODES}} \Argument{requirement[i]} \cdot \Variable{UseNode[i,d]} \le \Argument{capacity}  \]
  • for $i \in \text {NODES}$,

    \[  \sum _{d \in \text {DAYS}} \Variable{UseNode[i,d]} = \Argument{frequency[i]}  \]
  • for $k \in \text {NODES}$ and $d \in \text {DAYS}$,

    \[  \sum _{(i,j) \in \text {EDGES}: k \in \{ i,j\} } \Variable{UseEdge[i,j,d]} = 2 \cdot \Variable{UseNode[k,d]}  \]
  • for $d \in \text {DAYS} \setminus \{ 1\} $,

    \[  \sum _{i \in \text {NODES}} \Variable{UseNode[i,d]} \le \sum _{i \in \text {NODES}} \Variable{UseNode[i,d}-\Variable{1]}  \]
  • for $s \in \{ 1, \dots , \Argument{num\_ subtours}\} $ and $k \in \text {SUBTOUR[s]}$ and $d \in \text {DAYS}$,

    \[  \sum _{\substack{i \in \text {NODES} \setminus \text {SUBTOUR[s]},\\ j \in \text {SUBTOUR[s]}:\\ (i,j) \in \text {EDGES}}} \Variable{UseEdge[i,j,d]} + \sum _{\substack{i \in \text {SUBTOUR[s]},\\ j \in \text {NODES} \setminus \text {SUBTOUR[s]}:\\ (i,j) \in \text {EDGES}}} \Variable{UseEdge[i,j,d]} \ge 2 \cdot \Variable{UseNode[k,d]}  \]