## 2 FJSSP Description
The indices, sets, data, variables, and mathematical model formulation to optimize the FJSSP are as follows:  
Indices  
\(j\)  
Job index  
\(h\)  
Job index  
\(i\)  
Operation index  
\(k\)  
Machine index  
\(l\)  
Index of the positions in the sequencing  
Parameters:  
\(n\)  
Total number of jobs  
\(m\)  
Total number of machines  
Binary parameter to indicate whether operation \(i\) of the job \(j\) is performed on machine \(k\)  
\(P_{kij}\)  
Processing time of operation \(i\) of the job \(j\) on machine \(k\)  
\(S_{kjh}\)  
Setup time in machine \(k\) if job \(j\) starts after completing job \(h\)  
Very large number  
\(d_{jA}\)  
Lower limit of the due window of job \(j\)  
\(d_{jB}\)  
Upper limit of the due window of the job \(j\)  
\(w_{j}\)  
Weighting for job \(j\)  
\(w_{T}\)  
Weighting for tardiness  
\(w_{E}\)  
Weighting for earliness  
Variables:  
\(X_{ijkl}\)  
Binary variable to indicate whether operation \(i\) of job \(j\) on machine \(k\) is sequenced in position \(l\)  
\(V_{ijk}\)  
Binary variable to assign operation \(j\) of job \(i\) on machine \(k\)  
\(TM_{kl}\)  
Start time of machine \(k\) at position \(l\)  
\(PS_{ij}\)  
Total process time (includes setup time) of operation \(i\) of job \(j\)  
\(T_{lj}\)  
Start time of operation \(i\) of job \(j\)  
\(C_{j}\)  
Completion time of job \(j\)  
\(T_{j}\)  
Tardiness of job \(j\)  
\(E_{j}\)  
Earliness of job \(j\)  
Model:  
\[Min\quad Z=\sum W_{i}(T_{i}\,W_{T}+E_{i}W_{E}) \tag{1}\]  
\[C_{j}\geq T_{lj}+PS_{ij}\quad\forall\,i,j \tag{2}\]  
\[T_{j}\geq C_{j}-d_{jB}\quad\quad\forall\,j \tag{3}\]  
\[E_{j}\geq d_{jA}-C_{j}\quad\quad\forall\,j \tag{4}\]  
\[\sum_{k}[(P_{kij}+S_{kji})\times V_{ijk}]=PS_{ij}\quad\quad\forall\,i,j,h \tag{5}\]  
\[Tl_{ij}+PS_{ij}\ \leq Tl_{i+1j}\quad\forall\,j\quad\forall\,i=1,\dots,I-1 \tag{6}\]  
\[TM_{kl}+PS_{ij}\times X_{ijkl}\leq TM_{kl+1}\quad\quad\forall\,i,j,k\quad \forall\,l=1,\dots,L-1 \tag{7}\]  
\[TM_{kl}\leq Tl_{ij}\,\left(1-X_{ijkl}\right)\times M\quad\forall\,i,j,k,\,l \tag{8}\]\[TM_{kl}\leq TM_{kl}\Big{(}1-X_{ijkl}\Big{)}\times M\ \ \ \forall\ i,j,k,\ l \tag{9}\] \[V_{ijk}\leq A_{kij}\ \ \ \forall\ i,j,k\] (10) \[C_{j}\geq T_{lj}+PS_{ij}\quad\forall\,i,j \tag{2}\]0 (11) \[C_{j}\geq T_{lj}+PS_{ij}\quad\forall\,i,j \tag{2}\]1 (12) \[C_{j}\geq T_{lj}+PS_{ij}\quad\forall\,i,j \tag{2}\]2 (13) \[C_{j}\geq T_{lj}+PS_{ij}\quad\forall\,i,j \tag{2}\]3 (14) \[C_{j}\geq T_{lj}+PS_{ij}\quad\forall\,i,j \tag{2}\]4 (15) \[C_{j}\geq T_{lj}+PS_{ij}\quad\forall\,i,j \tag{2}\]5 (16) \[C_{j}\geq T_{lj}+PS_{ij}\quad\forall\,i,j \tag{2}\]6 (17) \[C_{j}\geq T_{lj}+PS_{ij}\quad\forall\,i,j \tag{2}\]7  
Equation (1) minimizes the total weighted penalty of the jobs given by lateness and promptness, where the earliness of a job is defined as the maximum between zero and the difference between the lower limit of the due window and the completion time of said job \(E_{j}=Max\big{(}\ 0\,\ d_{jA}-C_{j}\big{)}\), and the tardiness of a job is defined as the maximum between zero and the difference between the completion time and the upper limit of the due window of said job \(T_{j}=Max\big{(}\ 0\,\ C_{j}-d_{jB}\big{)}\). Although the proposed model deals with two performance measures, these are represented in a single objective function (total penalty) that relates them through weights, which allows lateness and promptness to be assessed differently according to the decision-maker preferences. Constraint (2) calculates the completion time of the operations of each job. Constraints (3) and (4) define respectively the tardiness and earliness of each job based on the limits of the due dates. Constraint (5) ensures that the total processing time of each job includes the machine processing time and the setup time. Constraint (6) guarantees the compliance of precedence of operations. Constraint (7) ensures that machines can perform one operation at a time. Constraints (8) and (9) guarantee that any operation starts when the assigned machine is available, and the previous operation is completed.