# A Node Density Control Learning Method for the Internet of Things
## 5 Design of Node Density Control Learning Algorithm
\[f(u,v)=\lim\frac{\sum\limits_{e=1}^{E}N^{e}(u,v)}{1+\sum\limits_{e=1}^{E}N^{e }(u,v)} \tag{16}\]  
In Equation (16), \(N^{e}(u,v)\) represents the probability that the signal \(e\) step is transferred from the state node \(u\) to the state node \(v\). If the WSN corresponding to the density \(\rho\) generation is disconnected, there is a state node pair \((u,v)\), and the sooner or later probability that the signal is transferred from the state node \(u\) to the state node \(v\) satisfies \(f(u,v)\to 0\). If the network is connected, then for any state node pair \((u,v)\), there is \(f(u,v)\to 1\). If the WSN generated corresponding to the node density \(\rho\) is not connected, there are at least two connected branches in the network. The state nodes \(u\) and \(v\) are respectively taken out from different connected branches, and the two state nodes are disconnected. That is \(P(\Lambda(u,v)\ket{S(u,v)})\to 0\), there is \(N(u,v)\to 0\). Because the state nodes \(u\) and \(v\) belong to different connected branches respectively, after any \(e\) step, the two state nodes are not connected, then there is \(N^{e}(u,v)\to 0\). Bring it into Equation (16) to get \(f(u,v)\to 0\). If the WSN corresponding to the node density \(\rho\) is connected, it can be seen from the above that the transmission process of the signal in the network can be regarded as a finite, homogeneous and irreducible Markov chain [16; 17]. It can be found \(f(u,v)\to 1\) by the Doeblin formula. The algorithm description is as follows. First, we use Equation (14) to find the node density \(\rho\) when there is no independent node corresponding to the actual network. Then, the WSN corresponding to the density \(\rho\) is randomly generated in a normal distribution. Each node locates with its own positioning device and transmits the location information to the base station. The base station calculates the signal one-step transition probability matrix \(N\) using the position information of each node. In addition, by Equation (16), the sooner or later probability that the signal state node \(u\) is transferred to the state node \(v\) is obtained. If the early or late probability between any two state nodes is close to 1, then the network is connected at this time, otherwise, the node's delivery density is increased. Each newly added state node performs its own positioning by using its own positioning device, and transmits data to the base station, and the base station obtains the mutual communication probability \(P(\Lambda(u,v)\ket{S(u,v)})\)between each state node pair. At the same time, the one-step transition probability matrix \(N(u,v)\) of the signal between each state node pair is corrected. Then, Equation (16) is used again to find the late-to-earth transition probability \(f(u,v)\) of the signal between the pairs of nodes and to judge the connectivity of the network. Loop through the above steps until the probability approaches the node density when the network is connected. If you want to ensure that the sensor network is connected, you only need to ensure that all \([N-(k-1)]\)-order sub-matrices of the signal one-step transition probability matrix \(N\)should satisfy the following properties. The late-early probability \(f(u,v)\) of the state node pairs contained in the order-sub-matrix of the one-step transition probability matrix is close to 1. Based on this property, the minimum node density of the WSN that is \(K\)-connected can be found.