## 5 Mathematical Models
### Mathematical Model after the Disruption  
This second model is used after a disruption caused by z new jobs arrival. Thus, the new jobs have the same entry parameters as the first ones. For each job, we have \(r_{j}\), \(w_{j}\), \(p_{j}\). The new parameters are:  
\(n^{\prime}=n+z\).  
\(N\): The set of jobs \(\{1,\,2,\,\ldots,\,n^{\prime}\}\).  
\(K\): The set of positions \(\{1,\,2,\ldots,\,n^{\prime}\}\).  
\(j\): The index of job \(j=1,2,\,\ldots,\,n^{\prime}\).  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline _Job_ & \(C\) & \(A\) & \(E\) & \(D\) & \(B\) \\ \hline \(p_{j}\) & 2 & 1 & 4 & 3 & 2 \\ \(r_{j}\) & 0 & 1 & 2 & 0 & 1 \\ \(w_{j}\) & 4 & 5 & 3 & 2 & 1 \\ \(C_{j}\) & 2 & 3 & 7 & 10 & 12 \\ \(w_{j}W_{j}\) & 0 & 5 & 3 & 14 & 9 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Optimal solution for the initial problem.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline _Job_ & \(C_{1}\) & \(A\) & \(C_{2}\) & \(E\) & \(D\) & \(B\) \\ \hline \(C_{j}\) & 1 & 2 & 3 & 7 & 10 & 12 \\ \(w_{j}W_{j}\) & - & 0 & 4 & 3 & 14 & 9 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Solution obtained with \(wSRPT\).  
\(k\): The index of position \(k\) =1, 2,..., \(n^{\prime}\).  
\(\alpha\): The efficiency-stability coefficient.  
\(Co_{j}\): The original completion time of job \(j\) (obtained by the resolution of the initial problem).  
The new objective function is given by: \(Min\,\underset{j\,=\,1\,}{\overset{n^{\prime}}{\sum}}w_{j}W_{j}+(1-\alpha) \underset{j\,=\,1\,}{\overset{n^{\prime}-z}{\sum}}w_{j}(C_{j}-Co_{j})\).  
The constraints (1) until (10) are also used for this new model. In this second case, it is supposed that a disruption occurs while the machine executes a job. Therefore, we noted by td the current time when a disruption occurs. Indeed, all jobs that started their execution before td must keep the same position. Thus, we denoted by xojk the variable assigning jobs to positions in the original schedule, which are memorized when the initial model is solved. Then, the constraint (11), which allows saving the same sequence is defined as:  
\[if\,S_{k}<t_{d}x_{jk}\,\,=\,\,xo_{jk}\forall j\,\in N,\,\,\forall k\in K \tag{11}\]  
Constraint (12) makes the completion time of a job greater than its original completion time since the original completion time have been obtained through minimization of the principal criterion _TWWT_ only. The job and will not be moved forward after the rescheduling.  
\[C_{j}\geq Co_{j}\forall j\in N\prime \tag{12}\]  
**Example 2**.: _In this example, the same initial problem is considered assuming that the jobs F and G arrive when the machine executes the schedule (see Figure 4)._  
The job F arrives at \(r_{F}\) = 2, with \(p_{F}\) =1 and \(w_{F}\) = 5. Coefficient \(\alpha\) is given as \(\alpha\) = 0.5. So, the optimal solution will be CAFEDB and the optimal value of the objective function is \(\alpha\underset{j\,=\,1\,}{\overset{6}{\sum}}w_{j}W_{j}+(1-\alpha)\underset{j \,=\,1\,}{\overset{5}{\sum}}w_{j}(C_{j}-Co_{j})\,\,=\,\,24\). Optimal solution is given in Table 4.  
The job G arrives at \(r_{G}\) = 3, with \(p_{G}\) = 1 and \(w_{G}\) = 1. Coefficient \(\alpha\) is set to \(\alpha\) = 0.5 (see Figure 5).  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline _Job_ & \(C\) & \(A\) & \(F\) & \(E\) & \(D\) & \(B\) \\ \hline \(p_{j}\) & 2 & 1 & **1** & 4 & 3 & 2 \\ \(r_{j}\) & 0 & 1 & **2** & 2 & 0 & 1 \\ \(w_{j}\) & 4 & 5 & **5** & 3 & 2 & 1 \\ \(C_{j}\) & 2 & 3 & **4** & 8 & 11 & 13 \\ \(w_{j}W_{j}\) & 0 & 5 & **5** & 6 & 16 & 10 \\ \(w_{j}(C_{j}\)-Co\({}_{j})\) & 0 & 0 & & 3 & 2 & 1 \\ \hline \hline \end{tabular}
\end{table}
Table 4: Optimal solution after the disruption caused by job F arrival.  
Figure 4: Disruption caused by job F arrival.  
The optimal solution becomes CAFEDBG and the optimal value is \(a\sum_{j=1}^{7}w_{j}W_{j}+(1-\alpha)\sum_{j=1}^{6}w_{j}(C_{j}-Co_{j})\ =\ 29\). The new optimal solution is given in Table 5.