Cloud computing is a modern technology that has become popular today. A large number of requests has made it essential to propose a resources allocation framework for arriving requests. The network can be made more efficient and less costly this way. The cloud–edge paradigm has been considered a growing research area in the computing industry in recent years. The increase in the number of customers and requests for cloud data centers (CDCs) has created the need for robust servers and low power consumption mechanisms. Ways to reduce energy in the CDC having appropriate algorithms for resource allocation. The purpose of this study was to develop an intelligent method for dynamic resource allocation using Takagi–Sugeno–Kang (TSK) neural-fuzzy systems and ant colony optimization (ACO) techniques to reduce energy consumption by optimizing resource allocation in cloud networks. It predicts future loads using a drop-down window to track CPU usage. By optimizing virtual machine migration, ACO can reduce energy consumption. Simulations are provided by examining the implementation and a variety of parameters such as the number of requests made wasted resources, and requests rejected. In this paper, we propose the use of virtual machine migration to accomplish two main goals: evacuating additional and non-optimal virtual machines (scaling and shutting down additional active physical machines) and solving the resource granulation problem. We evaluated and compared our results with literature for rejection rates of virtual and physical machine applications. The performances of our algorithms are compared to different criteria such as performance in request rejection, dynamic CPU resource allocation with reinforcement learning, multi-objective resource allocation, NSGAIII, Whale optimization and Forecast Particle Swarm allocation. A comparison of some evaluation criteria showed that the proposed method is more efficient than other methods.