## 3 Proposed System Model
### Lagrange Duality Resource Optimization Algorithm (LDROA)  
The LDROA transforms optimization problems with constraints into unconstrained ones by introducing Lagrange multipliers which enforce the constraints and adjust the objective function to find the best solutions. In the context of MEC, this algorithm dynamically distributes resources for task execution while ensuring that QoS standards, resource availability, and limitations are met. It guarantees efficient task execution even in the face of system changes by adapting resource allocation accordingly. In our research, the LDROA plays a pivotal role in dynamically allocating resources for offloaded tasks, responding to fluctuations in available resources or changes in QoS requirements to optimize resource utilization and task execution. This involves formulating an objective function aimed at minimizing task execution time, integrating constraints, and introducing Lagrange multipliers to fine-tune resource allocation. Through iterative solving of primal and dual problems, the algorithm facilitates the identification of the most optimal resource allocation while adhering to the specified constraints. The solution for resource adjustment of our workvia the Lagrange Duality algorithm is presented in (15) following the constraints from (16) and (17). We can form the Lagrangian function by introducing a Lagrange multiplier and modifying the objective function with it as expressed in (18). \[f(x)=min\sum_{i\in I_{off}}\left(\frac{C_{i}}{V_{i}^{r}}\right) \tag{15}\]  
\[s.t.\ \ V_{i}^{r}>0\ and\ \sum_{n\in N}\left(V_{i}^{r}\right)\leq V_{m}^{r} \tag{16}\]  
\[g(x)=V_{i}^{r}-V_{m}^{r} \tag{17}\]  
\[L(x,\lambda)=f(x)+\lambda(g(x) \tag{18}\]  
where \(L\) is the Lagrangian optimization problem symbol, \(f(x)\) is the objective function to be minimized, \(g(x)\) is the constraint function (in this case, \((x)=V_{i}^{r}-V_{m}^{r}\)), and \(\lambda\) is the Lagrange multiplier; therefore, after replacing it into the Lagrangian, we obtain (19) and (20). By taking the first derivative of \(L(x,\lambda)\) with respect to \(V_{i}^{r}\), we obtain  
\[f(x)=\ min\sum_{i\ \epsilon\ I_{off}}\left(\frac{C_{i}}{V_{i}^{r}}\right) \tag{19}\]  
\[min\ L(x,\ \lambda)=\ \sum_{i\ \epsilon\ I_{off}}\ \left(\frac{C_{i}}{V_{i}^{r}} \right)+\ \lambda\left(\sum_{i\in I_{off}}\ \ V_{i}^{r}-\ V_{m}^{r}\right) \tag{20}\]  
where \(V_{i}^{r}\) is the minimum resource for task \(i,\sum i\epsilon I_{off}\) are the total numbers of offloading tasks, and \(V_{m}^{r}\) is the total available resource of the edge server. In our work, we propose a solution for dynamically adjusting resources using the Lagrange Duality algorithm, as specified in Equation (15), which is formulated based on the constraints provided in Equations (16) and (17). These constraints play a crucial role in defining the boundaries within which resource adjustments can be made effectively. To formalize this solution, we introduce the Lagrange multiplier into the Lagrangian function, as depicted in Equation (18). The Lagrangian function serves as a comprehensive framework for incorporating both the objective function and the constraints into a unified optimization problem. By integrating the Lagrange multiplier into the objective function, we effectively modify the optimization process to account for the constraints imposed by the system. The Lagrange multiplier acts as a scaling factor that influences the trade-off between optimizing the objective function and satisfying the constraints. The introduction enables us to transform the constrained optimization problem into an unconstrained one, facilitating the application of optimization techniques to find the optimal solution. We can introduce Lagrange multipliers, which are additional variables used to enforce the constraints. The Lagrange multipliers are used to adjust the objective function and find the optimal resource allocation for the task. The Lagrange Duality algorithm involves iteratively solving two optimization problems: the primal problem and the dual problem.