Torus Pairwise Disjoint-Path Routing †

Modern supercomputers include hundreds of thousands of processors and they are thus massively parallel systems. The interconnection network of a system is in charge of mutually connecting these processors. Recently, the torus has become a very popular interconnection network topology. For example, the Fujitsu K, IBM Blue Gene/L, IBM Blue Gene/P, and Cray Titan supercomputers all rely on this topology. The pairwise disjoint-path routing problem in a torus network is addressed in this paper. This fundamental problem consists of the selection of mutually vertex disjoint paths between given vertex pairs. Proposing a solution to this problem has critical implications, such as increased system dependability and more efficient data transfers, and provides concrete implementation of green and sustainable computing as well as security, privacy, and trust, for instance, for the Internet of Things (IoT). Then, the correctness and complexities of the proposed routing algorithm are formally established. Precisely, in an n-dimensional k-ary torus (n<k, k≥5), the proposed algorithm connects c (c≤n) vertex pairs with mutually vertex-disjoint paths of lengths at most 2k(c−1)+n⌊k/2⌋, and the worst-case time complexity of the algorithm is O(nc4). Finally, empirical evaluation of the proposed algorithm is conducted in order to inspect its practical behavior.


Introduction
Since the development of parallel supercomputers, the number of included processors has been continuously rising. The hardware component that is responsible for the connection of processors is the interconnection network (a.k.a., interconnect). Hypercubes [1] were a popular topology for the interconnection network of massively parallel systems in the eighties. Intel developed, for instance, the iPSC supercomputer series, with the iPSC/1 device connecting 32 to 128 cores: the iPSC/d5 is based on a five-dimensional hypercube, hence connecting 2 5 = 32 cores; the iPSC/6 is based on a six-dimensional hypercube, hence connecting 64 cores, and the iPSC/d7 128 cores. A similar approach was followed by the nCUBE company that built, for example, the nCUBE 10 device, which is based on a 10-dimensional hypercube, hence connecting 1024 cores.
Nowadays, machines of the megaFLOPs era, such as the nCUBE, have been replaced by ones featuring a computing power of several petaFLOPs, and with even the exaFLOP barrier possibly being reached as soon as 2020 by the Cray company [2]. Regarding the number of processors embodied, modern massively parallel systems rely on hundreds of thousands of them. One step ahead, the Sunway TaihuLight supercomputer, ranked world number one in June 2017 and second as of June 2018 [3], includes more than one million cores. Considering this very large number of processors, it is easy to understand that data communication efficiency and interconnection networks in general are critical to achieving the highest computing performance. Indeed, in the case of suboptimal core interconnection and data transfers, bottleneck situations would inevitably arise, inducing underused cores.
Just as complete networks are not practical as interconnection networks of massively parallel systems given the prohibitively high number of edges per processor induced, hypercubes are no more a solution considering the number of nodes involved. Precisely, the vertex degree in the case of a hypercube becomes rapidly impractical as n edges per vertex are required for the hypercube to connect, in total, 2 n vertices. As a result, various topologies designed for interconnection networks have been introduced. For example, Li et al. proposed the dual-cube [4] and metacube [5] topologies, both based on hypercubes. The star-graph [6] is another topology example, this time based on permutations, which was used to introduce other topologies, such as burnt pancake graphs [7].
Topologies based on meshes [8] are another solution for interconnection networks. One of these, the torus topology [9], is addressed in this paper. Thanks to a simple definition and an advantageous network order compared with, for instance, hypercubes, the torus network topology is very popular as interconnect of supercomputers. Indeed, numerous machines listed in the TOP500 world ranking are based on the torus topology. For example, the Fujitsu K (Tofu interconnect [10,11]), IBM Blue Gene/L, IBM Blue Gene/P, and Cray Titan (Gemini interconnect [12]) supercomputers [3]. The main topological properties of tori and those of various other interconnection networks are given in Table 1. In this table, the network cost is the product of network degree by network diameter. Table 1. Comparing torus topological properties with other popular interconnection networks [9].

Network
Order Degree Diameter Cost Links (n, k)-torus k n 2n n k/2 2n 2 k/2 nk n n-hypercube 2 n n n n 2 2 n n n-dual-cube 2 2n−1 n 2n 2n 2 2 2n−2 n n-star graph n! n − 1 3(n − 1)/2 (n − 1) 3(n − 1)/2 n!(n − 1)/2 (k, m)-metacube 2 2 k m+k m + k 2 k (m + 1) 2 k (m + 1)(m + k) 2 2 k m+k−1 (m + k) In this paper, the torus pairwise disjoint-path routing problem is addressed. This critical data communication problem consists of the selection of mutually vertex-disjoint paths between several vertex pairs. As detailed next, this problem has numerous applications. Disjoint-path routing in general is a very desirable property for routing algorithms, and this is for several reasons. First, disjoint-path routing enables simultaneous data transfers over the network, and for that, without the need to change switching patterns inside routers, on the one hand optimizing data transfer performance, and, on the other hand, reducing network usage time. While the former consequence has obvious positive implications, the latter thus induces concrete implementation of energy-harvesting communications and networks, which contents green and sustainable computing [13,14], with applications, for instance, to the Internet of Things (IoT) and cyber-physical systems. In addition, path disjointness enforced at the hardware level with circuit switching means that an optimum degree of privacy is achieved as a data transfer is never interrupted by another transmission. This research thus directly addresses the issues of security, privacy, and trust for the IoT. Second, disjoint-path routing importantly ensures that the notorious blocking situations of parallel processing, deadlocks, livelocks and starvations, never occur, thus facilitating, for instance, distributed data processing in sensor applications. Third, not only efficiency but, by selecting disjoint paths, system dependability is also significantly increased. Effectively, where multiple nondisjoint paths could be rendered useless by a single faulty vertex (i.e., the faulty vertex is common to several paths), disjoint paths are much more robust: one faulty vertex can jeopardize, at most, one path, since any vertex of the network is included in at most one of the selected paths. Such robustness has positive implications regarding, for instance, the quality of experience and service in the IoT and cyber-physical systems.
In an arbitrary c-connected graph G(V, E), the existence of c disjoint paths for each of the node-to-node disjoint paths, the node-to-set disjoint paths, and the set-to-set disjoint paths problems are ensured by Menger's theorem [15]. In fact, disjoint paths can be obtained by applying the maximum-flow algorithm assigning unit capacity to each of the edges and the vertices. For c pairs of vertices in arbitrary graph G(V, E), the problem whether there are c disjoint paths between the c pairs is NP complete if c is a variable of the problem input [16]. For any fixed c, the problem can be solved in O(|V| 3 ) [17] though it is still a hard problem.
Due to higher complexity, the pairwise disjoint-path routing problem is typically addressed last after introducing algorithms that solve the unicast (a.k.a., point-to-point, one-to-one, or node-to-node), node-to-node disjoint-path, node-to-set disjoint-path and set-to-set disjoint-path routing problems. In an n-dimensional k-ary torus, a node-to-node routing algorithm has been described in Reference [18] and with fault tolerance in Reference [19], the latter selecting paths of lengths at most n k/2 + 1, with a worst-case time complexity of O(k 2 ). A node-to-set disjoint-path routing algorithm in a torus has also been described in Reference [19], with paths of lengths at most n k/2 + 1, and a worst-case time complexity of O(k 3 ). A torus set-to-set disjoint-path routing algorithm has been given in Reference [20], with paths of lengths at most 2(k + 1)n, and a worst-case time complexity of O(kn 3 + n 3 log n).
As for different topologies, Gu and Peng described a pairwise disjoint-path routing algorithm in a hypercube [21] and in a star-graph [22]. Bossard and Kaneko solved the same problem in perfect hierarchical hypercubes [23], as did Sawada et al. in pancake graphs [24], and Park focused on restricted hypercube-like graphs [25]. The approach in this paper to select mutually vertex-disjoint paths is, as used in several previous works, to rely on the recursive structure of a torus. Precisely, in an n-dimensional k-ary torus, given c (c ≤ n) vertex pairs, the algorithm proposed here selects c mutually vertex-disjoint paths of lengths at most 2k(c − 1) + n k/2 with a worst-case time complexity of O(nc 4 ).
Related research on disjoint-path routing can be found in Reference [26] where it is applied to data-center networks. Close to disjoint-path routing, independent spanning tree construction has been researched, for instance, in Möbius cubes in [27]. Other related works include the calculation of various topological values of the network topology, such as topological indices [28] and the least eigenvalue [29].
The rest of this paper is organized as follows. Definitions, notations and intermediary results are established in Section 2. The proposed routing algorithm is described in Section 3 and exemplified in Section 4. The proof of the algorithm correctness, including the fact that the selected paths are disjoint, is given in Section 5, which relies on lemmas proved in Section 2. Complexities are formally established in Section 6 and the proposed algorithm is empirically verified and evaluated in Section 7. Finally, this paper is concluded in Section 8.

Preliminaries
For the sake of clarity, a vertex pair (in this paper, typically a source-destination vertex pair), denoted by (u, v), can be considered as the set {u, v}. For vertex u, define set N(u) as the set of the neighbor vertices of u.
In a graph, a path p is an alternate sequence of vertices and links u 1 , (u 1 , u 2 ), u 2 , . . . , (u n−1 , u n ), u n . Path p can be similarly written as u 1 → u 2 → . . . → u n and abbreviated as u 1 ; u n when explicit mention of the vertices between u 1 and u n is not required. The length of a path is defined as its number of links, hence p has length n − 1. Two paths are mutually vertex-disjoint (simply disjoint hereinafter) if and only if they have no vertex in common.

Definition 1 ([8]
). An n-dimensional k-ary torus, denoted by (n, k)-torus, is an undirected graph made of the k n vertices induced by the set {0, 1, . . . , k − 1} n . Two vertices a = (a 1 , a 2 , . . . , a n ) and b = (b 1 , b 2 , . . . , b n ) of an (n, k)-torus are adjacent if and only if ∃j Thus, a vertex of an (n, k)-torus is an n-dimensional vector. Therefore, two vertices of an (n, k)-torus can be compared (i.e., equality testing) in linear O(n) time, by simply going through each of all the n coordinates of the two vertices. A (2, 4)-torus is illustrated in Figure 1. An (n, k)-torus is a recursive topology: for one dimension δ (1 ≤ δ ≤ n), it consists of k (n − 1, k)-tori (called subtori). For instance, considering the horizontal dimension of the (2, 4)-torus of Figure 1, that is the dimension δ = 1, this torus consists of four (1, 4)-tori: these subtori appear vertically in the figure. It is said that a path goes through a subtorus T if and only if it includes a vertex of T.
Then, still considering vertex u and dimension δ, candidate paths and the corresponding path sets for traversing the dimension δ are defined as follows. Note that these paths specify how to traverse a dimension, thus remaining "open" (i.e., with a start vertex, but no end vertex) for the sake of simplicity.
Finally, define the two path sets: and The paths of P + (u, δ) and P − (u, δ) in the case of a (3, 5)-torus are illustrated in Figure 2, where δ is the dimension used to distinguish subtori.
Next, a torus point-to-point routing algorithm is recalled. Unicast routing in a torus can be achieved simply with a dimension-order routing algorithm. A dimension-order routing algorithm for packet forwarding in two dimensional meshes is presented by Duato et al. [8]. It can be easily adjusted for routing in an n-dimensional torus as listed in Algorithm 1. The maximum length of a path selected by this algorithm between any two vertices is thus n k/2 .
To conclude this section, we introduce two essential lemmas on which the algorithm proposed in this paper is based (Section 3).
with thus s i = d i allowed, and one subtorus T on a dimension δ (1 ≤ δ ≤ n), disjoint paths (at the exception that the paths for s i and d i (1 ≤ i ≤ c) need not be disjoint) that route each of all vertices s i , d i to T can be found in O(nc 2 ) time. Maximum path length is k + 1.  Proof. First, assume without loss of generality that s i is to be routed to T, and that γ(s i , δ) ≤ γ(T, δ). The same discussion holds for d i and for the case γ(s i , δ) > γ(T, δ). We show that there always remains at least one path of P + (s i , δ) that is not blocked by another source vertex, destination vertex or their respective paths towards T.
First, the paths of P + (s i , δ) consist of shortest path p + (s i , δ), and of the two sets P + 1 (s i , δ) and P + 2 (s i , δ). The paths of these two sets are not disjoint: a neighbor u of s i is included in one single path of each of the two path sets. Hence, if u = s j (i = j), two candidate paths are blocked by one single vertex (s j ). The reason for considering P 1 and P 2 paths is that vertex d i can indirectly block a candidate path for s i . Effectively, d i may trigger the selection of a non-shortest path for a vertex s j towards T (i = j), and thus in total d i and s j each block one path for s i . See Figure 3.
Vertex d i on its own is not a blocker for s i . Thus, we consider the case where d i is an indirect blocker through vertex say s j .
So, by considering the paths of P 1 and P 2 , we ensure that either there remains one of the two paths, In the first situation, we necessarily have In the second situation, two nondisjoint paths are blocked by d i , s j ; thus, d i , s j count as one blocker for s i (they block only one of the disjoint candidate paths). Therefore, it is sound to assume that d i does not count as a blocker for s i .
At the exception of d i , each of all 2(n − 1) other blockers for s i (i.e., (S ∪ D) \ {s i , d i }) can block at most one of the disjoint candidate paths. In total, it is possible to select 2(n − 1) + 1 disjoint paths from s i to T (i.e., considering the candidate paths {p δ)). Therefore, considering that at most 2(n − 1) of these disjoint paths are blocked, there always remain [2(n − 1) + 1] − 2(n − 1) = 1 path to route s i to T. See Figure 4.
Maximum path length would be obtained if s i is routed to T with a path of P 2 , hence of length (k − 1) + 2 = k + 1. To route s i to T, we first enumerate the paths of {p + (s i , δ)} ∪ P + 1 (s i , δ) (starting with p + (s i , δ)). If all are blocked, it means that d i is an (indirect) blocker, thus inducing the check of at most one path of P 2 (i.e., if the first checked path of P 2 is blocked, the second one will always do).
Hence, the worst-case time complexity to route s i to T is O(nc), and, in total, O(nc 2 ) is required to route all vertices s i ,

Lemma 2.
In an (n, k)-torus (n ≥ 3, k ≥ 5), with thus s i = d i allowed, and two subtori T, T on a dimension δ (1 ≤ δ ≤ n), disjoint paths (at the exception that the paths for s i and d i (1 ≤ i ≤ c) need not be disjoint) that route the vertices of one pair to T without going through T and the vertices of the other pairs to T without going through T can be found in O(nc 2 ) time. Maximum path length is k.
Proof. Assume that, given the pair (s i , d i ) routed to T , there exists vertex s j (i = j) that cannot be disjointly routed to T without going through T , that is, each of all candidate paths to T for s j as per Lemma 1 are blocked. See Figure 5. If such a vertex s j does not exist, all vertices s t , d t (1 ≤ t ≤ c, t = i) can be routed to T provided that if there exists a unique pair (s j , d j ) (j = i) with 3 disjoint candidate paths to T without going through T blocked by the paths for (s i , d i ) it is routed first to T, (i.e., before all the other pairs (s t , d t ) (1 ≤ t ≤ c, t = i, t = j)), and there is thus nothing to prove. For s j to be fully blocked, vertex s i or d i (i = j) needs to be on dimension δ, that is, blocking path p(s j , δ). By definition of the candidate paths (see Lemma 1), this vertex s i or d i is the only one that can block two candidate paths for s j , as all the other vertices s l , d l (l = j, l = i) can block, at most, one candidate path for s j . Hence, the 2(n − 1) + 1 candidate paths for s j are blocked by at least 2(n − 1) vertices s i or d i (i = j). In other words, for vertex s j to be fully blocked, vertex s i or d i needs to be on p(s j , δ), the unique direct path to T for s j . Since at least 2(n − 1) vertices s i or d i are required to fully block s j , it means that one of these 2(n − 1) blockers blocks p(s j , δ) in addition to one of the two candidate paths for s j on another dimension, say α (α = δ). All other 2(n − 1) − 1 blockers are positioned 2 per dimension β (β = δ, β = α), at the exception of one blocker that is on the dimension α (on the other side of s j compared with the blocker that blocks two paths at once for s j ). Hence, there exists one unique such vertex of S ∪ D (here s j ) that is not routable to T.
So, for a vertex s j to be fully blocked, T ∩ (S ∪ D) = ∅ is induced, otherwise it would mean that at least one pair vertex needs not be routed at all (i.e., a path of zero length will do for that vertex), and, thus, all other vertices can be routed to T, T by Lemma 1.
Furthermore, since c ≥ 3, either there exists a pair (s t , d t ) with {s t , d t } ⊂ N(s j ) that can be routed to T without going through T (in place of the pair (s i , d i )) with the paths p(s t , δ) and p(d t , δ) (see Figure 6a). Or, if d j blocks one of these two paths, the pair (s j , d j ) can be routed to T without going through T (in place of the pair (s i , d i )) with the paths p(s j , δ) and p(d j , δ) (see Figure 6b). Because of the uniqueness of such a vertex s j not routable to T, we have shown that it is possible to disjointly route one pair to T and the other pairs to T.
Considering the two subtori T and T , the value of |γ(T, δ) − γ(T , δ)| is at most k − 1. Given that the pair vertices are to be routed towards T (resp. T ) not going through T (resp. T), and by Lemma 1, the maximum path length is (k − 2) + 2 = k.
Regarding time complexity, pair vertices can be routed to T and T as follows. Let (s i , d i ) be the pair routed to T . By Lemma 1, this takes O(nc) time. If either s i or d i blocks a path p(u, δ) for u a vertex of a pair (s j , d j ) (1 ≤ j ≤ c, j = i), do as follows, and otherwise each of all pairs except the one routed to T is routed to T with a path as per Lemma 1 that does not go through T . Check if u is routable to T with a path as per Lemma 1 that does not go through T ; this takes O(nc) time. If u is routable to T, starting with the pair (s j , d j ), each of all pairs except (s i , d i ) is routed to T with a path as per Lemma 1 that does not go through T . If u not routable to T, discard the paths for (s i , d i ) to T and instead route an arbitrary pair (s t , d t ) (t = i, t = j) to T with the paths p(s t , δ), p(d t , δ) not going through T, with the possibility that d j blocks (s t , d t ) when routed to T , in which case it is the pair (s j , d j ) that is routed to T , with the paths p(s j , δ), p(d j , δ) not going through T. Each of all pairs except the one routed to T is routed to T with a path as per Lemma 1 that does not go through T . Hence, the induced total time complexity is that of Lemma 1: O(nc 2 ).

Routing Algorithm
In an (n, k)-torus (n < k, k ≥ 5), given c pairs (s i , ; thus, s i = d i allowed, this problem consists in finding a path connecting each (s i , d i ) pair (1 ≤ i ≤ c), and such that the selected c paths are mutually vertex-disjoint. The algorithm execution trace of a sample instance of the pairwise routing problem is given in Section 4.
First, one should note that a torus of dimension 1 (i.e., n = 1) is isomorphic to a ring. Hence, in this case, c = 1, and it is trivial to connect the unique source-destination vertex pair by traversing the ring. So, we henceforth assume that n ≥ 2. The main idea of the proposed routing algorithm is to follow a divide-and-conquer approach by considering the (n, k)-torus as a k-set of (n − 1, k)-tori, connecting one source-destination pair in one such subtorus, and solving the problem recursively for the remaining pairs in another, distinct subtorus. We proceed according to the following cases.

Base Case: c = 1
This is point-to-point routing in a torus, and thus dimension-order routing can be applied to find a shortest path s 1 ; d 1 .

General Case: n ≥ 3
Step 1 Find a subtorus T such that the following three conditions hold: In other words, subtorus T either includes no source vertex and no destination vertex, includes at most one source vertex and no destination vertex, includes at most one destination vertex and no source vertex, or includes one single source vertex, say s i , and one single destination vertex d i .
The selection of subtorus T sets dimension δ to reduce the original (n, k)-torus to a set of k (n − 1, k)-subtori.
Step 2 First, source-destination pair ρ is selected as follows. If T ∩ (S ∪ D) = ∅, any pair will do, so select one arbitrarily, say ρ = (s i , In the remaining of this section, assume without loss of generality that ρ = (s i , d i ), in other words that the source-destination pair to be connected inside T is (s i , d i ).
Second, considering selected pair ρ = (s i , d i ), select subtorus T distinct from T , such that ρ ∩ T = ∅.
Step 3 Route one source-destination pair to T and the other pairs towards T as per Lemma 2.
Step 4 If for the pair (s i , d i ) that is routed to T , say with the paths p s : s i ; s i ∈ T and p d : d i ; d i ∈ T , we have U = ∅ with U = (p s ∩ p d ) \ T , consider the vertex u ∈ U that is the closest to s i . Select the subpath s i ; u of p s and the subpath d i ; u of p d , and discard the subpath u ; s i of p s and the subpath u ; d i of p d . Otherwise, apply the algorithm recursively in T to connect s i to d i .
Step 5 For each pair (s j , d j ) routed to T, say with the paths p s : s j ; s j ∈ T and p d : d j ; d j ∈ T, such that U = ∅ with U = (p s ∩ p d ) \ T, consider the vertex u ∈ U that is the closest to s j . Select the subpath s j ; u of p s and the subpath d j ; u of p d , and discard the subpath u ; s j of p s and the subpath u ; d j of p d . Define E the set of all such source-destination pairs. Step 6 For each source-destination pair not in E, apply the algorithm recursively in T.
An illustration of the algorithm general case is given in Figure 7

Execution Trace Example
In this section, considering the following disjoint pairwise routing problem instance, a possible execution trace of the proposed routing algorithm is detailed. In a (4,  Table 2. The torus arity, here k = 5, never changes and does thus not appear in the table.

Proof of Correctness
First, dimension-order routing is applied in the base case of the recursion when there is one single source-destination pair. As recalled in Section 2, this process consists in traversing the torus one dimension after the other, concretely for each dimension δ starting from source vertex δ coordinate and traversing dimension δ until reaching destination vertex δ coordinate. This common algorithm is trivially correct. For Step 1, it is required to show the existence of a subtorus T . Along an arbitrary dimension . Amongst them, if there is a subtorus T i * that satisfies |(S ∪ D) ∩ T i * | ≤ 1, we can select it as T . Now, let us assume that such a subtorus T i * does not exist.
This induces |S ∪ D| > 2n, which is a contradiction. Hence, T i * always exists. For Step 2, the existence of pair ρ is trivial. Regarding the existence of a subtorus T ⊃ ρ, it is recalled that the selection of T fixes dimension δ inducing subtori. Therefore, on the one hand, excluding T , there remain k − 1 candidate subtori for T. On the other hand, selected pair ρ = (s i , d i ) induces at most two additional unavailable subtori for T (i.e., if s i , d i in the same subtorus, only 1 additional unavailable subtorus is induced, and zero additional unavailable subtorus is induced if ρ ⊂ T ). Hence, there remain at least k − 3 available subtori for T. Since k ≥ 5, we have k − 3 ≥ 2.
The feasibility of Step 3 is proved by Lemma 2. For Step 4, at most one source-destination pair is to be connected recursively inside T . Since n ≥ 3, the dimension of T is at least 2, and the problem can thus be solved recursively in T (this is the base case c = 1 of the algorithm). In Steps 4 and 5, the two paths to the appropriate subtorus, say T, for a pair (s j , d j ) are checked for the inclusion of a common vertex outside T. The only case for such a common vertex to exist is when the two paths are in the same direction (i.e., both taken either from P + or P − ), otherwise this would mean that the common vertex is in T. Hence, the common vertex outside T that is the closest to s j is also the closest to d j . For Step 6, because one path is connected inside T (or on the way to T ), the number of paths to select recursively in T is at most c − 1 ≤ n − 1. Since T is of dimension n − 1, the problem can be solved recursively inside T.
Finally, regarding the second base case of the recursion, the special case c = 2, n = 2, two source-destination pairs need to be connected inside a (2, k)-torus. Each of these two pairs is connected in a distinct subtorus. The existence of the two subtori T and T has already been shown previously for the general case.
The vertices of pair ρ, say (s 1 , d 1 ), are first routed to T without going through T. Since k ≥ 5, there always remains at least one path disjoint with the vertices (s 2 , d 2 ) of the other pair to route (s 1 , d 1 ) towards T . For the second pair (s 2 , d 2 ), the paths of (s 1 , d 1 ) to T may fully block (i.e., not routable as per Lemma 1 to T without going through T ) one or both vertices of (s 2 , d 2 ). If one single vertex of (s 2 , d 2 ), say u, is fully blocked, route u towards T by going through T with the path q : p(u, δ) to T through T . This path q always remains unblocked since, for u to be fully blocked to T, one vertex of (s 1 , d 1 ), say v, is on p(u, δ) to T, blocking two candidate paths to T for u, and the other vertex is in N(u), precisely the neighbor of u that is opposite to the neighbor of u that is included in the path to T for v. Hence, path p(u, δ) to T through T is always disjoint with the paths to T selected for (s 1 , d 1 ). Since with the selection of s 2 , d 2 / ∈ T , and by the selection of the path q, subtorus T includes one single vertex of the path q. See Figure 8a. If both vertices of (s 2 , d 2 ) are fully blocked by the paths to T for (s 1 , d 1 ), it means that (T ∪ T ) ∩ (S ∪ D) = ∅ and that s 2 , d 2 are blocking both p(s 1 ) and p(d 1 ) towards T. Hence, route instead (s 2 , d 2 ) to T (with p(s 2 , δ), p(d 2 , δ) to T ) and (s 1 , d 1 ) to T (with p(s 1 , δ), p(d 1 , δ) to T). See Figure 8b.
The two subtori T, T are one-dimensional, that is, isomorphic to a ring. It is thus trivial to complete the connection of each of the two pairs inside their respective subtori, even if there is one vertex to be avoided in subtorus T : either the clockwise or counter-clockwise ring traversal will do.

Complexities
Let function T(c, n) represent the time complexity of the proposed algorithm in an (n, k)-torus with c source-destination pairs (c ≤ n). And, let the function L(c, n) represent the maximum length of a path selected by the algorithm inside an (n, k)-torus with c source-destination pairs (c ≤ n).
The In the special case n = 2, c = 2, two subtori T, T are selected as in Step 1 of the general case, thus inducing an O(1) time complexity. The selection of the paths for the two pairs may require checking all the candidate paths as per Lemma 1, thus inducing an O(n) time complexity. An additional O(nk) is required to check whether the selected pair paths are disjoint. Finally, routing inside one-dimensional subtori is possible, checking whether the selected path includes the vertex to avoid (O(1)), thus being O(k) time. Hence, in total, this special case is O(nk) time. The maximum path length is obtained when k links are taken to route both the source and destination vertices to the designated subtorus, and with k − 1 links for routing inside one-dimensional subtori, thus in total 3k − 1.
The above discussion can be summarized in the following theorem.

Theorem 1.
In an (n, k)-torus (n < k, k ≥ 5), given c (1 ≤ c ≤ n) vertex pairs (s i , d i ) (all pair vertices are distinct, yet s i = d i is acceptable), it is possible to select c mutually vertex-disjoint paths s i ; d i (1 ≤ i ≤ c) of lengths at most 2k(c − 1) + n k/2 in O(nc 4 ) time.

Proof.
A path of maximum length could be selected as follows: each recursive step induces k links to route the source vertex to the designated subtorus, k links to route the destination vertex to the designated subtorus, and this until reaching a base case, either c = 1 with a path of n k/2 links selected by dimension-order routing, or n = 2, c = 2 with two paths each of length at most 3k − 1. This is summarized with the following recursive expression: L(c, n) = 2k + L(c − 1, n − 1).
The total worst-case time complexity is given by the following recursive expression: Hence, the total time complexity of the proposed routing algorithm is O(nc 4 ).

Empirical Evaluation
We have implemented the algorithm proposed in this paper in order to realize its empirical evaluation, and especially to inspect its practical behavior: how the algorithm performs in average. The computer used for this experiment was equipped with an Intel Core i5-7300U CPU (clocked at 2.60 GHz), 8 GB RAM and ran Windows 10 64-bit.
By using this computer implementation, we have repetitively and automatically solved a large number of random instances of the pairwise disjoint-path routing problem in a torus. Precisely, in an (n, max{5, n + 1})-torus, we have solved for each value of n (2 ≤ n ≤ 7) a total of 10,000 random routing problem instances. For each of these instances, the correctness of the selected paths has been checked (e.g., path disjointness), and the maximum length of the selected paths was stored. Then, for each value of n, the average of the stored maximum path lengths for this value of n was computed. Hence, our results include for each n both the maximum and the average of the obtained 10,000 maximum path lengths. The number of vertex pairs was set to c = n to maximize the routing difficulty. For each n, the maximum and average of the maximum path lengths are given in Figure 9; the theoretical upper bound on the maximum path length is also given for reference.
Then, we have measured the average execution time for one problem instance: see Figure 10; the worst-case time complexity is also plotted for reference.
Regarding maximum path lengths, one can first note that there is some distance between the theoretical upper bound on the maximum path length and the obtained results. This is a good indicator of the efficiency of the proposed algorithm, especially given that for small values of n the upper bound is almost tight on the maximum path length. Regarding time complexity, it can be observed from the obtained results that the average performance of the algorithm is significantly better than the theoretical worst-case time complexity.

Conclusions
The torus topology is very popular for the interconnection network of massively parallel systems such as the modern supercomputers Fujitsu K, IBM Blue Gene/L, IBM Blue Gene/P, and Cray Titan. In this paper, an algorithm that solves the pairwise disjoint-path routing problem in a torus has been proposed. This routing problem consists in the selection of mutually vertex-disjoint paths between given vertex pairs, and it is critical to maximize system dependability and data communication efficiency. We have then formally shown that in an n-dimensional k-ary torus, for c (c ≤ n) vertex pairs, the described algorithm selects disjoint paths of lengths at most 2k(c − 1) + n k/2 with a worst-case time complexity of O(nc 4 ). Furthermore, the practical behavior of the proposed algorithm has been inspected by conducting computer experiments, showing that performance on average was significantly better than the established formal worst-case complexities.
As for future works, it will be meaningful to investigate whether the theoretical maximum path length is attainable, and if not, try to refine it. For example, this might be achieved by more wisely selecting the subtori used for disjoint routing. Even though the selection of subtorus T may not leave many options, the selection of subtorus T that was used to solve the problem recursively could be done such that shorter paths to route pair vertices to T are selected.