The increasing demand for data transmission resources to be handled by next generation cellular networks has led to the emergence of new technologies, such as Device-to-Device (D2D) communications and software-defined networks (SDN). D2D expands the use of resources from a location perspective and SDN enables an efficient management and control of the available resources. This article addresses a study of the influence of D2D communications management on a Long Term Evolution (LTE) network with SDN controllers regarding the obtaining of their necessary number and best location within the cellular infrastructure. The controller placement problem was modeled as an optimization problem and solved by the ant colony system with external memory (ACS-EM) algorithm. The proposed algorithm was compared with a particle swarm optimization (PSO)-based algorithm and its effectiveness has been validated.INDEX TERMS Ant colony system with external memory, controller placement problem, D2D, software defined networking.