# Computing Idle Times in Fuzzy Flexible Job Shop Scheduling
## 3 Idle Times with Fuzzy Durations
### An Approach Incorporating Schedule Knowledge  
If we consider again the previous example, the problem stems from the fact that \(\widehat{s}_{\phi}(w)\) and \(\widehat{c}_{\phi}(v)\) are linked variables. Indeed, the starting time of \(w\) is computed according to Equation (11); that is, \(\widehat{s}_{\phi}(w)=\max\{\widehat{c}_{\phi}(u),\widehat{c}_{\phi}(v)\}\). Substituting in the difference component of the idle time (16),  
\[\widehat{s}_{\phi}(w)-\widehat{c}_{\phi}(v)=\max\{\widehat{c}_{\phi}(u), \widehat{c}_{\phi}(v)\}-\widehat{c}_{\phi}(v).\]  
Now, given the way in which the difference and the maximum are defined in (3) and (4), we can rearrange the elements in this equation, so  
\[\hat{I}^{N}_{\phi}(w)=\max\{(0,0,0),\widehat{c}_{\phi}(u)-\widehat{c}_{\phi}( v),\widehat{c}_{\phi}(v)-\widehat{c}_{\phi}(v)\}.\]  
Of course, in a fuzzy schedule, \(\widehat{c}_{\phi}(v)\) is an uncertain quantity, but we know that the underlying variable cannot take two different values in the same schedule, so, in this context, \(\widehat{c}_{\phi}(v)-\widehat{c}_{\phi}(v)\) must be \((0,0,0)\), which means that the idle time for \(w\) should, in fact, be equal to \(\max\{(0,0,0),\widehat{c}_{\phi}(u)-\widehat{c}_{\phi}(v)\}\).  
Notice that this expression makes sense from the scheduling point of view since it means that the idle time is the time difference between the completion time of the job predecessor and the resource predecessor, i.e., the time the resource has to wait once it has finished processing the resource predecessor of operation, \(o\), until the other predecessor of \(o\) is completed. This suggests an alternative definition of the idle time of an operation, \(o\), which takes into account our knowledge of schedules:  
Figure 1: Example to illustrate idle time calculations.  
\[\hat{I}_{\phi}^{K}(o)=\begin{cases}(0,0,0)&\text{if }\eta(o)=\min\{\eta(u): \chi(u)=\chi(o)\}\\ &\quad\lor o=\alpha_{\phi}(\tau_{\phi}(o))\\ &\quad\lor\tau_{\phi}(JP(o))=\tau_{\phi}(RP(o))\\ \max\{(0,0,0),\widehat{c}_{\phi}(JP(o))-\widehat{c}_{\phi}(RP_{\phi}(o))\}& \text{otherwise}\end{cases} \tag{18}\]  
That is, in general, we take the idle time for \(o\) to be the difference between the completion times of its predecessors in the resource and the job (discounting negative values), with three exceptions. In the case that \(o\) is either the first operation in its job or the first operation to be processed in its resource, the idle time will be \((0,0,0)\). Additionally, unlike in the traditional job shop, in the flexible variant, it is possible that both the resource and the job predecessor are executed in the same resource, that is, \(\tau_{\phi}(JP(o))=\tau_{\phi}(RP(o))\); due to resource constraints, one must be executed before the other, and operation \(o\) can thus start as soon as the latest predecessor is completed, resulting in no idle time.  
Once the idle time for an operation is defined, the core idle time for resource \(r\) is again given by the sum of idle time for the operations scheduled in \(r\):  
\[\widehat{\text{CIT}}_{\phi}^{K}(r)=\sum_{o\in\mathbf{O}:\tau_{\phi}(o)=r}\hat {I}_{\phi}^{K}(o) \tag{19}\]  
Let us go back to the toy example of Section 3.1; if the idle time of operation \(w\) is computed using (18), we have \(\hat{I}_{\phi}^{K}(w)=\max\{(1-30,2-25,3-20),(0,0,0)\}=(0,0,0)\). This results in a TFN without added artificial uncertainty, as expected.