Two Algorithms for Constructing Independent Spanning Trees in (n,k)-Star Graphs

In a graph <inline-formula> <tex-math notation="LaTeX">$G$ </tex-math></inline-formula>, two spanning trees <inline-formula> <tex-math notation="LaTeX">$T_{1}$ </tex-math></inline-formula> and <inline-formula> <tex-math notation="LaTeX">$T_{2}$ </tex-math></inline-formula> are rooted at the same vertex <inline-formula> <tex-math notation="LaTeX">$r$ </tex-math></inline-formula>. If, for every <inline-formula> <tex-math notation="LaTeX">$v \in V(G)$ </tex-math></inline-formula>, the paths from <inline-formula> <tex-math notation="LaTeX">$v$ </tex-math></inline-formula> to the root <inline-formula> <tex-math notation="LaTeX">$r$ </tex-math></inline-formula> in <inline-formula> <tex-math notation="LaTeX">$T_{1}$ </tex-math></inline-formula> and <inline-formula> <tex-math notation="LaTeX">$T_{2}$ </tex-math></inline-formula> are internally vertex-disjoint, they are called independent spanning trees (ISTs). ISTs can be applied in numerous fields, such as fault-tolerant broadcasting and secure message distribution. The (<inline-formula> <tex-math notation="LaTeX">$n$ </tex-math></inline-formula>,<inline-formula> <tex-math notation="LaTeX">$k$ </tex-math></inline-formula>)-star graphs <inline-formula> <tex-math notation="LaTeX">$S_{n,k}$ </tex-math></inline-formula> constitute a generalized version of the star network. The method of constructing ISTs in (<inline-formula> <tex-math notation="LaTeX">$n$ </tex-math></inline-formula>,<inline-formula> <tex-math notation="LaTeX">$k$ </tex-math></inline-formula>)-star graphs remains unknown. In this paper, we propose one recursive algorithm and one parallel algorithm for constructing ISTs on (<inline-formula> <tex-math notation="LaTeX">$n$ </tex-math></inline-formula>,<inline-formula> <tex-math notation="LaTeX">$k$ </tex-math></inline-formula>)-star graphs. The main ideas of the recursive algorithm are to use induction to change small trees into large trees, to use a modified breadth-first search (MBFS) traversal to create a frame for an IST, and to use a breadth-first search (BFS) traversal to connect the rest of nodes. The main ideas of the parallel algorithm are to create frames through MBFS traversals in parallel, and to use some specific rules to connect the rest of nodes in parallel. We also present validation proofs for both algorithms, and analyze the time complexities of both algorithms. The time complexity of the recursive algorithm in <inline-formula> <tex-math notation="LaTeX">$S_{n,k}$ </tex-math></inline-formula> is <inline-formula> <tex-math notation="LaTeX">$O\left({n\times \frac {n!}{(n-k)!}}\right)$ </tex-math></inline-formula>, where <inline-formula> <tex-math notation="LaTeX">$\frac {n!}{(n-k)!}$ </tex-math></inline-formula> is the number of nodes of <inline-formula> <tex-math notation="LaTeX">$S_{n,k}$ </tex-math></inline-formula>. The time complexity of the parallel algorithm can be reduced to <inline-formula> <tex-math notation="LaTeX">$O\left({\frac {n!}{(n-k)!}}\right)$ </tex-math></inline-formula> if the system has <inline-formula> <tex-math notation="LaTeX">$n-1$ </tex-math></inline-formula> processors computing in parallel. Both algorithms are correct with the stated time complexity values; the parallel algorithm is more efficient than the recursive algorithm.


I. INTRODUCTION
In a graph G, two spanning trees T 1 and T 2 are rooted at the same vertex r. If, for every v ∈ V (G), the paths from v to the root r in T 1 and T 2 are internally vertex-disjoint, they are called independent spanning trees (ISTs). ISTs can be applied in numerous fields, such as fault-tolerant broadcasting and secure message distribution [1], [22]. Assume that a network N has k ISTs rooted at node r, and N contains at most k − 1 faulty nodes. These applications are illustrated as follows [17]: • In fault-tolerant broadcasting, node r broadcasts a message to every non-faulty node v in N through the k ISTs. Because the number of faulty nodes is less than k, at least one of the k internally disjoint paths from r to v is fault The associate editor coordinating the review of this manuscript and approving it for publication was Liang Yang . free; this promises the message can be delivered to every node in N reliably; • In secure message distribution, node r divides a message into k packets, and sends each packet to the destination through a different IST. Thus, each node in N receives at most one of the k packets except the destination node, which receives all k packets. Scholars have described how to construct ISTs in graphs. Zehavi and Itai proposed a conjecture that there exist k ISTs in a k-connected graph [28]. The conjecture has been proven correct for k-connected graphs such that k ≤ 4 [9], [12], [18], but it is still unknown for graphs such that k ≥ 5. However, the problem is considerably challenging for arbitrary graphs, and from 2007 to 2020, researchers have published studies on specifying ISTs in interconnection networks.
An (n, k)-star graph S n,k refers to a generalized version of an n-star graph S n , where S n,n−1 and S n are isomorphic and S n,1 is obviously a complete graph K n . Scholars have computed or derived some basic properties of graphs of the form S n,k , such as diameter [10], connectivity [10], broadcasting [6], average distance [11], embedding [2], Hamiltonicity [14], spanning connectivity [15], and wide diameter [15]. These results demonstrate that S n,k graphs have excellent topological properties.
In this paper, we propose one recursive algorithm and one parallel algorithm. Both of which construct ISTs in (n,k)-star graphs. The main ideas of the recursive algorithm are to use induction to extend small trees into big trees, use a modified breadth-first search (MBFS) traversal to create a frame of an IST, and use a breadth-first search (BFS) traversal to connect the remaining nodes. The main ideas of the parallel algorithm are to create frames through MBFS traversals in parallel and use the specific rules to connect the rest of nodes in parallel. In this paper, we validate both algorithms, and analyze the time complexity of both algorithms. The time complexity of the recursive algorithm in S n,k is O(n × n! (n−k)! ), where n! (n−k)! is the number of nodes of S n,k , whereas that of the parallel algorithm can decline to O( n! (n−k)! ) if the system has n − 1 processors computing in parallel. Both algorithms are correct with the stated time complexity; furthermore, the parallel algorithm is more efficient than the recursive algorithm.
The remainder of this paper is organized as follows: Section II explains preliminary considerations, Section III presents both algorithms, Section IV proves the relevant claims, Section V analyzes and compares both algorithms, and Section VI concludes the paper.

II. PRELIMINARY CONSIDERATIONS
Let n = {1, 2, . . . , n} and k = {1, 2, . . . , k}. Definition 1 ( [10]): An (n, k)-star graph, denoted by S n,k , is specified by two integers n and k, where 1 ≤ k < n. The node set of S n,k is denoted by {p 1 p 2 . . . p k | p i ∈ n and p i = p j for i = j}. The adjacency is defined as follows: The node of type (1) is referred to as friend i of p 1 p 2 . . . p i . . . p k , and the node of type (2) is referred to as child z of p 1 p 2 . . .
S 3,1 is depicted in Figure 1. Node 3 has two children, namely node 1 (child 1) and node 2 (child 2). S 4,2 is displayed in Figure 2. Node 34 has two children and one friend as presented in Figure 3. S 5,3 consists of 60 nodes and 120 edges, as displayed in Figure 4, and is composed of five instances S 4,2 .    Like the n-star graph S n , an S n,k can be decomposed into n instances of S n−1,k−1 . That is, an S n,k can be decomposed into n vertex-disjoint instances of S n−1,k−1 in k − 1 different ways by fixing the symbol in any position i, such VOLUME 8, 2020 that 2 ≤ i ≤ k. This decomposition can be conducted recursively on each S n−1,k−1 to obtain smaller subgraphs.
Lemma 1 ( [10]): (n, k)-star graphs is vertex symmetric. According to Lemma 1, any node in S n,k can be the root in the process of constructing ISTs. Lemma 2 ( [10]): (n, n−1)-star graph S n,n−1 is isomorphic to the n-star graph S n

III. ALGORITHMS
Notations used here are defined as follows: • the root: node (n − k + 1)(n − k + 2)(n − k + 3) . . . n; • cluster A: a set of nodes whose last symbol is A; • the root cluster: the set of nodes whose last symbol is identical to that of the root. In S n,k , the root cluster is cluster n; • frame: a set of nodes with the same last symbols created by buildFrame function, which is defined later in a later passage; • germ: the starting node of a frame; • T n,k j : the jth IST of S n,k , and the last symbol of its frame is j; • tid: the last symbol of the germ, namely j of T n,k j . S n,k is partitioned into n instances of S n−1,k−1 . Every node is classified into a cluster by its last symbol. Thus, S n,k has n clusters. For example, S 4,2 can be divided into four instances of S 3,1 . S 4,2 has four clusters, as illustrated in Figure 5. Each node in S n−1,k−1 can be transformed into some node in S n,k if one symbol n is appended to the tail of the sequence in the k position. We thus construct the ISTs of S n,k by taking advantage of that of S n−1,k−1 .
In S n,k , the root is incident to n − 1 edges and adjacent to n − 1 nodes. Considering the n − 1 nodes adjacent to the root, n − 2 nodes can be constructed from the nodes in S n−1,k−1 if one symbol n is appended to the kth position, but the friend k is a new node. Each of the n − 2 nodes except for friend 2 has a new edge that is adjacent to a node that is called a germ and the friend k itself is also a germ. We use germs to create a frame to connect other clusters.
The concept is illustrated in Figure 6. Each of the central white nodes can be formed from some node in S n−1,k−1 if a single symbol n is appended to the kth position. Child 1 of the root in S n,k uses its new edge to make the germ of T n,k 1 . Child 2 of the root in S n,k uses its new edges to make the germ of T n,k 2 . The root in S n,k uses its new edge to make the germ of T n,k n−k+1 , namely friend k. Friends 3 to k − 1 of the root in S n,k use their new edges to make the germs of T n,k n−k+3 to T n,k n−1 . T n,k n−k+2 does not conduct any buildFrame function; consequently, it has no germ, and that is why we skip friend 2 in Figure 6.
Basic variable and functions: MBFS traversal. Because S n,k is symmetric, some child c of one node v may be traversed by another node w earlier.
In such case, we should transfer c's parent from w to v. For instance, in S n,n−2 , the graph presented in Figure 7(a) occurs. We set the edge (marked with a blue X) from used to unused and use another edge (marked with a blue arrow) to traverse c. Hence, the triangle shape is retained. Figure 7(b) illustrates this idea.

B. BuildLeaf FUNCTION
The buildLeaf function connects all unvisited nodes one step at a time from a tree after the buildFrame function. For example, in Figure 11, the leaf nodes of T 5, 3 4 in the first, second, third, and fourth buildLeaf executions are indicated by ellipses with brown, gold, gray, and red borders, respectively.

C. RECURSIVE ALGORITHM
The recursive algorithm is presented in Algorithm 1.
S n−k+1,1 , the basic part, is a complete graph, having n − k independent spanning trees that are illustrated in Figure 12.
Copy previous trees. At the end of each iteration, the trees that had been used must be stored in a tree array called ptary so that correct information can be used in the next iteration. At the start of every iteration, the program should copy previous trees to the tree array tary. Put germ into frQue.

11
// Set the edge (from c's parent to c) 12 // unused (from 0 to 1).  a new tree and an old tree. In a typical iteration, T n,k 1 copies information from T n−1,k−1 1 and T n,k n−1 copies information from T n−1,k−1 n−k+1 . T n,k n−k+1 is a new tree, and thus no previous tree is copied.
Create a framelist. A framelist is an array for storing the germs. The germs are created from the root. In S 4,2 , we can create three germs, namely 41, 42, and 43 to establish frames, as illustrated in Figure 13.

D. BuildFrameP FUNCTION
The frame of an IST comprises nodes of the same tail portion within this IST. The frame of an IST can be constructed from a germ through a modified breadth-first search (MBFS) traversal displayed in Figure 7. However, the MBFS traversal must stop when it encounters a node of which the last tailN symbol(s) differ(s) from that of the germ.
BFS order. In the buildFrameP function, every node in frQue queue must visit all hitherto unvisited nodes connected to it in the following order:   1. child 1,2, 3 . . . , n − k; 2. friend 2, 3, 4, . . . , k − tailN . In Figure 14, 15, 16, 17, and 18, the frame nodes are underlined. The buildFrameP function will not encounter any node whose last tailN symbol(s) is(are) different from that of the germ because it does not visit the last tailN friend(s).

E. FindParent FUNCTION
Let Frame n,k j denote that the frame of T n,k j . In T n,k j construction, each unvisited node child whose last symbol is z should be connected to Frame n,k j after the buildFrameP functions. The findParent function is used to find the parent of child in T n,k j by means of the findTarget function according to the following rules.
• P1 rule: If child's first symbol is j, the findTarget function swaps the first and last symbols of child to return the target node; • P2 rule: If child's first symbol is not j, the findTarget function moves j to first position of child by child, or friend operation to return the target node; • P3 rule: If the target node has been used by Frame n,k z , the target is changed to n − k + 2, and the findTarget function is used again to move n − k + 2 to the first or last position of child to return another target node; If child is in the root cluster and j is n − k + 1, the findParent function swaps the first and last symbols of child to form its parent.

Algorithm 1 Recursive Algorithm
Input : n and k the dimensions of S n,k Output: the ISTs from S n−k+1,1 to S n,k  initially.
the (j + 1)th element of frQue. return getFriend(child, p); 10 Swap the first and pth symbols of child.
starts at 1. If start > |string| or length = 0, an empty string is returned. If the last symbol of child is identical to the dimension n of S n,k , we can reduce the dimension until the last symbol of child is not identical to the dimension n of S n,k . According to Table 2

F. PARALLEL ALGORITHM
The parallel algorithm is presented in Algorithm 2. Construct the n − k ISTs of S n−k+1,1 by hand. S n−k+1,1 has n − k ISTs illustrated in Figure 12.

Algorithm 2 Parallel Algorithm
Input : n and k the dimensions of S n,k Output: the ISTs of S n,k 1 Construct the n − k ISTs of S n−k+1,1 by hand; 2 if n ≥ n − k + 2 then 3

4
for each germ in the FrameGermSet do in parallel 5 Execute buildFrameP function; 6 for j = 1; j ≤ n − 1; j = j + 1 do in parallel 7 for each node v in T n,k j do in parallel 8 if v has no parent then 9 Find and set v's parent;

G. CREATE A FrameGermSet
The germs are created from the root. In the recursive algorithm to construct the ISTs of S n,k , we should construct the ISTs of S n−k+1,1 to S n,k sequentially and iteratively. In the iteration of S x,x−n+k , the ISTs of S x,x−n+k must be retained in the next iteration to construct ISTs of S x+1,x+1−n+k as presented in Table 2. The meanings of the symbols in Table 2 are as follows: • Hand: the IST is constructed by hand; • New: the IST is constructed without copying the previous ISTs; (no buildFrame operation required) in parallel. Notably, n − k + 1th IST in S x,x−n+k must be part of the last IST of S x+1,x+1−n+k . Namely The process is presented in Algorithm 3.
A FrameGermSet stores elements whose data structure as below: • a germ; • tid to indicate which IST uses the germ to create a frame; • a tail number denoted by tailN to indicate the number of last symbols of a node identical to that of the germ, namely the tail portion. If tailN ≥ 2, the last tailN − 1 symbol(s) of the tail portion is(are) identical of that of the root, and the dimension term of S n,k changes from (n, k) to (n − tailN + 1, k − tailN + 1).

H. PATH COMPOSITION
Finally, the outcome paths from the root to other nodes contain the frame portions and the leaf portions, as illustrated in Figure 19. The tree frames have germs, except in the case of T n−k+2 .
Because T n−k+2 done not execute any buildFrame function, it appends the last symbol of the root to its previous tree as its frame. For instance, the green nodes in T 5,3 4 ( Figure 11) come from T 4,2 3 (Figure 13(c)), and the symbol 5 appended to these nodes to form the frame of T 5,3 4 .

IV. PROOFS
Lemma 3: In S n,k , each node belongs to a complete graph of n − k + 1 nodes.
Proof: In S n,k , each node has n − k children. Those n−k +1 nodes are adjacent to each other and form a complete graph.
Lemma 4: In the frame portion, if one node has one child, it must have the other n − k − 1 children.
Proof: The MBFS traversal is applied in the buildFrame function; hence each parent will have n − k children in the frame.
Lemma 5: In S n,k , each node supplies an incoming edge for each tree.
Proof: We know that S n,k is connected and n − 1 ISTs exist. Assume that some node in S n,k supplies its two incoming edges to some tree, then this node must be traversed twice by the tree. The situation is not reasonable, and will not occur. This notion is represented in Figure 20, where different colors represent different trees.    Lemma 6: Each tree can traverse all nodes in cluster n − k + 2 in at most two steps.
Proof: We know that T n−k+2 does not execute any build-Frame function. Thus, all edges in cluster n − k + 2 are not used. In cluster n−k +2, each node is linked directly by some tree. If some node in cluster n − k + 2 is not directly linked by a tree, it can link its children and friends to reach the tree. Let X = n − k + 2. Consider one node cdX in cluster X . Tree  c links this node directly, and trees a, b, and d approach it in two steps, as illustrated in Figure 21.
Lemma 7: The possibilities are limited to only five patterns: P1, P2, P3, P4, and P5 in the leaf portions of all ISTs in S n,k , as illustrated in Figure 22.
Proof: Pattern P1: Suppose the pattern of node v in T x is P1. v is a leaf node traversed by T x in the first execution of buildLeaf function, and v's first symbol is x.
Pattern P2: Suppose the pattern of node v in T x is P2. v is a leaf node traversed by T x in the second execution of buildLeaf function. v can approach T x by its children or friends whose first symbol is x.
Pattern P3: Suppose that node v's last symbol is A, and v wants a middle node m to approach the frame of Tree x through m. However, the edge from m to v is used in the frame of Tree A. We know that Tree n−k +2 does not conduct any buildFrame function and the last symbol of its frame nodes is the same as the last symbol n of the root. Thus, node v takes advantage of the symbol n − k + 2 to find a node w according to Lemma 5. w's first symbol is n − k + 2. Finally, node w can use its symbol x to approach the frame of Tree x. P1, P2, and P3(type 1 and type 2) patterns are illustrated in the following examples.
In S 6,4 , the ISTs have five paths from the root to node 5431 as follows: Node 5431's last symbol is 1; hence, node 5431 is T 6,4 1 's  frame node. In T 6,4 1 , node 3451 is node 5431's parent, and node 3451 use 3 to visit node 5431. Therefore, T 6,4 3 is not able to use 3 to visit node 5431. Finally, node 5431 uses 4 to reach the frame of T 6,4 3 . In S 6,4 , the ISTs have five paths from the root to node 4351 as follows: Node 4351's last symbol is 1; hence, node 4351 is T 6,4 1 's frame node. In T 6,4 1 , node 3451 is node 4351's parent, and node 3451 must use 3 to visit node 4351; Therefore, T 6,4 3 is not able to use 3 to visit node 4351. Finally, node 4351 uses 4 to reach the frame of T 6,4 3 .

Pattern P4:
The concept of P4 is similar to that of P3. Suppose that node v's last symbol is A, and v wants a middle node m 1 to approach the frame of Tree x through m 1 . However, the edge from m 1 to v is used in the frame of Tree A. Thus, node v takes VOLUME 8, 2020 advantage of the symbol n−k+2 to find a node w according to Lemma 5. w's first symbol is n − k + 2. Then, node w wants a middle node m 2 to approach the frame of Tree x through m 2 . However, the edge from m 2 to w is still used in the frame of Tree A. Thus, node w must take advantage of the symbol n − k + 2 to find a node z according to Lemma 5. Notably, w's first symbol is n−k +2; therefore z's last symbol is n−k +2. Node z must use its symbol x to approach the frame of Tree x. Node z only passes one node in cluster n − k + 2 to reach the frame of Tree x according to Lemma 6.
The following example demonstrates P4 pattern. There are five paths from the root to node 6421 in S 6,4 .
Pattern P5: P5 only occurs in Tree n − k + 1 for some nodes of the root cluster. The parents of those nodes belong to P4. For instance, in S 6,4 , the paths from the root to node 5426 are as follows. 3456→1456→5416→2416→1426→5426 3456→2456→5426 3456→6453→4653→2653→5623→4623→3624→5624 Lemma 8: No common node exists in both the frame portion of Tree A and the leaf portions of other trees in the paths from the root to node v in all trees.
Proof: The leaf portion has five patterns: P1, P2, P3, P4, and P5 according to Lemma 7. For P1 and P2, suppose that Tree x is going to traverse node v. P1: v's first symbol is equal to x and Tree x can traverse v by a friend operation in a step. Thus, no common node exists in both Tree A's frame portion and Tree x's leaf portion.

P2:
Tree x traverses node v through a middle node w in cluster A. Because edge w → v is unused in Tree A's frame and Tree x can connect node w by a friend operation in a step, there is no common node exists between Tree A's frame portion and Tree x's leaf portion.

P3:
Suppose that nodes are composed of {a, b, c, d, e, . . . A}, and we omit the rear portion. We exhaust the possibilities with the following three cases. Triangles represent complete graphs.
Case 1: a complete graph Suppose that node ade requires a node of which the first symbol c approaches Tree c's frame, as illustrated in Figure 23(a). Because we have applied the MBFS traversal, no node such as node cde does not possess all children according to Lemma 4. Thus, it cannot occur that a common node appears in node cde.

Case 2: child frame
Node bde in cluster A requires the symbol c to approach to Tree c's frame, but c is used by node cde, as illustrated in Figure 23(b). Hence, node bde uses the symbol b to walk to node dbe. Then, node dbe walks to node cbe, and node bde walks back to Tree c's frame at the end. If a common node appeared in node cbe in Tree A's frame, the path would exist: cbe→bce→dce→cde (marked red lines). We apply the MBFS traversal in buildFrame functions. If the function has traversed node cbe, it would use the purple lines in lieu of the red lines and blue line to traverse node bde in the MBFS traversal. Thus, a common node does not exist due to the shortest path rule.
Case 3: friend frame Node dbe in cluster A requires the symbol b to approach Tree b's frame, but b is used by node bde, as illustrated in Figure 23(c). Hence, node dbe uses d to walk to node ebd. Then, node ebd walks to node bed, and node dbe walks back to Tree b's frame finally. If a common node appeared in node bed in Tree A's frame, the path would exist: bed→deb→edb→bde (marked red lines). We apply the MBFS traversal in buildFrame functions. If the function has traversed node bed, it would use the purple lines in lieu of the red lines and blue line to traverse node dbe in the MBFS traversal. Thus, a common node does not exist due to the shortest path rule.

P4:
As depicted in Figure 22, P2 pattern does not appear in the frames, and T n−k+2 does not execute any buildFrame function. Hence, no common node would appear in the frame.

P5:
It belongs to some nodes of the root cluster in Tree n−k +1. Thus, no common node exists in the frame.
Lemma 9: The nodes of the root cluster must be traversed ultimately in T n−k+1 .
Proof: The root cluster in all ISTs except for T n−k+1 originate from the previous trees. Because the root cluster's incoming edges are not used and T n−k+1 has no previous tree, the root cluster must be traversed ultimately in T n−k+1 . For instance, the five paths of T 6 originate from the previous trees in S 5,3 . In T 6,4 3 , node 5426 must be traversed finally.
Theorem 1: The recursive algorithm can construct n − 1 ISTs in S n,k .
Proof: We prove the theorem by mathematical induction. If we know S x,y , then we know S x+1,y+1 . When y = 1 and x = n − k + 1, a complete graph of n − k + 1 nodes holds. There are n − 1 ISTs as illustrated in Figure 12.
Suppose that y = k and x = n holds. When y = k + 1 and x = n + 1, S n+1,k+1 is made up of n + 1 instances of S n,k . We partition nodes into clusters by the last symbol of each node. First, we copy T n,k 1 to T n+1,k+1 . Second, we find germs as explained in Table 3. Third, we use the buildFrame function to create frames. Fourth, we use buildLeaf functions to create leaf portions. For cluster n + 1, all trees in S n,k are independent and T n+1,k+1 n−k+1 traverses cluster n + 1 through other clusters; hence, all paths of all trees from the root to cluster n + 1 should be internally node-disjoint. For other clusters, each path is made up of frame and leaf portions. The frame portions are distinct and the leaf portions of all paths can be classified into to one leaf pattern of P1, P2, P3, P4, and P5, which have no common node with the frame portion in accordance with Lemma 8. Thus, the n ISTs in S n+1,k+1 are independent, and the recursive algorithm can construct n − 1 ISTs in S n,k correctly by the induction hypothesis.
Theorem 2: n − 1 independent spanning trees in S n,k constructed by the parallel algorithm are independent.
Proof: The ISTs of S n−k+1,1 are constructed by hand, as presented in Figure 12. The buildFrame function is an instance of the buildFrameP function with tailN set to 1. We can use tailN to fix the last tailN symbol(s) to reduce the dimensions of S n,k and create all frames of ISTs from S n−k+2,2 to S n,k simultaneously, whereas in the recursive algorithm the dimensions increase one in each iteration, and ISTs constructed in this iteration must be copied to ISTs next iteration. According to Algorithm 3, we create a FrameGermSet, and the germs of S n,k are identical to that of S n−k+2,2 to S n,k in the recursive algorithm. Therefore, the frames created by both algorithms are the same. The findParent function produces five leaf patterns displayed in Figure 22 as the buildLeaf function does. Thus, the ISTs of S n,k constructed by the parallel algorithm and the recursive algorithm are the same. According to Theorem 1, the parallel algorithm can construct n − 1 ISTs in S n,k accurately.

V. ANALYSIS AND COMPARISON
We programmed in PHP and created illustrations in Graphviz. The test cases are presented in Table 4. We tested whether all paths in all trees were internally vertex-disjoint. The results proved that all paths in all trees were internally vertexdisjoint. Both algorithms are correct. Because all nodes and all directed edges are traversed once, the time complexity of S n,k is the summation of the numbers of nodes and directed edges from S n−k+1,1 to S n,k . The number of nodes in S n,k is n! (n−k)! and the number of VOLUME 8, 2020 directed edges in S n,k is n! (n−k)! × (n − 1). We can compute the summation: . However, the time complexity of S n,k in the parallel algorithm is the summation of the numbers of nodes and directed edges of S n,k . Thus it is O( n! (n−k)! + n! (n−k)! × (n − 1)) = O(n × n! (n−k)! ), and it can decline to O( n! (n−k)! ) if the system has n − 1 processors computing in parallel.
The functions of the recursive algorithm are buildFrame and buildLeaf, and both of them are BFS-based. In the parallel algorithm, the buildFrameP function is BFS-based, but the findParent function is rule-based. The concept of the recursive algorithm is simpler than that of the parallel algorithm. The two algorithms are compared in Table 5.

VI. CONCLUSION
In this paper, we proposed one recursive algorithm and one parallel algorithm for constructing ISTs in (n,k)-star graphs. The recursive algorithm is a top-down approach, and the parent of a node in an IST is not determined by any rule. The parallel algorithm combines top-down and bottom-up approaches. In this paper, correctness, proofs, and time complexity analyses were presented for both algorithms. We also described PHP implementations of both algorithms. The test results for different fifty-nine cases are in Table 4. The results prove that all trees of all cases in Table 4 are ISTs for both algorithms. We conclude that our algorithms are not only correct but also efficient, and furthermore, the parallel algorithm is more efficient than the recursive algorithm. We hope that our contribution can aid in novel IST research.