# Improved Cell Allocation Strategies Using K-Means Clustering in Congested 6 TiSCH Environments
## 5 Scheduling of TSCH  
The MSF organizes these slot frames into TX and RX cells for each node, considering communication requirements and network grouping; parent nodes in the MSF coordinate slot frame allocations, while child nodes receive these allocations to enable communication. Typically, nodes send packets to a parent node, but if the parent node is unavailable, a child node can act as a hop node to forward packets to the sink node. Slot and channel availability are considered during cell allocation; hop nodes select the slot offset, channel, and TX and RX cells for communication between child nodes. Simultaneously, the root or sink node applies the same algorithm to determine the optimal cell configuration. Custom cell allocation involves determining the specific cell configuration allocated exclusively to each child node. The hop node assigns a slot offset to each child node based on the number of allocated cells (\(N_{\text{cells}}\)), ensuring that each cell has a distinct offset. The root or sink node employs the same algorithm to determine exclusive cell allocations for each child node through the predetermined cluster head.  
In the slot frame, which is a crucial component of the data transmission process, multiple nodes (such as Node A and Node B) may attempt to occupy the same cell allocation. This inherent allocation process can lead to conflicts and interference, reducing the packet delivery ratio and increasing latency. In addition, the latency can increase significantly for every 0.1 second delay per packet. In the absence of node clustering, nodes compete for optimal cell allocation within the slot frame. As network density increases, this competition becomes more intense, complicating the allocation process and reducing efficiency. The high  
Figure 3: Pseudocode for node granting and optimal K selection: Clustering algorithm.  
volume of nodes vying for limited slots can disrupt allocation and lead to significant delays in data delivery. Additional cell allocations may be required to manage traffic spikes and meet strict latency requirements in order to ensure smooth and timely communication, as illustrated in Figure 4.  
As shown in Figure 5, the cell allocation process at each node begins by connecting multiple nodes back to the central point, which is the parent node, in order to obtain available cells. If cell availability is low due to high density, nodes must wait or request an alternative cell, leading to delays and packet loss. When cells are available, data can be sent with low latency; however, conflicts and inefficiency can still arise, especially when node density is low.  
In contrast, Figure 6 illustrates an advanced method that utilizes K-means algorithm-based clustering to partition nodes based on their spatial positions and designates an optimized parent node, called the sink node. The resulting clusters inform a more efficient cell allocation process by assessing the cell requirements for each allocated frame slot. This method ensures that the allocation can continue seamlessly to the subsequent frame slot with minimal delay, even in the absence of an available cell. This approach effectively reduces node competition to maintain a high packet delivery ratio.  
Figure 4: TSCH scheduling based on period traffic.  
Figure 5: As-is diagram of default cell allocation in TSCH.