# Efficient Dynamic Cost Scheduling Algorithm for Financial Data Supply Chain
## 3 Data Batch Algorithm
### Dynamic Cost Scheduling Algorithm for Data Batch Processing (DCSDBP)
#### 3.1.4 Problem Decision Variables
Subject to:  
\[\sum_{k=1}^{K}X_{ik}^{T}+\sum_{r=1}^{V}Y_{ir}^{T}\leq M_{i}f_{i}^{T}\ \forall\ i\in I^{T}\text{ where }\text{M}i=\text{min }\{e_{i},n_{i}-q_{i}^{T},\ K+V\} \tag{12}\]  
The constraint in Equation (12) is concerned with leased and additionally rented processors allocation and their availability to ensure that the total file allocation does not exceed either file multiprocessing \(ei\) or file required remaining processing \(n_{i}\) or the total number of available basic and extra processors (\(K\),\(V\)) for any file \(i\) at a certain time \(T\). \[q_{i}^{T}\leq n_{i}\ \forall\ i\in I \tag{13}\]  
The constraint in Equation (13) ensures that the number of times a file is processed is less or equal to the needed processing time. \[\sum_{i=1}^{I^{\prime}}X_{ik}^{T}\leq P_{k}^{T}\ \forall\ k\in K \tag{14}\]  
The constraint in Equation (14) ensures that exactly one data file is allocated to a single leased processor. \[\sum_{i=1}^{I^{\prime}}Y_{ir}^{T}\leq W_{r}^{T}\ \forall\ r\in R \tag{15}\]  
The constraint in Equation (15) ensures that exactly one data file is allocated to a single additionally rented processor. \[X_{ik}^{T}\ 0\ \text{or}\ 1\ \forall\ i\in I\text{ and }k\in K \tag{16}\]  
The constraint in Equation (16) declares that the decision variable \(X_{ik}\) is binary, meaning that file \(i\) either be assigned to a leased processor or not. \[Y_{ir}^{T}=\ \ 0\ \ \ \ \text{or}\ \ \ 1\ \ \ \forall\ i\in I\text{ and }r\in R \tag{17}\]  
The constraint in Equation (17) declares that the decision variable \(Y_{ir}\) is binary, meaning that a file \(i\) either be assigned to an additionally rented processor or not. Step 4: Update Utilized Extra Processors  
Critical path duration  
Calculate \(U^{T}=\text{duration of the remaining critical path at time }T.ES_{i}^{T}=\text{Max}\)  
\[\{ES_{j}^{T}+(n_{i}-q_{i}^{T})\}\ \forall\ i\text{ and }j\ \in\ I\text{ where }(i\
eq j)\text{ and}\alpha_{i}<=\alpha_{j} \tag{18}\]\[ES_{i}^{T}\ =\ 0\ \forall\ i\ =\ 0 \tag{19}\]  
\[LS_{i}^{T}=\text{Min }\{LS_{j}^{T}-(n_{i}-q_{i}{}^{T})\}\ \forall\ i\ \text{and}\ j\ \in\ \text{$I$ where }(i\
eq j)\ \text{and}\alpha_{i}<=\alpha_{j} \tag{20}\]  
\[S_{i}^{T}=LS_{i}^{T}-ES_{i} \tag{21}\]  
\[q_{i}^{T}\leq n_{i}\ \forall\ i\in I \tag{13}\]0  
In the above equations the slack \(S_{i}^{T}\) for each file \(i\) is calculated and the critical path for the network \(U^{T}\) is found for the files with slack equal to zero (\(S_{i}^{T}=0\)). Checking critical path duration against SLA  
\[q_{i}^{T}\leq n_{i}\ \forall\ i\in I \tag{13}\]1  
Then  
\[q_{i}^{T}\leq n_{i}\ \forall\ i\in I \tag{13}\]2  
Else  
\[q_{i}^{T}\leq n_{i}\ \forall\ i\in I \tag{13}\]3  
The above equations calculate the penalty cost \(TC_{p}\) for all cases of critical path duration against \(SLA\). Cost of renting extra processor in case there is a delay  
If  
\[q_{i}^{T}\leq n_{i}\ \forall\ i\in I \tag{13}\]4  
Then  
\[q_{i}^{T}\leq n_{i}\ \forall\ i\in I \tag{13}\]5  
Else  
\[q_{i}^{T}\leq n_{i}\ \forall\ i\in I \tag{13}\]6  
The above equations calculate the extra processor renting cost \(T_{H}\) in case of a delay. Amount of processing to completion  
\[q_{i}^{T}\leq n_{i}\ \forall\ i\in I \tag{13}\]7  
Decision on renting extra processor  
If  
\[q_{i}^{T}\leq n_{i}\ \forall\ i\in I \tag{13}\]8  
Then  
\[q_{i}^{T}\leq n_{i}\ \forall\ i\in I \tag{13}\]9  
\[\sum_{i=1}^{I^{\prime}}X_{ik}^{T}\leq P_{k}^{T}\ \forall\ k\in K \tag{14}\]0  
\[\sum_{i=1}^{I^{\prime}}X_{ik}^{T}\leq P_{k}^{T}\ \forall\ k\in K \tag{14}\]1  
In the above equations, the number of rented extra processor \(V^{T}\) is increased by one if the penalty cost \(TC_{p}\) is greater than the extra processor renting cost \(T_{H}\). In this step, we are calculating the maximum completion time using CPM without considering splitting because the decision to multi-process a job is not taken yet. A job multi-processing means it can be split if needed to minimize the completion time of the batch process. CPM is not the only tool in this study to make the decision.