Decomposing a star graph into disjoint cycles

Decomposing a star graph into disjoint cycles

Information Processing Letters 39 (1991) 125-129 North-Holland 16 August 1991 Meijer and S. Akl Department of Computing and Information Science, Que...

580KB Sizes 6 Downloads 140 Views

Information Processing Letters 39 (1991) 125-129 North-Holland

16 August 1991

Meijer and S. Akl Department of Computing and Information Science, Queen’s University, Kingston, Ontario, Canada K7L 3N6 Communicated by F. Dehne Received 12 December 1990 Revised 15 May 1991

Abstract Qiu, K., H. Meijer and S. Akl, Decomposing 125-129. The star graph interconnecting vertex disjoint network based

a star graph into disjoint cycles, Information

Processing Letters 39 (1991)

was proposed by S.B. Akers, D. Hare], and B. Krishnamurthy as an attractive alternative to the n-cube for processors on a parallel computer. In this paper, we show that an n-star can be decomposed into (n - 2)! cycles of length (n - 1)n. These cycles may be used in designing parallel algorithms on an interconnection on the star topology.

Keywords: Parallel algorithms, decomposition,

star graphs, interconnection

networks

a Let VS,, be the set of all permutations of symbols 1, 2,. . . , n. A star graph on n symbols (or n-star), denoted by S,, = ( VS,,,ES,,), is a graph of n! nodes where each node v E VSs,,is connected to n - 1 nodes which can be obtained by interchanging the first symbol of v with the ith symbol of v, 2 < i Q n. We call these n - 1 connections dimensions. Figure 1 shows S4. For any node U = ulu2 - - u, E Vs,,, let U(i) be the ith symbol of U, i.e., U(i) = uI, and let its n - 1 neighbors be q, 1 Q i < n - i. Clearly, (U,(l)11

bibn-

Ij U (U(1))

1

3421

1423

= (1,2 ,..., n}. 23

* This work is supported by the Natural Sciences and En-

3142

gineering Research Council of Canada. OOZO-0190/91/$03.50 0 1991 - Elsevier Science Publishers B.V. All rights reserved

2143

Fig. 1. A 4-star. 125

Volume 39, Number 3

INFORMATION

PROCESSING

Further, let S,(a,++z,+, - - - a,,), 1 d i d n, be the sub-graph of S,I induced by all the nodes with the same last n - i symbols a,+ +z, +z - - - a,,. It is easy to see that S,( a,+ ,a,+2 . . * a,,) is an i-star. In particular, the nodes of S,l can be partitioned into n(n - l)-stars, S,,_,(i), 1 d i < n [2]. For example, & in Fig. 1 contains four 3-stars S,(l), S,(2), S,(3), and S,(4). Also, we use a *b to denote a permutation in Vs,, with the first and last symbols being a and b, respectively. Similarly, a * denotes a permutation with a as the first symbol and *b denotes a permutation with b as the last symbol. As a new interconnection network, S,, possesses rich structure, a small diameter, and symmetry properties, as well as many desirable fault tolerin addition, it compares ance characteristics; favorably with the n-cube in several aspects [l-3]. 11 is also known from [6,7] that Sn is Hamiltonian. In this paper, we show that S,, can be decomposed into (n - 2)! vertex disjoint cycles of length (n - 1)~. The decomposition is given in Section 2. It is demonstrated in [5] that the cycles obtained through this decomposition lead to the design of efficient algorithms for star graphs. In Section 3 we briefly describe an algorithm from [5] which uses the cycle structure of S,, to efficiently compute the Fast Fourier Transform (FFT).

sing a star graph into disjoint cycles

LetanodeT=l*n=lr,t,... t,, - it, E v;;, and a permutation d,d, - - - d,, be given, where d, = j if t, = i, i.e., d, is the position of i in T, 2 < i < n, with the leftmost position being 1 (we can see that d,, = n). We call T a starting point. mma 1. In S,,, if we start from node T and visit nodes along dimensions d, , d,, . . . , d, , d 2, d, , . . . etc. repeatedly, we get a cycle C of length ( n - 1 )n such that C n S,,- , (i) is a path containing n - 1 nodesfor

126

16 Aqust

1991

If we go to the next node along dimension d,, = n we get n *( n - 1) in which 1 is in the position dz (2’s position in T), 2 is in the position d, (3’s position in T), . . . , t? - I is in the position d,, (n’s position in T). and n is in position 1. Therefore, node n *( n - 1) can be considered as obtained by applying a transformation f, to 7’, where fT(a,a2

- - - 4,) = (7WMad

* - - da,)h

and

7r(l) = n, n(i) = i - 1, for 2
l*(n-l),...,(n-2)*(n-1)

in which all nodes end with n - 1. If we call the first n - 1 nodes path 1 and the second n - 1 nodes path 2, then path 2 is obtained by applying f, to path 1 such that the first node of path 2 is connected to the last node of path 1 through dimension n. Generally, it can be easily seen that path i = f,(path i - 1) = f,‘-‘(path 1), with all the nodes in path i ending with n + 1 - i, and the first node of path i is connected to the last node of path i - 1, i > 2. Since f,” = fT, after applying the transformation n times, node T is mapped back to itself. Therefore, we get a cycle. Since each path has n - 1 distinct nodes and each node in path i is different from any node in path j, i f j, the length of the cycle is (n - l)n, and C n Sn_ ,Ci) is a path containing n - 1 nodes for 1 < i Q n. •I With each starting point of the form T = l*n, can associate a unique permutation d,d, - - d,,_ ,d,, as defined above. We call D, = d,d, - - d,, _ ,d, the permutation associated with the starting point T= l*n. By Lemma 1, node T together with D, generate a cycle of length (n - 1)n in Sn. We denote this cycle by C( T. DT). Let C(T, DT) be {V,, Vz,..., ?&_lj,l}, where T= Vi, (V;, v+,)E&,, for l
1
. Starting from T = l*n and visiting nodes d,, d,, . . . , d,, _ 1, we get a path

and

2*n ,..., (n - l)*n.

y(n)=n-

along ~imrkm l*tI,

LETTERS

I

s

, I

(2)

Volume

39, Number

3

INFORMATION

PROCESSING

LE-MERS

Starting

i.e., the first symbols of the permutations in the cycle appear periodically as 1, 2, . . . , n - 1, n, 1, 2,... and the last symbols are fixed at n + 1 - i for the ith block of n - 1 consecutive permutations in the cycle, as illustrated in Fig. 2.

point

penmmt~on

16 August 1991 with

2 3 4.

\

t

1234

4231

mma 2. For two starting points U, and V, of the form 1*n in S,, with U, f V,, we have

C( UI, &,)

n C( V,, &,)

243 1

=fl. 3421

Proof. Let the cycle C(Ur, Dui)be { Ut, U2,. . . , U(,I-,~,l} and the cycle C(F/,, Dv,)be {V,, V2,. . . , I/;,t-lj,l}. Suppose W-4, G,)n C(h so U, = V, for some i and j. We have

&,I

+iK

Starting

point

permutation

with

3 2 4.

,Cn)=V,(n)=n-[sJ=n--Is],

(3)

1423

and u,(l)

= v,(l).

4123

(4)

Equation (4) implies that i=j

mod n.

(9

From (3) and (5) we derive that i = j. Since U = K, we have U,_,(l)= y-r(l). This fact together with (0) implies that U _, = V;_ ,. Repeating this arguStarting point

Fig. 3. Two cycles in S,.

ment, we derive that U, = V,. Since this contradicts our assumption, the lemma follows. 0 Lemmas 1 and 2, and the fact that there are (n - 2)! starting points of the form l*n in &, permutation each with a unique associated dzd3 . . . id,,_, II, imply the following theorem: Theorem 3. An n-star can be decomposed into ( n - 2)! vertex disjoint cycles of length ( n - 1)n. cl

Figure 3 shows two cycles in S4. An n-star S,, can be decomposed into n!/( n - i)( n - i + 1) disjoint cycles of length (n-i)(n-i-+-l),

Fig.

2.

A cycle in S,,.

1
Apply Theorem 3 to S,,-,+l(a,,_,+z - - - a,,) an.1 note that there are n!/( n - i + l)! such (n i+l)-starsin S,,, l
INFORMATION

Volume 39. Number 3

PROCESSING

?._EmERS

16 August 1991

ary 5. S,, can be decomposed into ( n - 1)! vertex disjoint paths of length n ( the length of a path is the number of nodes on the path ).

From Lemma 1, each cycle of length (n 1)n can be decomposed into n - 1 paths of lengt FI each; further each such path starts with a node of the form l*, and the remaining nodes on the D path are of the form 2*, 3*, . . . , n*.

3.

We now give a brief description of an algorithm for computing the FFT on S,, as given in IS]. Given a sequence of numbers x,. 1 <.j < N, its Fourier transform is the sequence

k=l

where

e2Ti/N, and

i =

f--i-. Given N= FI! = x n numbers, their Fourier transforms can be obtained by computing: 0

=

2x3x...

2 x 3 x ...

x

(I1

-

1)

Fourier transforms of 2x3~

...

FZ numbers,

Fourier transforms of ( FZ- 1) numbers,

Figure 4 illustrates the algorithm on S4. This needs 0( n”) multiply-add steps for an input sequence of length n !, and uses N = n ! processors. The cost of the algorithm, i.e., its (processor x time) product, is therefore 0( Nn’). This means that this algorithm is cost optimal with respect to the sequential algorithm on which it is based.

. Conclusion

~(m-l)~(m+1)~

-.s xn

Fourier transforms of m numbers, ...

2~4~--.xn Fourier transforms of 3 numbers, 3X4X..= Xn Using the results of Theorem 3 and its corollaries, the above computation can be mapped to S,, nicely. The ordering “ < ” of the nodes (processors) is defined as follows: ala2 - - - a,, “ < “b,b,

In this paper, we have presented a systematic way to decompose an n-star into disjoint cycles. The decomposition is simple, and is interesting in its own right. Furthermore, it can be used in designing efficient parallel algorithms on the star graph. Finally, we point out the following related result concerning star graphs: it is shown in [6] that S,, contains a cycle of length I for all even I such that 6<1
- a - 6,

if there is a k such that a, = b, for j > k, and ak > 6,. The rank of a node is the number of es that precede the node plus 1. Initially, 128

propriate coefficient. 3. Send the element to another no sion (18 - FZ1+ I).

x(n-2)xn

...

2x3x...

2.

if

The authors wish to thank the referees for their comments and suggestions that significantly improved the presentation of the paper.

Volume 39, Number 3

INFORMATION

PROCESSING

LETTERS

16 August 1991

2

3

21

24

4

1

23

22

6 16

20

14

18

8

12

17

13

11

7

15

Step 1. 4-length FFT.

9

Step 2. 3-length FFT.

1

22

5

1

19

22

6

2

20

21

6

3

20

24

5

4

19

23

3

18

12

17

16

II

10

18

15

12

9

14

15

8

9

13

16

7

10

14

Step 3. ZIength

RT.

8

Final

result.

Fig. 4. FFT on S,.

eferences

PI S.B. Akers, D. Hare1 and B. Krishnamurthy,

The star graph: An attractive alternative to the n-cube, in: Proc. Internat. Cortj: on Parallel Processing (1987) 393-400. PI S.B. Akers and B. Krishnamttrthy, The fault tolerance of star graphs, in: Proc. 2nd Internat. Con& on Supercomputing. San Francisco, 1987. [31 S.B. Akers and B. Krishnamurthy, A group theoretic model for symmetric interconnection networks, in: Proc. Internat. Conf. on Parallel Processing (1986) 216-223; Also: IEEE Trans. Comput. 38 (4) (1989) 555-566. PI S.G. Akl, The Design and Analysis of Parallel Algorithms (Prentice-Hall, Englewood Cliffs, NJ, 1989). 151 P. Fragopoulou and S.G. Ak!, A parallel algorithm for computing Fourier transforms on the star graph, in: Proc. Internat. Confi on Parallel Processing (1991), to appear.

[6] J.S. Jwo, S. Lakshmivarahan and S.K. Dhall, Embedding of cycles and grids in star graphs, in: Proc. 2nd IEEE Symp. on Parallel and Distributed Processing, Dallas, TX (1990) 540- 547. [7] M. Nigam, S. Sahni and B. Krishnamurthy, Embedding Hamiltonians and hypercubes in star interconnection graphs, in: Proc. Internat. Con/. on Parallel Processing (1990) 340-343. [8] K. Qiu, H. Meijer and S.G. Akl. Decomposing a star graph into disjoint cycles, in: Proc. 2nd Canadian Conl on Computational Geometry, Ottawa (1990) 70-73. [9] S. Zaks, A new algorithm for generation of permutations. BIT 24 (1984) 196-204.

[lo] C.N. Zhang and D.Y.Y. Yun, Multi-dimensional systolic networks for discrete Fourier transform, in: Proc. 11th Ann. Internat. Symp. on Computer Architecture, Ann Arbor, MI (1984) 215-222.

129