## 2 Models for Sorting and Logistics Operators
### Formulation of the Sorting Problem  
The sorting problem aims to define the optimal amount of waste to be sorted within a planning horizon, discretized into \(|T_{s}|\) time slots, for every sorting facility. To this end, we introduce a nonnegative variable \(x_{jt}\) defining the quantity of material to be sorted in time slot \(t\in T_{s}\), and a binary decision variable \(y_{jt}\) that is equal to 1 if the sorting station (facility) \(j\in J\) is opened in \(t\in T_{s}\) and 0 otherwise. Opening a sorting facility in \(t\in T_{s}\) implies a setup time, as detailed in the following; therefore, it is important to correctly evaluate which facilities must operate and which must be closed. \(I_{jt}\) is the level of inventory of the upstream buffer of station \(j\in J\) in time slot \(t\in T_{s}\) with the condition \(I_{j0}=0,\;\forall j\in J\). Here are the parameters:  
* \(c_{t}^{s},f_{jt},h_{j}\) are the variable sorting costs in time slot \(t\in T_{s}\), the fixed setup time for station \(j\in J\), and the inventory holding cost for station \(j\in J\), respectively;
* \(a_{t}\) is the quantity of material arriving at the sorting plant at time slot \(t\in T_{s}\);
* \(E_{j},\;M_{j}\) are the minimum and maximum allowed sorting quantity for station \(j\in J\), respectively, in case it is activated;
* \(a\) is the loss factor considering the mean percentage of material that is discarded after selection at each sorting stage;
* \(LC_{j}\) is the inventory capacity for station \(j\in J\). The P1 sorting model is the following: \[\min\;Z_{s}=\sum_{j\in J}\sum_{t\in T_{s}}c_{t}^{s}\cdot x_{jt}+ \sum_{j\in J}\sum_{t\in T_{s}}f_{j}\cdot\max(0,y_{jt}-y_{j,t-1})+\sum_{j\in J }\sum_{t\in T_{s}}h_{j}\cdot I_{jt}\] (1) s.t. \[E_{j}y_{jt}\leq x_{jt}\leq M_{j}y_{jt},\quad\forall j\in J,\forall t\in T_{s},\] (2) \[I_{1,t}= I_{1,t-1}+a_{t-1}-x_{1,t-1},\quad\forall t\in T_{s}\setminus\{ 0\},\] (3) \[I_{j,t}= I_{j,t-1}+\alpha x_{j-1,t-1}-x_{j,t-1},\,\forall t\in T_{s} \setminus\{0\},j\in J\setminus\{1\},\] (4) \[I_{jt}\leq LC_{j},\quad\forall j\in J,t\in T_{s},\] (5) \[x_{jt}\geq 0,\,y_{jt}\in\{0,1\},\,\forall t\in T_{s},\forall j\in J.\] (6)  
Equation (1) is the objective function of the problem aiming at minimizing the sorting cost, the setup time cost, and the inventory holding cost. Constraint (2) limits \(x_{jt}\) values. Constraints (3) and (4) define the inventories. We note that (3) embeds the quantities to be collected from the customers. Constraints (5) limit the inventory level to a maximum capacity, while (6) defines the variable domains.  
Model P1 has a nonlinearity in the objective function that can be easily linearized as follows:  
\[\min\ Z_{s}=\sum_{j\in I}\sum_{t\in T_{s}}c_{t}^{s}\cdot x_{jt}+ \sum_{j\in J}\sum_{t\in T_{s}}f_{j}\cdot\tilde{y}_{ji}+\sum_{j\in I}\sum_{t\in T_ {s}}h_{j}\cdot I_{ji}\] (7) s.t. \[E_{j}y_{jt}\leq x_{jt}\leq M_{j}y_{jt},\quad\forall j\in J,\forall t\in T_{s}, \tag{2}\] \[I_{1,t}= I_{1,t-1}+a_{t-1}-x_{1,t-1},\quad\forall t\in T_{s}\setminus\{0\},\] (3) \[I_{j,t}= I_{j,t-1}+\alpha x_{j-1,t-1}-x_{j,t-1},\,\forall t\in T_{s} \setminus\{0\},j\in J\setminus\{1\},\] (4) \[I_{tt}\leq LC_{j},\quad\forall j\in J,t\in T_{s},\] (5) \[x_{jt}\geq 0,\,y_{jt}\in\{0,1\},\,\forall t\in T_{s},\forall j\in J.\] (6) \[\tilde{y}_{ji}\geq y_{ji}-y_{j,t-1},\quad\forall j\in J,t\in T_{s},\] (8) \[\tilde{y}_{ji}\geq 0,\quad\forall j\in J,t\in T_{s}. \tag{9}\]