## 4 MILP Model Formulation
### MILP Model
#### 4.1.2 Constraints  
The constraints in the MILP model are divided into the following two parts. \[C_{\max}\geq C_{isl_{s}},\forall i\in I \tag{2}\]  
\[\sum_{i\in I}X_{ihjk}+XF_{hjk}=\mathrm{A}_{hjk},\forall h\in I;j\in J,k\in M_{j} \tag{3}\]  
\[\sum_{k\in M_{j}}\mathrm{A}_{hjk}=1,\forall h\in I;j\in J \tag{4}\]  
\[C_{ijk}\geq AT_{ij}^{k}+\mathrm{A}_{ijk}\times PT_{ijk},\forall i\in I,j\in J,k\in M_{j} \tag{5}\]  
\[\sum_{i\in I}X_{ihjk}+XF_{hjk}-\sum_{b\in I}X_{hbjk}-XL_{hjk}=0,\forall h\in I ;j\in J;k\in M_{j} \tag{6}\]  
\[C_{hjk}-\mathrm{A}_{hjk}\times PT_{hjk}+L\times\left(1-X_{ihjk}\right)\geq C_ {ijk},\forall i,h\in I;j\in J;k\in M_{j} \tag{7}\]  
\[\sum_{i\in I}XL_{ijk}\leq 1,\forall j\in J,k\in M_{j} \tag{8}\]  
Inequality (2) ensures the correct makespan value. Constraint (3) aims to establish the relation among the decision variables set for job sequence and machine assignment sub-problems. Constraint (4) ensures that each operation is executed on one machine. Constraint (5) ensures that the completion time of a specific operation on a machine must exceed the job's arrival time. Constraint (6) ensures that, for a specific machine, each job only has a single predecessor (which will transform into a dummy/null job for the first job in each machine) and a single successor (which will transform into a dummy/null job for the last job in each machine). Constraint (7) prevents any two jobs from overlapping on the same machine in any processing stages. Constraint (8) ensures that each machine in any stage can only process one job at a time at most. \[\sum_{i\in I}\sum_{j\in J}Y_{ij}^{F}\leq r \tag{9}\]  
\[\sum_{i\in I}\sum_{j\in J}Y_{ij}^{F}=\sum_{i\in I}\sum_{j\in J}Y_{ij}^{L} \tag{10}\]  
\[\sum_{h\in I}\sum_{f\in J}Y_{ij}^{hf}+Y_{ij}^{L}=1,\forall i\in I;j\in J \tag{11}\]  
\[\sum_{i\in I}X_{ihjk}+XF_{hjk}=\mathrm{A}_{hjk},\forall h\in I;j\in J,k\in M_{j} \tag{3}\]0\[ \begin{split} AT^{k^{\prime}}_{hf}-AT^{k}_{ij}-TC^{k^{\prime\prime}}_{k}- TC^{k^{\prime\prime}}_{k^{\prime\prime}}-TC^{k^{\prime}}_{k^{\prime\prime}}+L\times \left(4-\gamma^{hf}_{ij}-A_{h,f-1,k^{\prime\prime}}-A_{hf,k^{\prime}}-A_{ijk} \right)\geq 0,\\ \forall i,h\in I;j\in J;f\in J\backslash\{1\};k\in M_{j};k^{ \prime}\in M_{f};k^{\prime\prime}\in M_{f-1}\\ AT^{k^{\prime}}_{h1}-AT^{k}_{ij}-TC^{LU}_{k}-TC^{k^{\prime}}_{LU }+L\times\left(3-Y^{h1}_{ij}-A_{h1,F}-A_{ijk}\right)\geq 0,\\ \forall i,h\in I;j\in J;k\in M_{j};k^{\prime}\in M_{1}\\ AT^{k}_{hf}-C_{h,f-1,k^{\prime}}-TC^{k}_{k}+L\times\left(2-A_{ hftk}-A_{h,f-1,k^{\prime}}\right)\geq 0,\\ \forall h\in I;f\in J\backslash\{1\};k\in M_{j};k^{\prime}\in M _{f-1}\\ AT^{k}_{h1}-TC^{k}_{LU}+L\times\left(2-A_{h1k}-Y^{F}_{h1}\right) \geq 0,\forall h\in I;k\in M_{1}\\ X_{ihjk},XF_{ijk},XL_{ijk},A_{ijk}\in\{0,1\},\forall i,h\in I;j \in J;k\in M_{j}\\ Y^{hf}_{ij},Y^{F}_{ij},Y^{L}_{ij}\in\{0,1\},\forall i,h\in I;j,f \in J\\ C_{\max},C_{ijk},AT^{k}_{ij}\geq 0,\forall i\in I;j\in J;k\in M_{j} \end{split}  \tag{13}\]  
Constraint (9) and Constraint (10) ensure that the count of the first transport tasks is at most the number of AGVs and the same as the count of the last transport tasks. Constraint (11) ensures that each transport task is either the first task of an AGV, or it is immediately preceded by another transport task. Constraint (12) mandates that each transport task is either the last task of an AGV, or it is followed by another transport task. Constraint (13) ensures that for the operation Ohf executed, except for the first processing stage (f \(\
eq\) 1), if the AGV had transported another job immediately prior to the current one, then it must do the following: (i) deliver such job to its corresponding machine; (ii) pick up the current job from where its previous Oh(f-1) was processed; (iii) deliver it to the machine processing the current Ohf. Constraint (14) provides a supplement to Constraint (13) when f equals one. The difference is that the current job will be picked up from the LA, since it is the first operation.