# 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 \begin{tabular}{l l} \hline \(X_{IK}^{T}\) & Binary variable equal to 1 if data file \(i\) allocated to processor \(k\), and 0 otherwise. \\ \(Y_{ir}^{T}\) & Binary variable equal to 1 if data file \(i\) is allocated to extra processor \(r\), and \\ \end{tabular}   
The DCSDBP algorithm is illustrated in Figure 2 and the step-by-step description of the algorithm is as follows. Step 1: Preparatory and Initialization Stage  
This step involves preparing the initial data which consists of the subset of data files that are ready for processing and the availability of leased and rented. We also set:  
1. The extra processors' utilization parameter to zero indicating that no extra processor is used at the beginning of the allocation process. 2. The data files processing parameters to zero meaning that files are not being processed yet. In addition to that, the time loop is initialized where time is set to zero. At the end of the step, we initialize all data needed to start the iterative algorithm. \[l^{T}=\{\} \tag{1}\]  
Figure 2: Dynamic Cost Scheduling Algorithm for Data Batch Processing (DCSDBP). Set  
\[P_{k}=1\ \forall\ k\in K \tag{2}\]  
Set  
\[Wr=1\ \forall\ r\in R \tag{3}\]  
Set  
\[V^{T}=0 \tag{4}\]  
Equation (4) indicates that the number of rented extra processors acquired at this time period \(V^{T}\) is zero. Set  
\[q_{i}^{T}\ =\ 0\ \forall\ i\in I \tag{5}\]  
Set  
\[T=0 \tag{6}\]  
Equation (6) indicates the beginning of the time loop of the algorithm where the time \(T\) is set to zero. Step 2: Set of Files Available for Processing  
We assign parameters and weights to the subset of data files available for processing \(I^{T}\) based on their precedence obtained from the dependency matrix. If:  
\[\sum_{j=1}^{J}l_{ij}^{T}=\ 1\ \forall\ i \tag{7}\]  
Then set:  
\[f_{i}^{T}=1 \tag{8}\]  
\[I^{T}=I^{T}+\{i\} \tag{9}\]  
Figure 2:0  
\(\alpha_{i}^{T}\) is the weight for each data file. It is calculated using the precedence/dependency matrix by finding the number of files that depend on file i. This step will indicate the set of data files available for processing which will serve as input for step 3 to start the scheduling of available files on the available processors. Step 3: Allocation of Files to Processors  
In this step, the algorithm allocates files to processors. The model presented in this step will allocate files with the objective function (11) of minimizing data file allocation cost while taking into consideration priority, weight and criticality of each file included in each subset at any time \(T\). \[ \begin{array}{c}\text{Min }(Z\ \text{T})\ =\ \sum\limits_{i=1}^{I^{T}}\sum\limits_{k=1}^{ K}(\frac{Cs_{\text{pr}}+\frac{Cs_{\text{pr}}}{BW}}{\beta_{i}\ a_{i}^{T}})\ X_{ik}^{T}+\sum\limits_{k=1}^{K}\ (\frac{Cs_{\text{pr}}+Ch}{BW})\ (1-\sum\limits_{i=1}^{I^{T}}X_{ik}^{T})+\sum \limits_{i=1}^{I^{T}}\sum\limits_{v=1}^{V}(\frac{Cs_{\text{pr}}+Cs_{\text{pr}} +C\text{ch}}{\beta_{i}\ a_{i}^{T}})Y_{ir}^{T}+\\ \sum\limits_{v=1}^{V}(C\text{esf}+C\text{ch})\ (1-\sum\limits_{i=1}^{I^{T}}Y_{ir}^{T}) +A^{T}*\ Cp\ *\ (T- SLA)\end{array}  \tag{11}\]  
The first term considers the basic processors leasing cost, weight \(\alpha_{i}^{T}\) and priority \(\beta_{i}\) at any time unit \(T\). The second term considers the opportunity cost of not utilizing the leased processors at any time unit \(T\). The third term handles the cost of renting additional processors, weight \(\alpha_{i}^{T}\) and priority \(\beta_{i}\) at any time unit \(T\). The fourth term considers the opportunity cost of not utilizing the additionally rented processors at any time \(T\). the last term is concerned with the penalty cost of exceeding the _SLA_. The \(\beta_{i}\)\(a_{i}^{T}\) used in terms 1 and 3 ensures that files with higher priority and weight are scheduled first. _BW_ is the available time during which processing can take place. It is used in Equation (11) to find what the fixed cost of resources per unit time is.