## 2 Materials and Methods
### GERT Model for User Data Processing in the Recommendation System
#### 2.2.1. GERT Model of the First Stage of User Request Processing
Formally, for a system with possible cycles, this can be expressed through a system of equations incorporating Markov logic or by using the shortest path method with probabilities adapted for GERT. This approach not only allows for the estimation of the average time to complete the stage but also enables the identification of the most resource-intensive and sensitive segments (e.g., excessive accumulation of probability on the return arc \(W_{42}\)). However, in modern GERT models (unlike the more approximate \"step-by-step\" evaluations in the previous example), the calculation is performed through an equivalent transfer function. This function accounts for the following:  
* transition probability \(p_{ij}\);
* intensity or delay (time distribution law)--via the Laplace function for time \(T_{ij}\). The result is an equivalent transfer function of the GERT arc:  
\[W_{ij}(s)=p_{ij}\times M_{ij}(s) \tag{1}\]  
where \(W_{ij}(s)\) is the Laplace transform of the execution time along arc \(i\to j\). In this expression, \(p_{ij}\) represents the probability of transitioning from node i to node j, while \(M_{ij}(s)\) is the Laplace transform of the probability distribution function of the processing time associated with that transition. The function \(M_{ij}(s)\) encodes the stochastic duration of the corresponding process step in the frequency domain. One of the tasks at this stage of modeling is the selection of the distribution function for the random variable representing transition execution time. In a number of studies [31], the problem formulation used the exponential distribution for transition times between nodes in the GERT graph. This is due to its mathematical simplicity. The Laplace transform for the exponential distribution is \(M(s)=\frac{\lambda}{\lambda+s}\), which significantly simplifies analytical calculations. Nevertheless, despite the popularity of the exponential distribution in queueing theory, its application in modeling systems for processing user requests is not always justified. The exponential distribution has the memoryless property, meaning the probability of completing an operation in the next moment does not depend on how much time has already passed. This is acceptable for modeling asynchronous events such as request arrivals or trigger activations. However, within the system under consideration, stages such as categorization, validation, and weight assignment typically require a fixed or nearly fixed processing time. To model the execution time of individual stages, the Erlang distribution was chosen--a special case of the gamma distribution, applied when the process consists of \(k\) sequential phases, each following an exponential distribution. The advantages of mathematical formalization using the Erlang distribution include the following factors. * Physical realism, as it reflects the step-by-step structure of tasks (e.g., request parsing \(\rightarrow\) entity extraction \(\rightarrow\) category matching);
* Controllable variance, since for a fixed rate \(\boldsymbol{\lambda}\), increasing the parameter k makes the distribution closer to deterministic;
* Positive start time, as there is no probability of zero-time completion. The Laplace transform for the Erlang distribution is given by the following:  
\[M(s)=(\frac{\lambda}{\lambda+s})^{k} \tag{2}\]  
Taking the presented facts into account, the equivalent time function for the first stage of user request processing is calculated as follows:  
\[W_{E}(s)=\frac{W_{12}W_{23}W_{35}W_{56}}{1-W_{23}W_{34}W_{42}} \tag{3}\]  
The use of the proposed equivalent \(W\)-function will, subsequently, enable the derivation of an analytical expression for calculating the time required to implement the first stage of user request processing. In addition, this approach allows for determining the complete distribution function of the request traversal time through the model.