## 3 Fuzzy Logic-Based WSN Clustering  
In WSN, nodes clustering and cluster head election play a vital role in optimizing the network operation and prolonging its lifetime. As depicted in Figure 3, sensor nodes (SNs) are usually distributed in an AoI to sense and cover it; each node should send its sensed data to the base station (BS), where data is processed and analyzed to evaluate the situation and make a proper decision if needed. For instance, if these nodes reported an abnormal increase in CO\({}_{2}\) gas concentration, then this may be an indicator of having a fire, for example, where immediate action should be taken (e.g., sending firefighters to the monitored area). If the deployed sensor nodes communicated their sensed data directly to the BS, each node has to use high power to compensate for the path loss due to the long distance between them and the BS. Further, SNs will interfere with each other, and the BS will incur a high packet loss rate. To solve this issue, nodes are normally clustered, where a CH node is selected, and all the SNs that are close to the CH node will form a cluster and communicate their captured data to the CH, which in turn will forward it to the BS. This scheme minimizes the energy consumed in transmitting the data, as SNs have to send their data to the CH, which is closer and needs much less power than communicating directly with the BS. Further, SNs within the cluster can utilize a specific communication channel that will not interfere with other nodes in the other clusters. It is noticeable that the way clusters are formed will significantly affect performance. In what follows, a literature review for the most related work that utilizes fuzzy logic approach in establishing the network clusters and cluster head selection is presented. Figure 2: Fuzzy logic interference engine rules. [PERSON] et al. [31] proposed a cluster head election mechanism using fuzzy logic (CHEF). In the traditional clustering models such as the low energy adaptive clustering hierarchy (LEACH) [32], all the sensor nodes get a chance to become cluster head on the basis of a probabilistic model, evenly distributing the energy consumption. However, in such a scenario, the elected cluster heads may be very close to each other, and in few cases, the cluster heads are located on the edge of the cell because the election process is purely based on a probabilistic model. Moreover, LEACH does not consider the existing battery power of the nodes during the cluster head selection process, which may lead to the selection of nodes with relatively small battery power. Such limitations motivated the research on clustering mechanisms based on fuzzy logic. In the fuzzy logic-based mechanisms discussed in the literature, parameters such as concentration, energy, and centrality were used as fuzzy variables to enhance the overall lifetime of the network. Such fuzzy-based schemes are centralized, wherein all the required information from all the nodes are collected at the base station, and, consequently, the cluster head is selected on the basis of the collected information using fuzzy logic. However, to avoid having a centralized solution, [PERSON] et al. [31] proposed CHEF where the election is based on IF-THEN fuzzy rules, and the operation is localized. Here, the base station is not involved in cluster head election and the sensor nodes take the responsibility to elect the cluster head using fuzzy rules. On every round, the nodes generate a random number between 0 and 1. If the number is less than the predefined optimum value, the node then computes the chance of being a cluster head using a fuzzy IF-THEN rule. Here, the authors introduced fuzzy variables such as energy, local distance (sum of the distances between the nodes), and the nodes' density. The sensor node calculates a chance from its remaining battery power, the local distance, which is the sum of distances between itself and other nodes within \(r\) distance. The bigger the chance, the higher the opportunity of becoming a cluster head.