## 4 Proposed Scheduling Algorithm
### The Finding Minimum Scheduling Time for Convergecast (FMSTC) Algorithm  
In this section, we describe the proposed algorithm to find the minimum scheduling time in a general topology. Table 1 described the algorithm based on the assumptions in the previous section. \begin{table}
\begin{tabular}{p{34.1 pt} p{34.1 pt}} \hline \hline
**Steps** & **Procedures** \\ \hline
**1** & In a given network \(G=\left(V,\,E\right)\), where \(V\) is the set of vertices (sensor nodes), \(E\) is the set of edges (links between nodes), and \(s\) is a sink node (\(s\in V\), \(s\
eq v_{i}\)). All the nodes have unique \(ids\). \\  & Find nodes set \(N_{s}=\left\{v_{1},\,v_{2},\,v_{3}...,\,v_{i}\right\}\), where \(\,\,\,^{\forall}v_{i}\in V\,\,\text{and}\,\,v_{i}\) is the transmission range of \(s\). \\  & If the node \(v_{i}\) which is in the transmission range of \(s\) is in the transmission range of the other node \(v_{i}\), (\(v_{i}\,\&\,v_{i}\in N_{s}\), \(v_{i}\
eq v_{i}\)). \\  & Calculate the weight \(W(\cdot|\cdot)\) of each link from \(s\) to \(v_{i}\) and \(v_{i}\), _i.e._\(W(v_{i}|s)\) and \(W(v_{i}|s)\), where \(W(\cdot)=\lceil\mid l\mid\rceil-1\) and \(\mid l\mid\) is the distance between \(s\) to \(v_{i}\) or \(v_{i}\). \\  & Select the lowest \(id\) node for the nodes set \(N_{s}\), if \(W(v_{i}|s)\) is equal to \(W(v_{i}|s)\). \\  & Exclude the node \(v_{j}\) from the nodes set \(N_{s}\) if \(W(v_{i}|s)\) is less than \(W(v_{j}|s)\), or vice versa. \\  & Repeat (\(i\)) through (\(iii\)) until it has a complete set of \(N_{s}\). \\ \hline \hline \end{tabular}
\end{table} 
Table 1: FMSTC AlgorithmIn step 1, the algorithm constructs the node set (_Ns_), which has nodes around the transmission range of the sink node (_s_). The algorithm selects a node that is closer to the sink node. Figure 2 explains this step. The nodes, \(v_{1}\), \(v_{2}\), \(v_{3}\), \(v_{4}\), \(v_{5}\) and \(v_{6}\), are in the transmission range of the sink node, \(s\). First, the algorithm needs to find a node set, _Ns_, from these nodes. If the algorithm finds that node \(v_{1}\) and \(v_{2}\) are in the range of the sink node, \(s\), it calculates the weight from \(s\) to \(v_{1}\) and \(s\) to \(v_{2}\). Then, it selects the node, \(v_{1}\), which has the smaller weight than that of \(v_{2}\). The algorithm applies for the nodes, \(v_{3}\), \(v_{4}\), \(v_{5}\) and \(v_{6}\), and selects the nodes, \(v_{3}\) and \(v_{5}\), which have a smaller weight than those of \(v_{4}\) and \(v_{6}\). The complete set of nodes, _Ns_, is defined as follows:  
\[Ns=\{v_{1},v_{3},v_{5}\} \tag{1}\]  
Figure 2: Node set (_Ns_) in the FMSTC algorithm (\(v_{1}\), \(v_{3}\) and \(v_{6}\), respectively, are chosen instead of \(v_{2}\), \(v_{4}\) and \(v_{5}\), because they are closer to the sink node (_s_)). \begin{table}
\begin{tabular}{l l} \hline \hline
**Steps** & **Procedures** \\ \hline
**2.** & Construct the independent minimum spanning tree set, ST = \{t_{1}\), \(t_{2}\), \(t_{3}\)..., \(t_{n}\)\(\}\), where each tree in ST is rooted from each node in \(N_{s}\). - modified [PERSON] et al. [29] algorithm \\  & a. If there exist a node \(v_{k}\) which satisfies the following condition – \\  & \(v_{k}\in t_{i}\) \& \(v_{k}\in t_{j}\) (\(t_{i}\) \& \(t_{j}\)\(\in\) ST), then calculate the weight \(W(\cdot)\) of each link from \(v_{k}\) to \(v^{i}_{a}\) and \(v^{j}_{b}\), where \(v^{i}_{a}\in t_{i}\) and \(v^{j}_{b}\in t_{j}\). \\  & b. Add \(v_{k}\) to \(t_{i}\) if \(W(v^{i}_{a}|v_{k})\) is less than \(W(v^{j}_{b}|v_{k})\), or vice versa. \\  & c. Repeat (a) \& (b) until it has a complete set of ST. \\ \hline
**3** & For each tree in ST, reconstruct to a line topology based on the distance between nodes of the tree. \\ \hline
**4** & Get the minimum scheduling time for the given network applying [PERSON] et al. (2011) algorithm. \\ \hline \hline \end{tabular}
\end{table} 
Table 1: _Cont._Once it has the complete set of nodes, _Ns_, it starts to construct the minimum spanning tree for each node in _Ns_ that will be the root of each spanning tree.