# Dynamic Multi-Compartment Vehicle Routing Problem for Smart Waste Collection +
## 4 Mathematical Modelling
### Model  
The objective function (1) contains two parts; the first considers the cost for the total distance traveled, while the second is the cost of penalty caused by exceeding the bin capacity. \[Min\;f_{1}+f_{2} \tag{1}\]  
The constraints of the model are as follows:  
\[f_{1}=C\sum_{v\in V}\sum_{i\in N^{\prime}_{t_{1}}\cup\{0,0^{v}_{l},n+1\}}\sum _{j\in N^{\prime}_{t_{1}}\;\cup\{0,0^{v}_{l},\;n+1\}}\;d_{ij}x^{v}_{ij}\;f_{2} =\sum_{w\in W}\sum_{i\in N^{\prime}_{t_{1}}}\;p_{wi}\;u_{wi}\]  
\[\sum_{j\in N^{\prime}_{t_{1}}}\;x^{v}_{0\bar{t}j}\leq 1\;\forall v\in V \tag{2}\]  
\[\sum_{j\in N^{\prime}_{t_{1}}}\;x^{v}_{j,\mu+1}\leq 1\;\forall v\in V \tag{3}\]  
\[\sum_{j\in N^{\prime}_{t_{1}}}\;x^{v}_{0\bar{t}j}=\sum_{j\in N^{\prime}_{t_{1 }}}\;x^{v}_{j,\;n+1}\;\forall\;v\in V \tag{4}\]  
\[\sum_{j\in N^{\prime}_{t_{1}}\;\cup\{0,0^{v}_{l}\}}\;x^{v}_{i\bar{t}}=\sum_{j \in N^{\prime}_{t_{1}}}\;\sum_{ \begin{subarray}{c}\cup\{n+1\}\\ j\
eq i\end{subarray} }x^{v}_{ij}\;\forall\;v\in V,\forall i\in N^{\prime}_{t_{ 1}}\;\cup\{n+1\} \tag{5}\]  
\[\sum_{v\in V}\sum_{j\in N^{\prime}_{t_{1}}}\;x^{v}_{j,\;n+1}=\sum_{v\in V}x^{ v}_{n+1,\;0} \tag{6}\]  
\[\sum_{v\in V}y^{v}_{wj}=1\;\forall\;j\in N^{\prime}_{t_{p}}\;,\;\forall w\in W \tag{7}\]  
\[x^{v}_{ij}\leq\sum_{w\in W}y^{v}_{wj}\;\forall\;v\in V,\forall j\in N^{\prime }_{t_{1}}\;,\forall\;i\in N_{t_{p}}\;\cup\{0,\;0^{v}_{l}\},\;i\
eq j \tag{8}\]  
\[\sum_{w\in W}\sum_{m\in M}z^{v}_{wm}\leq\;\hat{m}\;\;\forall v\in V \tag{9}\]  
\[\sum_{j\in N^{\prime}_{t_{1}}}\;q_{wj}y^{v}_{wj}\leq\sum_{m\in M}Cq_{m}z^{v} _{wm}\;\forall v\in V,\;\forall w\in W \tag{10}\]  
\[y^{v}_{wj}=\sum_{ \begin{subarray}{c}j\in N^{\prime}_{t_{1}}\\ j\
eq i\end{subarray} }\;x^{v}_{ij}\;\forall\;v\in V,\forall j\in N^{\prime} _{t_{1}}\;,\;\forall i\in N^{\prime}_{t_{1}}\cup\{0,\;0^{v}_{l}\},\;\forall w\in W \tag{11}\]  
\[g_{i}\;=1,\;\forall\;i\in N^{\prime}_{t_{1}}\;,\;\exists w\in W:\;q_{wi}\geq\; \varrho_{w}Cp_{w} \tag{12}\]  
\[\sum_{j\in N^{\prime}_{t_{1}}}\;y^{v}_{wj}\geq h_{w}\;\forall\;v\in V,\; \forall w\in W \tag{13}\]\[y^{v}_{wj}q_{wi}>0\;\forall v\in V,\;\forall\;i\in N^{\prime}_{t_{l}}\;,\;\forall w\in I \tag{14}\]  
\[y^{v}_{wj}q_{wj}\leq\sum_{m\in M}Cq_{m}z^{v}_{wm}-Q_{w}-F^{v}_{wij}\;\forall v\in V,\forall j\in N^{\prime}_{t_{l}}\;,\;\forall\;i\in N^{\prime}_{t_{l}}\;\cup\{0, \;0^{v}_{l}\},\;\forall w\in J \tag{15}\]  
\[\sum_{v\in V}F^{v}_{w,n+1,0}=0\;\forall w\in W \tag{16}\]  
\[u_{wi}\geq q_{wi}-Cp_{w}\;\;\forall i\in N^{\prime}_{t_{l}}\;,\;\forall w\in W \tag{17}\]  
\[x^{v}_{ij}\in\{0,\;1\}\forall\;v\in V,\;\forall\;i,\;j\in S \tag{18}\]  
\[y^{v}_{wj}\in\{0,\;1\}\;\forall\;v\in V,\;\forall\;j\in S\backslash\{0,n+1\} \;\forall w\in W \tag{19}\]  
\[z^{v}_{wm}\in\{0,\;1\}\;\forall\;v\in V,\;\forall\;m\in M,\;\forall\;w\in W \tag{20}\]  
\[g_{i}\;\in\{0,\;1\}\;\forall\;i\;\in S\backslash\{0,n+1\} \tag{21}\]  
\[\sum_{j\in N^{\prime}_{t_{1}}}\;y^{v}_{wj}\geq h_{w}\;\forall\;v\in V,\; \forall w\in W \tag{13}\]0  
\[\sum_{j\in N^{\prime}_{t_{1}}}\;y^{v}_{wj}\geq h_{w}\;\forall\;v\in V,\; \forall w\in W \tag{13}\]1  
Constraints (2)-(4) ensures that each vehicle starts at the last station that has been committed to it and returns to the transfer station to unload the collected waste. Constraints (5) express that when a vehicle \(v\) arrives at station \(i\), it must exit. Constraint (6) ensures that the number of vehicles returning to the transfer station equals the number of vehicles returning to the depot. Constraints (7) ensure that each waste type \(w\) at station \(j\) is assigned to precisely one vehicle; a separate collection of a single waste type does not exist. Constraint (8) warrants that if the vehicle visits the station, it must precisely collect at least one waste type. Constraint (9) ensures that the number of waste types does not exceed the maximum number of compartments. Constraint (10) warrants that for each case of vehicle \(v\), its capacity is not exceeded by the sum of the quantities collected.