The growth of telecommunication technologies, especially 5G, the growing popularity of smart mobile devices, the emergence of smart cities, Internet of things (IoT) and the easy use of these equipment has led the cloud users to utilize their various services. Real-time applications and use of big data have caused cloud service providers to move their servers to the edge of the network and in the vicinity of users to maintain the quality of their services. For this purpose, the concept of mobile edge computing was formed. Applications often have heavy computing complexity on mobile devices or require a lot of data to process. Moreover, in order to save energy consumption of the batteries of this equipment, offloading them on the network resources can transfer the computational complexity from the users’ equipment to the network resources. The resource placement is one of the major challenges in this area. Improper resource topology upsets their load balancing and increases access latency. In the proposed method of this paper, the cellular mobile network is divided into smaller areas, and using the coral reefs optimization (CRO) algorithm, the optimal placement of resources in each of these areas will be locally performed. The deep Q-network (DQN) and Markov game (MG) are used to optimize global resource placement to reduce global latency and to improve resource load balancing as its two objectives. The results of the experiments show that the proposed method has significantly improved its objectives, and server’s energy efficiency, compared to some similar works in this area.