# Matheuristics for the Design of a Multi-Step, Multi-Product Supply Chain with Multimodal Transport
## 4 MILP Model and Matheuristics
### Mixed-Integer Linear Programming Model (MILP)
#### 4.1.3 Constraints  
_Supplier constraints_  
Constraint (2) limits the order quantity to a material supplier's maximum capacity, constraint (3) prevents a factory ordering a specific material from more than one supplier and constraint (4) ensures that not only can the material be transported from a supplier to a factory if we select that supplier.  
\[\sum_{f\in F}\sum_{t\in T_{sf}}x^{rt}_{sf}\leq SQR^{r}_{s} \qquad\mathbf{r\in R,s\in S^{r}} \tag{2}\] \[\sum_{s\in S^{r}}v^{r}_{sf}\leq 1 \qquad\mathbf{r\in R,f\in F}\] (3) \[\sum_{t\in T_{sf}}x^{rt}_{sf}\leq SQR^{r}_{s}v^{r}_{sf} \quad\mathbf{r\in R,s\in S^{r},f\in F} \tag{4}\]  
_Factory and warehouse constraints_  
Constraint (5) ensures that each potential location can only be opened with one level of capacity. Constraint (6) ensures that the amount of material ordered from the supplier is exactly what is needed to produce the finished products. Constraints (7) and (8) limit production to the minimum and maximum quantities in general of each factory and also limit the maximum capacity per product, respectively. Finally, constraint (9) imposes the lower and upper limits of storage in each warehouse.  
\[\sum_{q\in Q}z_{lq}\leq 1\quad\quad l\in F\cup W \tag{5}\]  
\[\sum_{s\in S^{t}}\sum_{t\in T_{sf}}x_{sf}^{rt}=\sum_{p\in P^{tr}}\sum_{w\in W^{ p}}\sum_{t\in T_{fw}}A^{rp}x_{fw}^{pt} \tag{6}\]  
\[\sum_{q\in Q}\frac{MQ_{fq}z_{fq}}{}\leq\sum_{p\in P}\sum_{w\in W^{ p}}\sum_{t\in T_{fw}}MQU^{p}x_{fw}^{pt}\leq\sum_{q\in Q}\overline{MQ}_{fq}{}^{2} {}_{fq}\qquad\quad f\in F \tag{7}\]  
\[\sum_{w\in W^{p}}\sum_{t\in T_{fw}}MQU^{p}x_{fw}^{pt}\leq\sum_{q\in Q}MQP_{fq}^ {p}{}_{2}{}_{fq}\quad p\in P,f\in F \tag{8}\]  
\[\sum_{q\in Q}\frac{SQ_{wq}z_{uw}}{}\leq\sum_{p\in P}\sum_{c\in C^{p}}\sum_{t \in T_{wc}}SQU^{p}DEM_{c}^{p}u_{wc}^{t}\leq\sum_{q\in Q}\overline{SQ}_{uw}z_ {uw}\qquad w\in W \tag{9}\]  
_Customer and flow retention constraints_  
Constraint (10) ensures that a customer is only dispatched from a warehouse and constraint (11) ensures that the quantity of product that reaches customers is the same as that which reaches the warehouses.  
\[\sum_{w\in W}\sum_{t\in T_{wc}}u_{wc}^{t}=1\qquad\quad c\in C \tag{10}\]  
\[\sum_{c\in C^{p}}\sum_{t\in T_{wc}}DEM_{c}^{p}u_{wc}^{t}=\sum_{f\in F^{p}}\sum_ {t\in T_{fw}}x_{fw}^{pt}\quad p\in P,w\in W \tag{11}\]  
_Transport related constraints_  
Constraints (12)-(14) limit the minimum and maximum quantities to transport between origins and destinations.  
\[\underline{TQ}_{sf}^{t}u_{sf}^{t}\leq\sum_{r\in R}TQU^{rt}x_{sf}^{ rt}\leq\overline{TQ}_{sf}^{t}u_{sf}^{t}\quad\quad s\in S,f\in F,t\in T_{sf} \tag{12}\] \[\underline{TQ}_{fw}^{t}u_{fw}^{t}\leq\sum_{p\in P}TQU^{pt}x_{fw}^ {pt}\leq\overline{TQ}_{fw}^{t}u_{fw}^{t}\quad f\in F,w\in W,t\in T_{fw}\] (13) \[\underline{TQ}_{wc}^{t}u_{wc}^{t}\leq\sum_{p\in P}TQU^{pt}DEM_{c }^{p}u_{wc}^{t}\leq\overline{TQ}_{wc}^{t}u_{wc}^{t}\quad w\in W,c\in C,t\in T_ {wc} \tag{14}\]  
_Binary and non-negativity constraints_  
\[z_{fq}\in\{0,1\} f\in F,q\in Q \tag{15}\] \[z_{uwq}\in\{0,1\} w\in W,q\in Q\] (16) \[v_{sf}^{s}\in\{0,1\} s\in S,f\in F,r\in R\] (17) \[x_{fw}^{pt}\in\mathbb{R}_{\geq 0} f\in F,w\in W,p\in P,t\in T\] (18) \[x_{sf}^{rt}\in\mathbb{R}_{\geq 0} s\in S,f\in F,r\in R,t\in T\] (19) \[u_{od}^{t}\in\{0,1\} (o,d)\in\{(S,F)\cup(F,W)\cup(W,C)\},t\in T \tag{20}\]