## 4 The Proposed Collaborative Weighted Clustering Protocol
### Collaborative Weighted Clustering Algorithm  
It is obvious that the cluster head selection is quite important for the performance of the whole system [55]. In LEACH, the threshold is based on the suggested percentage of cluster heads for the network and the times the node has ever been elected as a cluster head so far [7]. This succeeds in avoiding draining the battery of a single sensor. However, things get much more complicated when mobile sensors are involved. In order to avoid frequent cluster head changes, it is necessary to select a cluster head that does not move very quickly or change very frequently. When the cluster head moves fast, its member nodes may be out of its communication range. According to the first-order radio model employed in the system, if a cluster contains nodes that are far from each other, the total power consumption will no doubt be high. It is unfortunate that the LEACH algorithm fails to take this distance issue into account. In the network, \(N\) collaborative nodes transfer information to the base station as shown in Figure 3. Let \(s(t)\) be the total amount of information transmission to the base station by the collaborative nodes. In Figure 3, many nodes form a cooperative network to transmit the same data to the base station. In order to achieve power management and connectivity efficiency for mobile sensor nodes, sensor nodes are deployed over a targeted area in a fashion that ensures connectivity. This is done by considering cost efficiency and the event probabilities of the mobile sensor nodes. Sensor nodes ensure the information can be transferred towards the base station by exchanging information within the network. The optimal model of collaborative nodes is defined as:  
\[\left\{ \begin{array}{l}z_{t}=P(z_{t}|z_{t+1})\\ x_{t}=A(z_{t})x_{t}+B(z_{t})w_{t+1}\\ y_{t}=C_{m}(z_{t})x_{t}+D_{m}(z_{t})v_{t}\end{array} \right. \tag{13}\]  
where \(z_{t}\) is the unknown discrete state, \(x_{t}\) is the unknown continuous state, and \(y_{t}\) is the observations transmitted from the sensor \(C_{m}\) at time \(t\) to the central processing unit. To deal with the problem of mobile sensors, a weighted clustering algorithm is employed in this paper. It uses a weighted sum of several metrics, such as the degree, the Euclidean distance, the relative mobility, and the lifetime of a cluster head node. The node with the lowest weight among its neighbors becomes the cluster head. The weight of a node \(i\) is defined as:  
\[weight(i)=\alpha_{1}\times D_{i}+\alpha_{2}\times P_{i}+\alpha_{3}\times M_{i }+\alpha_{4}\times T_{i} \tag{14}\]  
where \(\alpha_{1}+\alpha_{2}+\alpha_{3}+\alpha_{4}=1\). \(D_{i}\) is the sum of the Euclidean distances between the node \(i\) and its neighbors. This is to say:  
\[D_{i}=\sum\{dist(i,v)\} \tag{15}\]  
Let \(M_{i}\) denote the average relative mobility of the node. In this study, we assume that \(M_{i}=0\) corresponds to static sensor node, while \(M_{i}=1\) corresponds to mobile sensor node. \(P_{n}\) is the degree of node \(i\), which is defined by finding all the nodes within the transmission range of node \(i\). \(P_{n}\) is given as:  
\[P_{n}=\left|\sum_{i}\left\{dist(n,v)<tx_{range}\right\}-\delta\right| \tag{16}\]  
Figure 3: Collaborative nodes transmit the same data to the base station. where \(\delta\) is a pre-defined number threshold that each cluster-head can afford. \(T_{i}\) is the lifetime of a cluster head node. It can be defined as follows:  
\[T(i)=\frac{1}{1-\sqrt{K_{CH}}\times(r\,mod(\frac{1}{\sqrt{K_{CH}}/n}))}\times(1+ \frac{neighbor(i)-\frac{1}{\sqrt{K_{CH}}/n}}{n}) \tag{17}\]  
In which, \(K_{CH}\) is the employed threshold in LEACH, and \(n\) is the number of network nodes. The advantage of such an algorithm is that the weight parameters (\(\alpha_{1}\), \(\alpha_{2}\), \(\alpha_{3}\) and \(\alpha_{4}\)) can be adjusted according to the system requirements. The flexibility of changing the weight factors is helpful for the algorithm's application in various types of networks [9].