# 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
If \(M_{i}\cap M_{s}\
eq\phi\), this indicates that the sleeping neighbor nodes that meet the requirements can be selected to meet the requirements of network connectivity, and Step 4 can be performed at this time. If \(M_{i}\cap M_{s}=\phi\), this means that all the neighbor nodes of node \(i\) are waking, in order to meet the requirements of network connectivity, other nodes must be selected again, then we proceed to Step 2. In Step 4, wake up selected nodes. According to Step 2, the neighbor information list of node \(i\) includes the information of all its neighbor nodes, when the node \(i\) cannot reach connectivity \(K\), it is necessary to wake up the sleeping nodes to meet the requirements. With respect to the kind of nodes that can be awakened to achieve the connectivity and energy saving requirement of the network, [20; 21] introduced the method to wake up the sleeping nodes according to the energy efficiency algorithm on the residual energy and relative distance. In this paper, we consider the residual energy denoted as \(E_{j}\) and the relative distance \(D_{ij}\), also the communication distances difference between node \(i\) and node \(j\) then the \(W_{j}\) can be calculated from Equation (7), we can select the node \(j\) with larger relative value \(W_{j}\) of distance and energy to wake up:  
\[W_{j}=\omega_{1}\times E_{j}+\omega_{2}\times D_{ij} \tag{7}\]  
\[D_{ij}=\Delta T_{ij}\times V \tag{8}\]  
\[\Delta T_{ij}=\left|T_{i}-T_{j}\right| \tag{9}\]  
Among, \(E_{j}\) is the residual energy of node \(j\), \(\omega_{1}\) and \(\omega_{2}\) are the weighting coefficients, \(D_{ij}\) is the communication distances difference between node \(i\) and node \(j\). \(\Delta T_{ij}\) is the time difference of the information transmission between node \(i\) and node \(j\), \(V\) is the speed of information transmission. Choose the sleeping node with a large value of \(W_{j}\) to wake up, and it can achieve the requirements of the network connectivity and energy saving. The basic idea is distance based weighting method, when the target is close to a node, it will stay in the perceived range of the node for a long time, assign a large weight to a node that is closer to the target. In Step 5, update the neighbor information list again. Let \(T_{i}=T_{i}+\Delta T\), select the next moment \(T_{i}\), and return to Step 2. Repeat the above five steps until the connectivity of wireless sensor network reaches \(K\), and then end the networking. When the node of the network reaches the above expected mean value \(K\), stop the activity that wakes up the sleeping nodes, that is, the network ends. However, a node may have more neighbors that exceed \(K\), and we can still consider the residual energy \(E_{j}\) and the relative distance \(D_{ij}\). We then calculate \(W_{j}\) from Equation (7), and we can select the node \(j\) with larger relative value \(W_{j}\) of the distance and energy as the number of neighbors. In this way, the network energy consumption can be minimized so as to improve the network lifetime significantly.