## 2 Problem Statement and Mixed Integer Linear Programming (MILP) Model
\begin{table}
\begin{tabular}{|c|c c c c c c c c c c c c c|} \hline \hline  & \multicolumn{3}{c}{**Orders**} & \multicolumn{3}{c}{**Plant**} & \multicolumn{3}{c}{**Batches**} & \multicolumn{3}{c}{**Delivery**} & \multicolumn{3}{c}{**Tardiness**} \\ \hline
**Customer** & **Job** & \(p_{j}\) & \(d_{j}\) & \(v_{j}\) & \(h_{n}\) & **Machine** & \(x_{j}\) & \(x_{j}\)**+\(p_{j}\)** & **Batch** & **Truck** & \(\tau_{k}\) & \(r_{k}\)**+\(h_{n}\)** & \\ \hline \multirow{3}{*}{1} & J1 & 40 & 150 & 8 & 90 & 2 & 0 & 40 & B1 & 2 & 40 & 130 & 0 \\  & J2 & 60 & 300 & 7 & 2 & 140 & 200 & B2 & 2 & 240 & 330 & 30 \\  & J3 & 30 & 100 & 10 & & 1 & 0 & 30 & B3 & 1 & 30 & 130 & 30 \\  & J4 & 30 & 200 & 3 & & 2 & 40 & 70 & & & & & 40 \\  & J5 & 50 & 250 & 4 & 10 & 1 & 80 & 130 & B4 & 2 & 140 & 240 & 0 \\  & J6 & 20 & 250 & 2 & & 2 & 120 & 140 & & & & & 0 \\  & J7 & 50 & 180 & 5 & & 1 & 30 & 80 & & & & 20 \\
3 & J8 & 50 & 200 & 4 & 80 & 2 & 70 & 120 & B5 & 1 & 120 & 200 & 0 \\  & J9 & 40 & 250 & 7 & & 1 & 130 & 170 & B6 & 1 & 200 & 280 & 30 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Input data and the resulting tardiness of each job. Figure 1: An example of schedules for the integrated scheduling problem. \[\sum_{j\in j}z^{M}_{jim}=y^{M}_{im}\,\ \ for\ \forall i\in J;\ \forall m\in M \tag{5}\]  
\[\sum_{ \begin{subarray}{c}j\in J\\ j\
eq i\end{subarray} }z^{M}_{jim}\leq y^{M}_{im}\,\ \ for\ \forall i\in J;\ \forall m\in M \tag{6}\]  
\[j\
eq i\]  
\[\sum_{k\in B}y^{B}_{ik}=1,\ \ \ for\ \forall i\in J \tag{7}\]  
\[\sum_{i\in J}v_{i}y^{B}_{ik}\leq V,\ \ \ for\ \forall k\in B \tag{8}\]  
\[y^{B}_{ik}+y^{B}_{jk}\leq 1+\sum_{n\in C}R_{in}\cdot R_{jn},\ \ \ for\ \forall k\in B;\forall\ i,j\in J\ \text{and}\ i<j \tag{9}\]  
\[r_{k}\geq(x_{i}+p_{i})-Q\left(1-y^{B}_{ik}\right),\ \ \ for\ \forall i\in J;\ \forall k\in B \tag{10}\]  
\[\sum_{n\in C}y^{C}_{kn}\leq 1,\ \ \ for\ \forall k\in B \tag{11}\]  
\[y^{C}_{kn}\geq R_{in}\cdot y^{B}_{k},\ \ \ for\ \forall i\in J;\ \forall k\in B; \forall n\in C \tag{12}\]  
\[r_{k}+\sum_{n\in C}h_{n}\cdot y^{C}_{kn}\leq r_{l}+Q\left(1-\sum_{l\in T}z^{T} _{kl}\right)\ \ \ for\ \forall k,l\in B;\ k\
eq l \tag{13}\]  
\[\sum_{t\in T}y^{T}_{kt}=1,\ \ \ for\ \forall k\in B \tag{14}\]  
\[\sum_{k\in B}z^{T}_{kt}\leq 1,\ \ \ for\ \forall t\in T \tag{15}\]  
\[\sum_{k\in B}y^{B}_{ik}=1,\ \ \ for\ \forall i\in J \tag{7}\]0  
\[\sum_{ \begin{subarray}{c}l\in B\\ l\
eq k\end{subarray} }z^{T}_{klt}\leq y^{T}_{kt^{\prime}},\ \ \ for\ \forall k\in B;\ \forall t\in T \tag{17}\]  
\[r_{k}+\sum_{n\in C}h_{n}\cdot y^{C}_{kn}-d_{i}\leq\tau_{i}+Q\left(1-y^{B}_{ik} \right),\ \ \ for\ \forall i\in J;\ \forall k\in B \tag{18}\]  
\[x_{i},\ \tau_{i}r_{k}\geq 0,\ \ \ for\ \forall i\in J;\ \forall k\in B \tag{19}\]  
\[y^{M}_{im}\,y^{B}_{ik^{\prime}},\ y^{T}_{kt^{\prime}},y^{C}_{kn}=0\ \text{or}\ 1,\ \ \ for\ \forall i\in J;\ \forall k\in B;\forall t\in T;\ \forall n\in C \tag{20}\]  
\[x^{M}_{ijm},\ x^{T}_{kt}=0\ \text{or}\ 1,\ \ \ for\ \forall i,j\in J;\ \forall m\in M;\ \forall k,l\in B;\ \forall t\in T \tag{21}\]  
Constraint (2) is to determine the precedence relation of producing jobs within the same machine at the manufacturing plant and calculate the starting time of processing the jobs. Constraint (3) restricts that each job must be assigned to one of the machines in the manufacturing plant. Constraints (4)-(6) have a relation that jobs assigned to the same machine must appear exactly once in their sequence. Constraint (4) ensures that the beginning of the production sequence in each machine can assign, at most, one job. So, one job must be assigned to the first position if the rest of jobs are succeeded by the job in each machine. Constraint (5) guarantees that one job will be immediately preceded by one job in a machine if it is assigned to the machine, and Constraint (6) also guarantees that one job will be immediately succeeded by at most one job, if the job is assigned to one of machines. Also, no succeeding job is allowed if the job exists at the last position of the sequence in machines.