# Distributed Dynamic Cluster-Head Selection and Clustering for Massive IoT Access in 5G Networks
## 1 Introduction
[PERSON] and [PERSON] [19] proposed a two-stage mechanism to minimize the energy consumption of all Machine-Type Communications (MTC) devices. The first phase consists of MTC device grouping and coordinator selection, and the criteria for grouping and coordinator selection is the minimization of energy consumption for each group. The second phase is that the base station allocates the power for each coordinator to reduce energy consumption further. However, it is difficult to obtain a final solution for the goal, so then the author uses the Step-by-step calculation to achieve sub-optimal results. The literature [20] proposes a scheme using clustering and relaying ideas: intra-cluster communication relies on a multiphase Carrier Sense Multiple Access/Collision Avoidance (CSMA/CA) protocol, and resource reservation protocols use for communication between the cluster head and the base station. Ref. [21] proposes a dynamic clustering and user association scheme in the small wireless networks. In their work, the authors decompose the user association into a dynamic clustering problem and put forward a user association method based on cultural similarity to solve the problem. Literatures [22; 23; 24] use cloud-based solutions for energy efficiency optimization. In ref. [25], a user-centric clustering and scheduling scheme based on service perception is given to improve the delay and throughput performance [26] of the cloud Radio Access Network (RAN) through coordinated multipoint transmission. However, there is still an unsolved problem that cooperative relays make cluster heads consume more energy than other devices. In this paper, we consider the scenario of large-scale IoT device access. A large number of collisions result in lower energy efficiency. Then, we present a detailed analysis of the random access process and data transmission process combined with the physical channel. We give the main reason for the collision and finally, we propose a distributed dynamic cluster-head selection and clustering scheme based on an improved K-means algorithm. The solution draws on distributed ideas, which allow high-energy behavior to distribute across all devices. More specifically, this work provides two significant contributions. * We analyze the communication process combined with the channel resources including random access and data transmission under the existing network system structure developed by 3 GPP. The energy efficiency of the system is then modeled based on the analysis. * We use a noise-based density-based method to pre-separate clusters, obtain the required number of cluster heads and initial positions according to the distribution of devices in the region, and solve the actual process access problem of excessive energy consumption in the cluster head. In the optimization of system energy efficiency, an adaptive energy efficiency optimization algorithm based on the distributed idea is proposed. Compared with the existing K-means algorithm, the simulation results show that the proposed algorithm can significantly improve the system energy efficiency and throughput. The rest of the paper is organized as follows. Section 2 describes the random access procedure and data aggregation procedure in this paper. The system model considered in this paper is defined in Section 3. The numerical results are given in Section 4. Section 5 summarizes the conclusions.