Recent advances in hardware and communication technologies have accelerated the deployment of billions of wireless sensors. This transformation has created a wide range of applications adapted to the evolving trends of our daily life requirements. Wireless sensor networks (WSNs) could be deployed in several target areas including buildings, forests, oceans, and smart cities. Nevertheless, finding the optimal location for each sensor node is a challenging task, typically when the environment involves heterogeneous obstacles. Many approaches and methods have been proposed to deal with the problem of WSN deployment, each addressing one or more objectives and constraints, such as network coverage, lifetime, connectivity, and energy consumption. The purpose of this survey paper is to provide the needed background to understand and study the WSNs deployment problem with a focus on its two key aspects: the optimization model and the solving methods based on artificial intelligence (AI). Additionally, it covers recent works on WSNs deployment and identifies their advantages and limitations. Furthermore, simulation experiments were carried out to compare the performance of widely used algorithms in the context of WSNs deployment problem, primarily genetic algorithm, particle swarm optimization, flower pollination, and ant colony optimization. Finally, this paper discusses and highlights several open challenges and research issues that must be explored in the future.