# Improved Cell Allocation Strategies Using K-Means Clustering in Congested 6 TiSCH Environments
## 6 Cell Allocation Implication of Nodes  
As illustrated by the algorithm in Figure 7, the improved cell allocation method optimizes communication cell allocation in the TSCH network. The algorithm begins with inputs such as \(S\), representing the number of slot frames used by cells in a cluster, and \(current\_cluster\), indicating the network's current clustering status. It then compares a node's current cluster association with its neighbors using \(GetCluster\) and evaluates each slot frame in \(S\) to collect cluster details of neighboring nodes by calculating the number of slot frames utilized during a given period for each cell involved. Each randomly determined node location result is selected by looking at the distance between the modes to be determined in the inter-cluster or intra-cluster category, which is then used as a reference when determining the sink node. The main execution phase continuously processes cell assignments until termination conditions are met, with the node acting as a child node performing the scheduling function through \(6\)p transactions. This phase aims to divide the determination of each cell for the allocation of frame slots that have been determined based on the shared cells available for each frame slot used, in which case the cell is updated.  
Information such as time slots and available channels is submitted to each clustered cell list. If the current node and its neighbors belong to the same cluster (as identified by \(GetCluster\)), then the intra-cluster strategy focuses on nearby nodes. Cluster formation enhances communication efficiency and improves time slot utilization. During this phase, active TX cells are added when the number of used slot frames exceeds the cluster capacity. When demand decreases, TX cells are reallocated to areas with higher user density, thereby optimizing resource usage and increasing throughput.  
An inter-cluster strategy is proposed for nodes in different clusters using gateway or router nodes to facilitate communication between clusters, allowing the network to expand and adapt without disrupting operations. To prevent resource wastage, active TX cells are removed if fewer slot frames are available or are relocate to meet inter-cluster needs. Effective node clustering improves packet transmission efficiency by assigning specific cells based on a predetermined schedule. We consolidate resources by removing unnecessary cells, which reduces packet queuing and enables efficient communication between parent and child nodes. The \(6\)P transaction processing minimizes signaling overhead and the nodes intelligently control cell usage, reducing \(6\)P requests and acknowledgments while maintaining reliable connections.  
Figure 6: To-be diagram of cell allocation through clustering approach.  
The proposed scheme, depicted in Figure 8, introduces innovative clustering-based cell allocation and dynamic reallocation strategies that enhance slot frame utilization and reduce signaling overhead, significantly improving network performance, as previously discussed regarding the K-means implementation. The K-means clustering process here has a complexity of approximately \(O(n\times k\times i)\), where \(n\) is the number of nodes, \(k\) is the number of clusters, and \(i\) is the number of iterations until convergence is achieved. The cell allocation process in the slot frames involves evaluating and assigning cells to each node in the cluster, with an estimated complexity around \(O(s\times n)\), where \(s\) is the number of slot frames and \(n\) is the number of nodes. The optimized 6P transaction algorithm also considers cell usage based on dynamic demand, with the complexity being generally linear with the number of nodes.  
Figure 7: Pseudocode for enhanced TSCH cell allocation based on clustering.