## 4 Centralized Scheduling Algorithm for the IEEE802.15.4e TSCH Network
### Deepening of the Observed Scheduling Algorithm
#### 4.4.1 IRByTSA  
Prior to the discussion of IRByTSA, it is necessary to look at Table 2, which shows the symbols used in this algorithm. A flowchart of IRByTSA is presented in Figure 10, while the explanation for the algorithm is as follows: \begin{table}
\begin{tabular}{c c} \hline \hline
**Variables** & **Description** \\ \hline G & Graph representation \\ ND & Total number of nodes in the network \\ NCD[i] & Number of child nodes of node [i] \\ TS(s) & Number of timeslots needed for each cycle (s) \\ \(\widetilde{\mathrm{Q}}\) & Total number of packets in network nodes waiting to be sent to \\ i & master node within 1 slotframe duration \\ y & Turns \\ s & Cycle/iteration \\ \(\mathrm{q_{z}}\) & Queue size in node z \\ turn\_now[i] & Refers to one child of node i that gets a transmission turn at a \\  & particular cycle/iteration \\ child\_of\_node[i][j] & _j_-th child node of node i \\ child\_number\_of[i][z] & The function that will produce a number showing the sequence \\  & number of node z as a child node of node i. \\  & Value used for modulus operations on node i, used to enable child \\  & nodes to send data to node i alternately (no priority) \\ Matching\_link[s] & Variable that stores the set of active links in each cycle/iteration (s) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Variables used in IRByTSA. IRByTSA starts with a flowchart symbol, as shown in Figure 11. Once we start the program, we will see several variables. G is a graphic representation of the tree topology network, as shown in Figure 9.
* IRByTSA contains two loops/iterations, L1 and L2, where L2 is inside L1. The continuity of the looping process in L1 is determined by the condition q0 \(<\)\(\widetilde{\text{Q}}\), as shown in Figure 12.  
Figure 10: The flowchart of IRByTSA. Meanwhile, the L\({}_{2}\) loop is controlled by the symbol shown in Figure 13. In the L\({}_{2}\) loop, the iteration symbol For: i = 0 to (ND - 1) states that the scheduling will process all nodes in the network, starting from node 0 to node (ND - 1). 3 The decision-making symbol in Figure 14 is used to indicate that if at a certain cycle/iteration node i is not active (because it has not had a turn to transmit or receive), one of the children of node i will get a turn to transmit. Meanwhile, if node i is active, the iteration in L\({}_{2}\) will continue to node (i + 1) until all inactive nodes in the network get a turn to transmit or receive. In this way, the principle of graph matching will be realized in this scheduling algorithm. Figure 11: Flowchart of program start and variable initialization of IRByTSA. Figure 12: Flowchart of the L\({}_{1}\) loop in IRByTSA. Figure 13: Flowchart of the L\({}_{2}\) loop in IRByTSA. The variable turn_now [i] is used to indicate which child of node i will be given a turn to transmit as long as the child node has data in its queue. The child number of node i is contained in variable z. 4 The green decision symbol in Figure 15 is used to indicate whether node i has more than one child or not. If node i has more than one child, it will proceed to the blue decision symbol on the right, and if it only has one child, it will proceed to the left. Meanwhile, the two blue decision symbols are used to determine whether the queue is empty at the child node of node i. 5 Part of the IRByTSA flowchart in Figure 16 states that if node i has more than one child (NCD [i] > 1) and the child of node i has a transmit turn (node z) and its queue is not empty (qz > 0), then node z is given the opportunity to transmit to node i, as indicated by the command line matching_link[s] = matching_link[s] + [nz,n]. Meanwhile the following line of code:  
mod_node[i] = mod_node[i] + 1  
Figure 16: Giving a turn to a child node (parent node with more than one child). Figure 11.0 Decision-making process to give a turn to a node in IRByTSA. Figure 11.1 Process of checking number of child nodes in IRByTSA. Figure 11.2 Figure 11.3  
is used to give each child of node i, as long as it still has data to send, a transmit turn alternately.