As IoT metering devices become increasingly prevalent, the smart energy grid encounters challenges associated with the transmission of large volumes of data affecting the latency of control services and the secure delivery of energy. Offloading computational work towards the edge is a viable option; however, effectively coordinating service execution on edge nodes presents significant challenges due to the vast search space making it difficult to identify optimal decisions within a limited timeframe. In this research paper, we utilize the whale optimization algorithm to decide and select the optimal edge nodes for executing services’ computational tasks. We employ a directed acyclic graph to model dependencies among computational nodes, data network links, smart grid energy assets, and energy network organization, thereby facilitating more efficient navigation within the decision space to identify the optimal solution. The offloading decision variables are represented as a binary vector, which is evaluated using a fitness function considering round-trip time and the correlation between edge-task computational resources. To effectively explore offloading strategies and prevent convergence to suboptimal solutions, we adapt the feedback mechanisms, an inertia weight coefficient, and a nonlinear convergence factor. The evaluation results are promising, demonstrating that the proposed solution can effectively consider both energy and data network constraints while enduring faster decision-making for optimization, with notable improvements in response time and a low average execution time of approximately 0.03 s per iteration. Additionally, on complex computational infrastructures modeled, our solution shows strong features in terms of diversity, fitness evolution, and execution time.