# On Connectivity and Energy Efficiency for Sleeping-Schedule-Based Wireless Sensor Networks
## 3 Connectivity and Energy Efficiency Algorithm
### The New Connectivity and Energy Efficiency Network Algorithm  
Two conditions affecting the connectivity of the wireless sensor networks are discussed above, that are the number of nodes \(N\) and the node communication radius \(R\). \(N\) and \(R\) are given to meet the conditions that the probability of network node connectivity \(K\) is the largest [19], as shown in Equations (4) and (6). In addition to these two conditions being necessary for network connectivity, network energy consumption also needs to be taken into account. In a sensor network, too many or too few nodes will affect the overall performance of the network. Too few neighbor nodes will result in poor network connectivity and accessibility, and isolated nodes will appear. On the other hand, if there are too many neighbor nodes, it will not only lead to the redundancy of information and waste resources, but also increase the communication burden of the nodes and reduce the service life of the network. Therefore, a new type of network connectivity and energy efficiency algorithm is proposed in this paper, and it cannot only ensure the network connectivity, but can also effectively reduce the energy consumption caused by the unreasonable working method [18]. In other words, under the condition of guarantee the connectivity \(K\), the number of awakened sleep nodes should be reduced as far as possible to achieve the purpose of energy saving. The expected value of connectivity of a wireless sensors network is set as \(K\), the closer the number of neighbor nodes of each node is to \(K\), the better. That is, on the interval \([K-a,K+b](0\leq a\leq k-1,b\geq 0)\), the higher the value of \(P_{r}(K-a\leq x\leq K+b)\) is, the better. According to Equation (4), when the sprinkling area \(S\) and the number of nodes \(N\) are known, the communication radius \(R\) of sensor nodes under the maximum network connectivity probability can be calculated. Given the sprinkling area \(S\) of the sensor and the communication radius \(R\) of the sensor node, then, according to Equation (6), the number of sensor nodes \(N\) under the maximum network connectivity probability can be calculated. Connectivity \(K\) of wireless sensor network nodes is subject to binomial distribution denoted by \(B(K,P)\), among \(P=\frac{\pi R^{2}}{S}\), \(P\) is the probability that the communication coverage area of the node occupies the total area. Within a certain area, if we want to increase the probability of the network connectivity \(K\), then the number of sensor nodes \(N\) should be increased or the communication radius \(R\) of sensor nodes should be increased. The algorithm is a decentralized one in this paper. \(K\) is denoted as the connectivity of the node, if the distance between any two nodes \(D_{i}\) and \(D_{j}\) in the wireless sensor network is less than or equal to the communication radius \(R\) of the nodes, as \(D_{ij}\leq R\), so these two nodes are neighbors to each other. If a node has the number of neighbor nodes is \(K\), the connectivity of the node is \(K\). All nodes are connected in a chain, and nodes of similar positions become neighbors on the chain. Each node receives data from one neighbor, merges its own data, and sends it to another neighbor. This process proceeds along the chain until it reaches the head node of the round, which sends the aggregated results to the base station. Only one head node is specified per turn, and each node, in turn, becomes the head node. We can describe the decentralized CEE algorithm in a procedural way as Algorithm 1.