# Distributed Dynamic Cluster-Head Selection and Clustering for Massive IoT Access in 5G Networks
## 3 System Model
### Energy Consumption Analysis  
This paper considers the uniform distribution of \(N\) devices in a single base station. The base station uses a clustering algorithm to cluster each device \(D_{n}(n=1,\ldots N)\) in the cell according to the transmission environment including the channel quality and the device location. Then, the Base station divides the device into \(M(M\leq N)\) clusters. The number and set of devices belonging to the \(m_{th}\) group can be expressed as \(N_{m}\) and \(G_{m}\). Each group will select a cluster head as the device for data aggregation, which the devices in the cell can represent as \(C=\{c_{m}|m=1,2,\ldots,M\}\), where the cluster head of the \(m_{th}\) cluster is \(c_{m}\). The devices in the cluster can transmit data through the cluster header device. The system consists of two links: one is between the device and the cluster header device, and the other is between the cluster header device and the base station. The corresponding link data rates are expressed as \(r_{D_{n}}^{c_{m}}\) and \(r_{c_{m},l}\). According to [PERSON]'s theorem:  
\[r_{D_{n}}^{c_{m}}=B_{D}\log_{2}(1+\frac{p_{D_{n}}\big{|}h_{D_{n}}^{c_{m}}\big{|} ^{2}}{N_{0}B_{D}}),D_{n}\in G_{m} \tag{1}\]  
\[r_{c_{m},l}=B\log_{2}(1+\frac{p_{c_{m},l}\big{|}h_{c_{m}}\big{|}^{2}}{N_{0}B}) \tag{2}\]  
Figure 2: Adaptive clustering diagram range from the Nth frame to the N+1 th frame. \(B_{D}\) and \(h_{D_{n}}^{c_{m}}\) represent the bandwidth and channel gain of the link from device \(D_{n}\) to cluster header device \(c_{m}\) belonging to the cluster \(G_{m}\), respectively. We assume that link one is flat fading because the intra-cluster distance is short and transmitted in narrowband. \(p_{D_{n}}\) is the transmission power of the MTC device \(D_{n}\). \(p_{c_{m},l}\) is the transmission power of the cluster header device \(c_{m}\) on the \(l_{th}\) RB (\(l\in L_{c_{m}}\)). The purpose of optimization is to maximize the overall energy efficiency of the system, that is, to minimize energy consumption. In this paper, \(p_{D_{n}}S_{n}/r_{D_{n}}^{c_{m}}\) represents the data packet transmitted by the device \(D_{n}\) in the cluster \(m\), where \(S_{n}\) refers to the number of bits of the device \(D_{n}\) data packet. The link energy consumption of all devices is:  
\[ec_{D}=\sum\limits_{m=1}^{M}\sum\limits_{D_{n}\in G_{m}}\frac{p_{D_{n}}\cdot S _{n}}{r_{D_{n}}^{c_{m}}} \tag{3}\]  
\[ec_{C}=\sum\limits_{l=1}^{L}\sum\limits_{m=1}^{M}\frac{p_{c_{m},l}\cdot D_{c_ {m},l}}{r_{cm,l}} \tag{4}\]  
\(D_{c_{m},l}=\sum\limits_{n=1}^{N_{m}}S_{n,l}\) is the total amount of data received by the cluster header device \(c_{m}\) in the cluster and transmitted by the \(l_{th}\) RB. In the model, we ignore the receiving energy consumption of the cluster header equipment, because when the distance between the device and the base station is much larger than 10 meters, the energy consumption is mainly based on the total energy consumption [20]. Therefore, the total energy consumption of the system is \(EC_{sys}\):  
\[EC_{sys}=ec_{D}+ec_{C} \tag{5}\]  
Since the LPWAN network is used within the cluster, we assume that K has been determined. We can simplify the problem to minimize the energy consumption of the convergence device. Minimizing energy consumption is equivalent to maximizing the number of bits transmitted per unit of energy consumption [20]. At the same time, we assume that each RB allocates equal power, the problem can be considered as maximizing the number of bits transmitted per unit RB consumption. Therefore, the issue of minimizing energy consumption can be described as (6) within \(T\) time. \[ \begin{array}{l}\min\limits_{\{M,G_{m},c_{m},L\}}EC_{sys}\\ s.t.\ (a)\ p_{D_{i}}=p_{t},D_{n}\
otin C\\ (b)\ p_{c_{m},l}=p_{t}\\ (c)\ B_{t}\leq B_{\max},\forall t\in T\\ (d)\ L_{p}\cap L_{q}=\varphi\,,\forall p\
eq q\\ (e)\ \big{\{}\min(L_{p}),\min(L_{p})+1,\ldots,\max(L_{p})\big{\}}\cap\\ \big{\{}L_{1}\cup L_{2}\cup\ldots L_{p-1}\cup L_{p+1}\cup\ldots L_{D_{N}}\big{\}} =\varphi,\forall p\in D_{i}\end{array}