# A Survey of Using Swarm Intelligence Algorithms in IoT
## 1 Introduction
The SI algorithm emerges from the foraging behavior of the insect community and attempts to find the optimal path of insects. These algorithms have adaptability, robustness, distribution, and extensibility, which is compatible with WSN's routing protocol requirements. Therefore, many SI-based algorithms have been developed for WSN routing protocols. Among these, the cluster routing protocol is a commonly used WSN routing protocol, in which the cluster head (CH) selection is one of the key problems. Specifically, the CH selection problem is an NP-hard problem. As SI is suitable to solve NP problems, it is applicable to be implemented with few parameters. Also, its multi-objective optimization ability can find CH in multiple clusters at the same time. GPS is often used to solve the positioning problem,  
Figure 1: Essential IoT technologies. but it is not suitable for WSN because of its high energy consumption and unavailability in some specific areas. Node localization can be regarded as an error optimization problem, which belongs to a complex optimization problem, and the SI algorithm can be used to solve this kind of problems. UAV plays an extremely important role in the field of IoT due to its features of dynamic deployment, convenient configuration, and high autonomy. In general, there are three typical use cases in UAV-assisted communications: (1) UAV-aided coverage, carrying the flight base station, completing the heterogeneous 5G system, and improving the coverage and capacity of wireless access technology; (2) UAV-aided relay, deploying UAVs to provide wireless connections between two or more remote users or user groups without reliable direct communication links; (3) UAV-aided information dissemination and data collection, such as data collection in smart city. The challenges of UAV network lie in the fact that the link is required to be established indirectly due to the variable topology structure, dynamic routing protocol planning, and energy-saving requirements. There exist many UAV applications where SI is used to improve their applicability. For instance, the PSO algorithm is applied to path planning and UAV positioning technology. The design of an individual collaboration of the SI algorithm is compatible with UAV, so the UAV swarm was later proposed. Many studies concentrate on the summarization of the principles and applications of SI algorithms in the WSN. In 2011, [PERSON] et al. [9] Reviewed SI-based routing protocols in WSNs. In their study, they proposed a WSN routing protocol framework based on SI and classified WSN routing protocols, which include multiple/single routing, reactive/active/hybrid routing, source/next-hop routing, plane/layered routing, data/address for the center routing, distributed/centralized routing, best-effort/QoS-aware routing, the event-driven/query-based routing, using energy-aware or not, packet path if there is a cycle, fault tolerance, and load balancing, and compared WSN routing protocols based on SI and non-SI. In 2015, [PERSON] et al. [10] studied systems based on animal and natural behavior in WSNs; their articles classified systems according to animal species and analyzed the usage trend of each type of system. In 2018, [PERSON] et al. [11] reviewed various SI algorithms according to the inspiration source and algorithm maturity. Also, their potential application scenarios were also summarized. Although some studies summarized relevant improvements in SI-based applications, most of them only consider ant colony and bee colony algorithms. Some algorithms proposed algorithms, such as PSO-based routing algorithms, are ignored. The scope of [PERSON]'s survey mainly focused on routing protocol in WSNs; however, it does not discuss sensor deployment and CH selection problems. In [PERSON]'s study, they considered a variety of bioinspired systems in WSNs [10], but there were few comparative analyses of different approaches to the same problem.