## 1 Introduction
Research Problem and ContributionThe energy required for processing IoT applications on user devices is limited by the capacity of batteries, which are constrained by their life cycle. Offloading tasks is an enhanced technology that helps mitigate the limited energy problem for user devices. While edge computing allows tasks to be offloaded to edge servers instead of edge clouds, the rapid expansion of computation-intensive tasks (such as IoMTs, AR, VR, and autonomous driving) can lead to resource congestion on MEC servers and lack of autonomy management, significantly impacting task execution latency and privacy preserving data [20; 21; 22]. Thus, smart offloading decision and resource optimization methods are required to be utilized to improve the performance of computation offloading [23; 24; 25]. In our research, we focus on offloading decisions and resource optimizing to minimize energy consumption and task computation latency, as well as the computation cost in 5G networks. We use the Lagrange algorithm to adjust the optimal resources for each task to execute on MEC servers. The main contributions of this work are described below. * The proposed Lagrange Duality Resource Optimization Algorithm (LDROA) has a unique workflow because the algorithm can make intelligent offloading decisions and optimize resources for tasks on edge servers, thereby reducing the total cost and total latency. This method guarantees that the collective resources of the MEC servers adequately fulfills the task demands and time limitations, all the while conserving energy on the user devices. This method can achieve superior performance by reducing energy consumption in user devices and achieving optimal latency for IoT applications. * The joint resource allocation and offloading decision can minimize the total computing overhead of tasks, including completion time, according to time constraints of IoT applications. The proposed approach aims to provide benefits for user device energy consumption, which can increase battery lifetime without the need for frequent charging. LDROA can solve the problem well by providing smart offloading decision and optimal resource allocation for tasks offloaded to MEC. * Our optimization technique enables the conversion of a constrained optimization problem into an unconstrained one by introducing Lagrange multipliers to form a dual problem, which allows for the optimization of the minimization to lower bound for energy, latency, and cost. The simulation setup is executed for multiple congestion conditions with optimal performance in terms of total latency and costs. * The algorithm demonstrates superior performance compared to existing methods, such as Random Offloading, Load Balancing, and Greedy Latency scheme, particularly in terms of reducing total latency and achieving cost savings. It pursues a dual optimization strategy, aiming to simultaneously address both latency reduction and energy consumption efficiency. By considering these two crucial aspects, the algorithm ensures not only improved system responsiveness, but also enhanced energy efficiency across the network. The remainder of this paper is structured as follows. Section 2 presents the related work concerning offloading decision and resource allocation. Section 3 presents the proposed methodology, which covers system architecture and system model. The proposed solution flowchart and algorithm are also included in Section 3. Section 4 presents the simulation settings, parameters, and the existing schemes. Section 5 explains the experimentation of the proposed LDROA algorithm, simulation setting, and its result. Finally, a conclusion of our work contributions and future work are presented in Section 6.