• 沒有找到結果。

5 A permutation routing algorithm in the baseline (or reverse baseline) network

OSn−2 = r0r1r2· · · rn−3xn−1 OSn−1 = r0r1r2· · · rn−3rn−2

...

OS2n−5 = r0r1rn−2rn−1· · · r2n−6 OS2n−4 = r0rn−2rn−1· · · r2n−6r2n−5 OS2n−3 = rn−2rn−1· · · r2n−6r2n−5r2n−4

(1)

Here xn−1xn−2· · · x0 denotes an input and yn−1yn−2· · · y0 denotes an output. Note that rn−2rn−1· · · r2n−3 = yn−1yn−2· · · y0. It can be verified that a dilated Benes network satis-fies the sufficient condition stated in Theorem 3 and hence is CF-rearrangeable.

5 A permutation routing algorithm in the baseline (or reverse baseline) network

Recall that both the Benes network and the dilated Benes network are the concate-nation of the baseline network and the reverse baseline network. The Benes network is rearrangeable, whereas the dilated Benes network is CF-rearrangeable. For convenience, call the output links of switches of stage (n − 1) followed by routing paths in a permu-tation (respectively, semi-permupermu-tation) of the Benes network (respectively, dilated Benes

network) the intermediate destinations. In [27], by using the intermediate destinations of a Benes network, Yang and Wang proposed an algorithm (for convenience, call it Algo-rithm YW) to route an arbitrary permutation in a baseline (or reverse baseline) network with node-disjoint paths in four passes.

Algorithm YW uses Algorithm 1 to decompose a given permutation P into two semi-permutations L and R. Recall that Algorithm 1 has to construct a bipartite graph explic-itly. Also, to use the intermediate destinations of a Benes network, Algorithm YW has to run Algorithm 1 to decompose each of L and R into two semi-permutations, say, LL, LR, RL, and RR. Then, Algorithm YW has to run Algorithm 1 to further decompose each of LL, LR, RL, and RR into two semi-permutations, say, LLL, LLR, LRL, LRR, RLL, RLR, RRL, and RRR. The same process repeats until each semi-permutation contains only one input-output pair.

The purpose of this section is to improve Algorithm YW. To achieve this purpose, Algorithm 2 is used instead of Algorithm 1; also, the intermediate destinations of a dilated Benes network are used instead of the intermediate destinations of a Benes network. See the following for details.

We first use Algorithm 2 to decompose a given permutation P into two semi-permutations Land R; then, route L in a baseline network with node-disjoint paths in two passes, and route R in a baseline network with node-disjoint paths in two passes. In the following, we only present an algorithm to route an arbitrary semi-permutation P in a baseline network with node-disjoint paths in two passes. Obviously, setting P = L and P = R will route an arbitrary permutation in a baseline network with node-disjoint paths in four passes.

Suppose the semi-permutation is P =

 a0 a1 a2 · · · aN

2−1

b0 b1 b2 · · · bN

2−1



. Note that we have assumed that the links connecting inputs and switches of stage 0 are regarded as output links of switches of stage (−1). Therefore, an input-output path from input ai to output bi, 0 ≤ i ≤ N2 − 1, in a dilated Benes network can be represented as

Li,0 → Li,1 → Li,2 → · · · → Li,2n−3 → Li,2n−2, where Li,0 = ai, Li,2n−2 = bi, and Li,k, 1 ≤ k ≤ 2n − 3, is the output link of switches of stage k − 1 followed by the path. Our algorithm is based on the observation that L0,n, L1,n, . . . , LN

2−1,n are the intermediate destinations of a dilated Benes network for P and can be obtained by Algorithm 3. Let P1 =

 a0 a1 a2 · · · aN 2−1

L0,n L1,n L2,n · · · LN

2−1,n



and P2 =

 L0,n L1,n L2,n · · · LN

2−1,n

b0 b1 b2 · · · bN

2−1

 . The following lemma was proven in [27].

Lemma 6. [27] The set of all semi-permutations realized by a baseline network with node-disjoint paths in one pass is exactly the set of all semi-permutations realized by a reverse baseline network with node-disjoint paths in one pass.

We now prove a lemma.

Lemma 7. Both P1 and P2 can be realized by a baseline (or reverse baseline) network with node-disjoint paths in one pass. Moreover, routing bits for P1 and P2 are the n-bit binary representations of L0,n, L1,n, . . . , LN

2−1,n and b0, b1, . . . , bN

2−1, respectively.

Proof. Since a dilated Benes network is CF-rearrangeable, P can be realized in it with node-disjoint paths in one pass. Consider P1. The first n stages of a dilated Benes network form a baseline network. Thus P1 can be realized by a baseline network with node-disjoint paths in one pass. By Lemma 6, P1 can also be realized by a reverse baseline network with node-disjoint paths in one pass. Now consider P2. Since the last n stages of a dilated Benes network form a reverse baseline network, P2 can be realized in the last n− 2 stages (i.e., stages 2, 3, . . ., n − 1) of a reverse baseline network with node-disjoint paths in one pass. Thus if we can prove that, in a reverse baseline network, input Li,n, 0 ≤ i ≤ N2 − 1, can get to output link Li,n of stage 1, then P2 can be realized by a reverse baseline network with node-disjoint paths in one pass. For input Li,n, choose its routing bit at stage 0 to be 0 if jL

i,n

2

k is even and 1 if jL

i,n

2

k is odd; choose its routing bit at stage 1 to be 0 if Li,n is even and 1 if Li,n is odd. It is not difficult to see that the above

choices of routing bits ensure input Li,n to get to output link Li,n of stage 1. Therefore, P2 can be realized by a reverse baseline network with node-disjoint paths in one pass.

By Lemma 6, P2 can also be realized by a baseline network with node-disjoint paths in one pass. Since a baseline (or reverse baseline) network follows destination tag routing, routing bits for P1 and P2 are the n-bit binary representations of L0,n, L1,n, . . . , LN

2−1,n

and b0, b1, . . . , bN

2−1, respectively.

The following is our algorithm for routing an arbitrary semi-permutation P in an N × N baseline (or reverse baseline) network with node-disjoint paths in two passes.

Algorithm 4 ROUTING A SEMI-PERMUTATION IN A BASELINE OR REVERSE BASELINE NETWORK

Require: An arbitrary semi-permutation P and the characteristic strings OSk, 1 ≤ k ≤ 2n − 4, of a (2n − 2)-stage dilated Benes network.

Ensure: Routing bits r0r1. . . rn−1 and r0r1 . . . rn−1, each represented as an (N2)-bit array such that rk(j), 0 ≤ k < n and 0 ≤ j ≤ N2 − 1, represents the routing bit of input j at stage k for the first pass, and rk(j), 0 ≤ k < n and 0 ≤ j ≤ N2 − 1, represents the routing bit of input j at stage k for the second pass, where j = 2j if input 2j is in P and j = 2j + 1 if input 2j + 1 is in P.

1: use P to derive the optical windows OW0 and OW2n−3 for a (2n − 2)-stage dilated Benes network and use Algorithm 3 to find AR-bits r0r1. . . rn−3;

2: for j = 0 to N2 − 1 do

3: let yn−1yn−2· · · y0 be the n-bit binary representation of the destination of input j;

4: rn−2(j) ← yn−1;

5: rn−1(j) ← yn−2;

6: for i = 0 to n − 1 do

7: ri(j) ← yn−1−i;

8: end for

9: end for

In this algorithm, r0r1· · · rn−1 are the routing bits for the first pass (i.e., for P1), and r0r1 · · · rn−1 are the routing bits for the second pass (i.e., for P2). This algorithm uses the characteristic strings OSk, 1 ≤ k ≤ 2n − 4, of a (2n − 2)-stage dilated Benes network to find r0r1· · · rn−3. It sets rn−2 and rn−1 to the leftmost two bits of the n-bit binary representation of the destination and sets r0, r1, . . . , rn−1 to the n-bit binary representation of the destination. Note that OSk, 1 ≤ k ≤ 2n − 4, of a (2n − 2)-stage dilated Benes network can be obtained before this algorithm runs; see (1). Thus we

assume OSk, 1 ≤ k ≤ 2n − 4, are inputs, too.

We now give an example for Algorithm 4. Let P = 0 2 5 7 8 11 13 15 13 11 2 0 9 14 5 7

 be the given semi-permutation. Then Algorithm 4 obtains the following routing bits.

Do notice that the routing bits obtained by Algorithm 4 works for both a baseline and a reverse baseline network. Routing paths in a baseline network are shown in Figure 7;

those in a reverse baseline network are shown in Figure 8. It is not difficult to see that P1 = 0 2 5 7 8 11 13 15

stage 1 stage 2 stage 3 stage 0

stage 1 stage 2 stage 3 stage 0

Figure 7: (a) Routing paths in the first pass. (b) Routing paths in the second pass.

We now analyze Algorithm 4.

Theorem 8. Algorithm 4 takes O(N log2N) time and it can realize any semi-permutation with node-disjoint paths in a baseline (or reverse baseline) network in two passes.

Proof. It is not difficult to see that Algorithm 4 takes O(N log2N) time. By Lem-mas 7, it suffices to prove that: (i) r0r1· · · rn−1 are the n-bit binary representations

0

stage 1 stage 2 stage 3 stage 0

0

stage 1 stage 2 stage 3 stage 0

Figure 8: (a) Routing paths in the first pass. (b) Routing paths in the second pass.

of L0,n, L1,n, . . . , LN

2−1,n, and (ii) r0r1· · · rn−1 are the n-bit binary representations of b0, b1, . . . , bN

2−1. Statement (ii) follows from lines 3, 6, 7, 8 of Algorithm 4. Since L0,n, L1,n, . . . , LN

2−1,n are the intermediate destinations of an (n − 2)-stage dilated Benes network for P, if we set r0r1· · · rn−1 to the first n routing bits of the 2n − 2 routing bits obtained by Algorithm 3, then we have (i). By lines 1, 3, 4, 5 of Algorithm 4, r0r1· · · rn−1 are set accordingly. Thus we have (i).

相關文件