8
Applications of Matching and Edge-Coloring Algorithms to Routing in Clos Networks John D. Carpinelli Department of Electrical and Computer Engineering, New Jersey Institute of Technology, Newark, New Jersey 07102-1 982 A. Yavuz Oruq Electrical Engineering Department, University of Maryland, College Park, Maryland 20742 Rearrangeable Clos networks have been studied in the literature in connection with telephone switching and communication networks. This paper examines the applicability of matching and edge-coloring in bipartite graphs to the rearrangement problem in these networks. A survey of various matching and edge-coloring algorithms is given, and these algorithms are evaluated for their suitability and effectiveness. It is shown that no single matching or edge-coloring algorithm reported in the literature performs well over all Clos networks. It is further shown that the time complexity of the looping algorithm for BeneS networks is at least as good as any routing algorithm that can be obtained from matching or edge-coloring. 0 7994 John Wiley & Sons, Inc. ~ 1. INTRODUCTION One family of switching networks that has prompted much interest in telecommunications research is Clos networks [ 1, 61. A typical Clos network consists of three stages with N = m k inputs (outputs) and is shown in Figure 1. The first and last stages each consist of k m X m crossbar switches, each of which can realize any per- mutation of its m inputs onto its m outputs. The second stage has rn k X k crossbar switches, each of which can realize any permutation of its k inputs onto its k outputs. Each crossbar switch in the center stage receives one input from each crossbar switch in the first stage and sends one output to each crossbar switch in the last stage. This net- work is rearrangeable, i.e., it can realize any permutation of its inputs onto its outputs, as was shown by Slepian and Duguid (see BeneS [I]). Clos networks provide all the interconnections that a crossbar can support but at more affordable switching costs. Furthermore, recent studies indicate that the excessive crossings of interstage links in such networks can be overcome in optics [ 3, 16, 231. The focus of the present paper is the routing or setup problem in Clos networks. Routing is the process of setting the switches of a network to realize a given connection pattern between the inputs and outputs of the network. Much work has been done on routing in BeneS networks that are obtained from (N, rn, k)-Clos networks by setting m = 2 and k = Nf 2. The most well known of these is the looping algorithm [ 19, 251, which can set up each level of a BeneS network in U( N) steps, and the entire network, when recursively decomposed, in O(N log N) steps. A parallel version of the looping algorithm with U( log’ N) steps also appeared in the literature [15, 171. Routing methods have also been developed for arbitrary Clos net- works using matrix decomposition techniques [ 4, 13, 18, 221. However, it is known that matrix decomposition methods do not always work [ 41. We shall examine a third class of algorithms, namely, matching and edge-coloring in bipartite graphs in con- nection with routing in Clos networks. The relation be- tween edge-coloring and routing in the Clos network was established earlier in [ 15, 17 1. Nonetheless, these studies NETWORKS, Vol. 24 (1994) 319-326 0 1994 John Wiley & Sons, Inc. CCC 0028-3045/94/060319-08 31 9

Applications of matching and edge-coloring algorithms to routing in clos networks

Embed Size (px)

Citation preview

Page 1: Applications of matching and edge-coloring algorithms to routing in clos networks

Applications of Matching and Edge-Coloring Algorithms to Routing in Clos Networks

John D. Carpinelli

Department of Electrical and Computer Engineering, New Jersey Institute of Technology, Newark, New Jersey 071 02-1 982

A. Yavuz Oruq

Electrical Engineering Department, University of Maryland, College Park, Maryland 20742

Rearrangeable Clos networks have been studied in the literature in connection with telephone switching and communication networks. This paper examines the applicability of matching and edge-coloring in bipartite graphs to the rearrangement problem in these networks. A survey of various matching and edge-coloring algorithms is given, and these algorithms are evaluated for their suitability and effectiveness. It is shown that no single matching or edge-coloring algorithm reported in the literature performs well over all Clos networks. It is further shown that the time complexity of the looping algorithm for BeneS networks is at least as good as any routing algorithm that can be obtained from matching or edge-coloring. 0 7994 John Wiley & Sons, Inc.

~

1. INTRODUCTION

One family of switching networks that has prompted much interest in telecommunications research is Clos networks [ 1, 61. A typical Clos network consists of three stages with N = m k inputs (outputs) and is shown in Figure 1. The first and last stages each consist of k m X m crossbar switches, each of which can realize any per- mutation of its m inputs onto its m outputs. The second stage has rn k X k crossbar switches, each of which can realize any permutation of its k inputs onto its k outputs. Each crossbar switch in the center stage receives one input from each crossbar switch in the first stage and sends one output to each crossbar switch in the last stage. This net- work is rearrangeable, i.e., it can realize any permutation of its inputs onto its outputs, as was shown by Slepian and Duguid (see BeneS [ I ] ) . Clos networks provide all the interconnections that a crossbar can support but at more affordable switching costs. Furthermore, recent studies indicate that the excessive crossings of interstage links in such networks can be overcome in optics [ 3, 16, 231.

The focus of the present paper is the routing or setup problem in Clos networks. Routing is the process of setting the switches of a network to realize a given connection pattern between the inputs and outputs of the network. Much work has been done on routing in BeneS networks that are obtained from ( N , rn, k)-Clos networks by setting m = 2 and k = N f 2. The most well known of these is the looping algorithm [ 19, 251, which can set up each level of a BeneS network in U( N ) steps, and the entire network, when recursively decomposed, in O ( N log N ) steps. A parallel version of the looping algorithm with U( log’ N ) steps also appeared in the literature [15, 171. Routing methods have also been developed for arbitrary Clos net- works using matrix decomposition techniques [ 4, 13, 18, 221. However, it is known that matrix decomposition methods do not always work [ 41.

We shall examine a third class of algorithms, namely, matching and edge-coloring in bipartite graphs in con- nection with routing in Clos networks. The relation be- tween edge-coloring and routing in the Clos network was established earlier in [ 15, 17 1. Nonetheless, these studies

NETWORKS, Vol. 24 (1994) 319-326 0 1994 John Wiley & Sons, Inc. CCC 0028-3045/94/060319-08

31 9

Page 2: Applications of matching and edge-coloring algorithms to routing in clos networks

320 CARPlNELLl AND ORUC

14 I 1

2m m+l 2m

Fig. 1. Three-stage Clos network.

are not based on edge-coloring algorithms reported in graph theory literature. Rather, they capture the idea of edge-coloring in an implicit fashion. In [ 121, Hwang es- tablished that the problem of setting switches for one-to- one assignments in Clos networks is equivalent to match- ing in bipartite graphs. He then examined the complexity of routing a Clos network by considering the matching algorithm of Cole and Hopcroft [ 71. He also formulated the same routing problem as an edge-coloring problem in bipartite graphs and used the algorithm of Gabow and Kariv [ 101 to obtain a fast sequential routing algorithm for Clos networks. This paper surveys these and other matching and edge-coloring algorithms and examines their applicability to the routing problem. The concepts behind the algorithms and how they are applied to routing in Clos networks are described. The reader is referred to the relevant articles listed in the references for a more complete and formal treatment of these algorithms.

This paper further examines the impact of matching and edge-coloring algorithms on routing in Clos networks in view of potential parallelization of these algorithms that was not considered in Hwang’s work. In particular, we focus on the tradeoffs between switching cost and routing complexity of these networks. Our analysis in- dicates that no single matching or edge-coloring algorithm performs well as a routing algorithm for all Clos networks. It is further shown that the time complexity of the looping algorithm is at least as good as any routing algorithm that can be obtained from matching or edge-coloring. Finally, the paper examines the parallel versions of the edge-col- oring and matching algorithms and shows that parallelism provides a considerable reduction in the time complexities of the corresponding routing algorithms.

2. MATCHING AND EDGE-COLORING IN CLOS NETWORKS To apply matching and edge-coloring algorithms to rout- ing in Clos networks, we first need to associate the real-

ization of a permutation p on an ( N , m , k)-Clos network with a bipartite graph. This is accomplished by defining a bipartite graph G = ( X , Y , E ) , where the first set of vertices, X = { x i : 1 I i I k } , represents the first-stage switches, and the second set of vertices, Y = {yi: 1 I i I k } , represents the third-stage switches. The (input, output) assignments dictated by p are then represented by undirected edges between the vertices in X and those in Y. More precisely, if p maps an input connected to switch xl in X to an output connected to switch fi in Y , then an edge is drawn between xi and fi. Since p can map more than one input from a switch in X to a switch in Y , multiple edges between two vertices are allowed, and, hence, E is a multiset and G is a multigraph. Furthermore, since I X I = I YI = k , G has 2k vertices, and since every switch in the first (third) stage has m inputs (outputs), the degree of each vertex is m and, hence, G is a regular graph with N = mk edges regardless of the permutation it represents.

We illustrate the above ideas by an (8,4,2)-Clos network and the corresponding bipartite graph in Figure 2 for p = ( 1437)(2568), i.e., p maps 1 to 4, 4 to 3, 3 to 7, 7 to 1 , 2 to 5 , etc. Each vertex on the left represents a switch with four inputs, and each vertex on the right represents a switch with four outputs. The labels on the edges indicate the (input, output) assignments between the switches.

A. Matchings in Clos Networks A matching in a graph is a set of edges such that no two edges are incident at the same vertex. A matching is max- imal if it has the greatest possible number of edges. For a bipartite multigraph G = ( X , Y , E ) with no isolated vertices, a maximal matching contains min( 1 X 1 , I Y I) edges. For a bipartite graph corresponding to a Clos net- work, a maximal matching, therefore, contains k edges. Matchings in bipartite graphs can be used to set up a Clos network. Each maximal matching in a bipartite graph, representing a permutation, can be used to route k of the inputs to k of the outputs through a center-stage switch. For example, the maximal matching formed by the edges ( 1,4) and ( 5 , 6 ) in Figure 2( b) can be used to route input 1 to output 4 and input 5 to output 6 via one of the four center-stage switches in Figure 2 (a). Having assigned the matching { (1, 4), ( 5 , 6 ) ) to one of the center-stage switches, we can form a second matching and assign it to a second switch in the center. Repeating this process two more times, we can set up the entire network. One such set of matchings is { ((1, 4) , ( 5 , 6)} , ( (4 , 3), (6, 8 ) } ,

Matching algorithms for bipartite graphs are available in graph theory literature. One due to Hopcroft and Karp [ l 11 runs in O( k2.5) time for bipartite graphs with 2k vertices. Another matching algorithm is attributed to Dulmage and Mendelsohn by Gabow [9] and runs in

( (7 , 1 1 , (3 ,711, { ( 8 , 2 ) , ( 2 , 5 ) ) ) .

Page 3: Applications of matching and edge-coloring algorithms to routing in clos networks

ROUTING IN CLOS NETWORKS 321

O( k” ’(A’ + k) ) time for bipartite graphs with k vertices and Nedges. A third algorithm due to Cole and Hopcroft finds matchings covering the vertices with maximum de- gree in a bipartite graph and runs in O( Nlog k ) steps [ 7 1. The application of Hopcroft and Karp’s matching algo- rithm to an ( N , m , k ) Clos network leads to an O( mk2 ’)- time routing procedure, the application of Dulmage and Mendelsohn’s algorithm results in an O( mko 5 ( N + k ) ) - time routing procedure. and the application of Cole and Hopcroft’s algorithm leads to an O( mN log k)-time rout- ing procedure. Given that N = mk. it can be seen that the time complexity of the first algorithm is minimized when k = O( 1 ) and becomes O( m ) = O ( N ) . This applies to Clos networks with O( I ) switches in their outer stages, each with O( N ) inputs and outputs as in the network of Figure 2(a) . The most extreme case of this occurs when k = 2 and m = N / 2 and corresponds to what is called the complementary BeneS network [ 51. On the other hand, the time complexity of Dulmage and Mendelsohn’s al- gorithm is minimized when m = O( l ) and k = O ( N ) and becomes O(N’ ’). The algorithm due to Cole and Hopcroft also runs in a minimum order of steps when m = O( 1 ) and becomes O( N log N ) . This case applies to Clos networks with O ( N ) switches in their outer stages each with O( 1 ) inputs and outputs. The most extreme case of this occurs when k = N/2 and m = 2 and corre- sponds to the BeneS network [ 11. It can be seen that both algorithms perform worse than the well-known looping algorithm [ 19, 251 that takes O ( N ) steps.

B. Edge-coloring in Clos Networks

A graph is edge-colored when all of its edges are colored with no vertex having more than one edge of a given color incident to it. When the number of colors used is the minimum possible, the coloring is referred to as a minimal

edge-coloring. If A is the maximum degree of any vertex in a bipartite multigraph, then it is known that there exists a minimal edge-coloring for that graph that uses exactly A colors [ 21. For the multigraphs corresponding to Clos networks, every vertex has degree m ; therefore, they can be colored using only m colors. An ( N , m , k)-Clos net- work has m center-stage switches; each color corresponds to the setting of one center-stage switch. There are two primary methods used in edge-coloring : Konig’s method of alternating paths and Euler partitions. They are de- scribed in the following subsections.

Konig’s Theorem

Konig’s [ 2, 8 ] theorem states that every bipartite graph with degree A can be edge-colored using A colors. The proof of Konig’s theorem is constructive and based on a technique called the Kempe-chain argument [ 8 1 , which is also referred to as the alternating path argument. The proof leads to the following edge-coloring algorithm for bipartite graphs. Let G be a bipartite graph that is partially colored and assume that edge ( i , J ) , incident to vertices i andj, is uncolored. Since this edge is uncolored, vertices i and j are each missing at least one color. Assume that vertex i is missing color a and vertex j is missing color b. (Note that if they both miss the same color that edge can be colored by the missing color.) Color edge ( i , j ) with a . This now leaves two edges incident to vertexj with color a and none with color 6 , so change the color of the edge not between i and j from a to b. If this causes another vertex to have two edges colored b , change the color of the other edge from b to a , continuing until the coloring is valid. Notice that such a sequence of bicolored edges must form either an open chain, i.e., a path on which each vertex is visited exactly once or an elementary circuit with an even number of edges. Moreover, this path or circuit cannot have i o r j as its last vertex, since if the path

Page 4: Applications of matching and edge-coloring algorithms to routing in clos networks

322 CARPlNELLl AND ORUC

ends at vertex i, then the bipartite property of G forces i to have two edges with color a , and, similarly, if the path ends at vertex j , then j must have an edge with color b, both cases contradicting the initial coloring of edges. Thus, the path of the edge color changes or the Kempe chain will eventually find a vertex other than i and j which needs color a . Consequently, one more edge can be colored after an alternating path is constructed. This can be better un- derstood by examining the partially colored graph in Fig- ure 3. First, the edge ( xI , y , ) is chosen. Since x1 is missing color a and y1 is missing color b, an alternating path of colors a and b will be established. Edge ( xI , yl ) is colored a . Since yl now has two edges with color a , the other must be changed; edge (yl , x3) is changed from a to b. Since edge (x3, y4) is also colored b, it is changed to color a . This forces edge (y4, x 2 ) to change its color to b, and that, in turn, causes the color of edge ( x 2 , y 3 ) to change to a . Since vertex y3 does not have any other edge colored a , the alternating path is finished, giving the partial col- oring shown in Figure 4. This process can be repeated until all uncolored edges are colored. Gabow and Kariv [ 101 formalized Konig’s proof into a procedure that per- forms a complete coloring in O( I VI - IEI) time, where 1 VI is the number of vertices in the multigraph to be colored and I El is the number of edges. The space com- plexity is O( I VI + I E l ) . For Clos networks, I VI = 2k and I El = N , so the time complexity is O ( N k ) and the space complexity is O ( N ) . This algorithm is similar to Neiman’s setup procedure [ 181. Neiman’s “chaining” process is nothing more than creating a Kempe-chain or an alternating path. Neiman’s algorithm runs in O ( k 2 ) time, which is less than the O ( N k ) steps of Gabow and Kariv’s algorithm. However, Neiman’s algorithm derives a matching, not a coloring. For a complete setup, Neiman’s algorithm must be iterated N / k times; the resultant run

Yl

Y2

Y3

Y4

Fig. 3. A partially colored bipartite multigraph before aug- menting.

a Y1

Y2

Y3

Y4

Fig. 4. The bipartite multigraph of Figure 3 after augmenting.

times are asymptotically identical. We remark that both of the above algorithms perform worse than the looping algorithm when used to set up an N-input BeneS network. Each iteration of the looping algorithm takes O ( N ) steps as contrasted with O ( N k ) = O ( N * ) steps of either algo- rithm. Accordingly, the overall time complexity of the looping algorithm to set up a recursively decomposed N-input BeneS network is O ( N log N ) as compared to O ( N 2 log N ) of either algorithm. On the other hand, when used to set up a complementary BeneS network [ 5 1, both Konig’s and Neiman’s algorithms need O ( N ) steps that match the complexity of the setup procedure given in [ 5 ] .

Euler Partitions

The Euler partitioning [ 21 approach to edge-coloring uses a divide-and-conquer technique. The edges of a bipartite multigraph G = { X, Y , E } are partitioned into paths so that each vertex of odd degree is the end of one path and each vertex of even degree is the end of no paths. As we shall see subsequently, these conditions on the odd and even degree vertices provide a decomposition of G into two subgraphs whose degrees differ at most by one. A path is established as follows [ 91 : Start at a vertex of odd degree (or even, nonzero degree if no vertex has odd de- gree) and select an edge. Add it to the path, traverse the edge from the original vertex to the other vertex it is in- cident to, and remove it from G. Repeat the process until a vertex of zero degree is reached. If E # $, then repeat the entire process. This procedure results in two types of paths: open paths, i.e., paths with two endpoints, and closedpaths, i.e., paths with no endpoints. Once a bipartite multigraph is reduced to a set of paths, then the original graph is decomposed into two subgraphs GI = {X, Y , El } and G2 = { X , Y , E 2 } by traversing each path and

Page 5: Applications of matching and edge-coloring algorithms to routing in clos networks

ROUTING IN CLOS NETWORKS 323

alternately placing its edges in El or E 2 . This decompo- sition guarantees that the edges incident upon a vertex in G are split evenly among the corresponding vertices in GI and G2, unless the degree of the vertex is odd. For odd-degree vertices, the decomposition will assign one more edge to the corresponding vertex in one of the subgraphs than it does to the corresponding vertex in the other. It can be seen that the Euler decomposition virtually reduces the degree of G by half. Repeating it on the subgraphs recursively, we can ultimately reach subgraphs of degree 1. Each such graph can then be colored by one color. By patching these subgraphs together, an edge-col- oring of G can be obtained. This procedure was formalized by Gabow and Kariv [ 101 and needs O( N log m) steps for Clos networks and uses O ( N ) space. It is presented below:

PROCEDURE Euler-color( G): BEGIN 1. Let A be the maximum degree in G; 2. IF A = 1 THEN color all edges in G using a new

color ELSE BEGIN

the degree of each subgraph is at most rA/21; 3 . Form GI and G2 using an Euler partition such that

4. Euler-color( G I ); 5. Euler-color( Gz);

END; END;

This algorithm always colors a bipartite multigraph, but may not find a minimal coloring. Consider the case A = 7. Step 3 forms subgraphs GI and G?, each of which can have a degree of r A / 2 1 , 4 in this case. Even if the recursion colors these subgraphs minimally, each sub- graph has four colors. The entire multigraph is colored using eight colors, one more than the minimum. In gen- eral, this problem can occur whenever A is odd, either in the initial execution or during one of the recursions. If A is even, then r A / 2 1 = A / 2 and the problem does not exist. Gabow [ 91 presented a modified version of the previous algorithm that always determines a minimal edge coloring. If A is odd, the algorithm finds a matching of all vertices having maximum degree. The edges in this matching are colored and removed from the multigraph. This reduces the degree of the multigraph by one, and A is now even. The rest of the algorithm follows the same procedure as does the previous algorithm. The total run time of this modified algorithm is O( I V J Ellog A ) . For the bi- partite multigraph used for Clos networks, this translates to O( k”’N log m). Both Procedure Eider-color and its modified version can be used to set up Clos networks. In this case of Euler-color, we assume that N is a power of 2 so that when G is split recursively into two subgraphs

the sum of the degrees of the subgraphs is always equal to the degree of G. This guarantees a minimal edge- coloring at all levels of decomposition and, hence, results in an edge-coloring of G with exactly A = rn colors. More- over, when m = O( l ) , as in a BeneS network, the time complexity of Euler-color becomes O( N ) . which matches the time complexity of a single iteration of the looping algorithm. On the other hand, if k = O( 1 ), as in a com- plementary BeneS network, then the time complexity of Euler-color. becomes O( N log N ) . This is higher than the attainable lower bound of O( N ) steps. It can also be shown that the time complexity of the modified version of Eider- color is minimized when m = O( 1 ) and becomes O( ”-’) ~

This is higher than the O ( N ) steps of the looping algo- rithm. When k = O( 1 ) . the modified algorithm takes O( N log N ) steps, which is also higher than the attainable lower bound of 0 ( N ) .

3. EDGE-COLORING IN REGULAR BIPARTITE MULTIGRAPHS

Gabow’s algorithm can be further modified for regular bipartite multigraphs, such as those used to represent per- mutations to be routed on Clos networks. We note that Gabow’s original algorithm extracts a matching if A is odd and greater than one. This is done solely so that the subgraphs G I and G? have degree LA/2J. For a regular bipartite multigraph. this decomposition also guarantees that the two subgraphs are regular. If the two subgraphs can be made regular (even if they have different degrees), then the need to extract a matching from G can be elim- inated. This is the basis for the modifications introduced in this section. Let GI = { V , . V2 , L , } and G2 = { V , , V2 . L 2 } be the subgraphs created by Eider-color. Also, let A , be the degree of G I and let A2 be the degree of G2. If A , + A2 = A, then GI and G2 are regular, and no adjustment needs to be made. Only when A , + A2 > A is there a problem; this is the case when r A / 2 1 + r 4 2 1 > A, which was described in the previous section. When this happens, the subgraphs must be modified so that they become reg- ular. One solution to this problem is to extract a matching of all vertices of maximum degree from G2 and add them to GI when A is odd. Since every vertex in the original multigraph has degree A, all vertices of degree r A / 2 1 in G2 must have degree t A / 2 J in GI. Adding one edge in- cident to each of these vertices in GI will increase the degree of these vertices to r A/ 21. which is already the degree of the other vertices in G , . This does not change the degree of GI, but it does make GI regular. This does, however, reduce the degree of Gz to rA/21 - I , which is [ A / 2 J for odd values of A. G2 is now also regular because all vertices that originally had degree r A / 21 now have de- gree 1 A/ 2 J, and all other vertices that originally had degree

Page 6: Applications of matching and edge-coloring algorithms to routing in clos networks

324 CARPlNELLl AND ORUC

2 4

Fig. 5. Bipartite multigraph before Euler partitioning

1 1 / 2 1 are unaffected by moving edges from Gz to G , . The modified algorithm is presented below:

PROCEDURE Minimal-color( G. 4):

1 . IF A = 1 THEN color each edge in G using a new BEGIN

color ELSE BEGIN

2. Find an Euler partition P of G: Make L , and L2 empty lists; FOR each edge p E P DO BEGIN Let p be the sequence of edges e l . . . . , e,; FOR i := I to r DO IF i is odd THEN L l := Ll U el

END;

A l := the degree of GI ; A? := the degree of G2;

BEGIN Find a matching M of G,;

END; 4. Minimal-color(GI, A , )

Minimal-color( G2, 42); END:

ELSE Lz := Lz U el

3 . L e t G I : = { V I , V 2 , L 1 ) ; G z : = {VI.V2.L2);

IF A , + A? > A THEN

Gz := G‘2\,M; GI := GI U M ; A2 := 4 2 - 1;

END( Minimal-color ) :

The algorithm works as follows: Step I checks for the condition h = 1. If this condition exists, then no recursion is required, and the edges of the subgraph are colored. The statements of Step 2 derive an Euler partition. Step 3 checks the condition A , + A2 > A, which will result in a coloring that is not minimal. If this condition exists,

then a matching of all vertices of maximum degree is extracted from G2 and added to G I . This makes the subgraphs regular and reduces A2 by one, resulting in A , + = A. Finally. Step 4 implements the recursion.

To illustrate the algorithm, consider the graph shown in Figure 5 . After creating the alternating paths { (xl, !‘I 1 (YI 1 -Y2 1 (.Y? 3 1’2 1 ( V z . x3 -y3 3 YI 1 } 3 { (.x4 > Y4 )(Y4 > XI )(XI 3

J M Y ~ , x ~ ) ) . ((1.’2..~q)(-‘(4.?’3)}.and { C X ~ , Y ~ ) . , theedges are partitioned into two sets as shown in Figure 6. Since the original graph had degree 3 and each subgraph has degree 2 , 4 = 3 , A , = A? = 2, and A, + A2 > A; Step 3 must be invoked. In G2, only vertices x3 and y3 have max- imal degree. Since there is an edge that connects these two vertices, the algorithm removes this edge from GI and adds it to GI. Now both GI and Gz are regular and the algorithm recurses until done.

The time complexity is the same as that of Gabow’s original algorithm. As before, Step 1 takes O( I E l ) time, as does Step 2. The call to find a matching in Step 3 is faster than in the original algorithm because fewer vertices have maximum degree; it can easily be seen from Step 2 that, at most, 1 1’ 1 /2 vertices in G2 can have maximum degree. However, the time complexity is still O( I 1’1 I” I El ). The time complexity for one pass is O( I [ ’ I ” ’ 1 El 1: for the entire coloring, the algorithm runs in time O ( ( I.’ll”j EllogI).orO(k1”NIog m)forClosnetworks.

Although the time complexity of the modified algo- rithm is identical to that of Gabow’s original algorithm, the modified version offers several advantages: At most, I 11‘1 /2 vertices in G2 have maximum degree, as opposed to I c’ 1 vertices in G . Also, since Step 2 divides the edges among G I and Gz, I LZ 1 s I E I /2. Therefore, matching are computed faster in the modified algorithm than in the original algorithm. Finally, it is possible for Step 2 to form GI and Gz such that they both are regular. If this happens, A l + A2 = A and Step 3 does not call for a matching. The original algorithm always calls for a matching if 1 is odd: the modified algorithm can some- times avoid this.

4. DISCUSSION Table I lists the setup algorithms described in the previous sections along with their sequential and parallel time

-xty2

Fig. 6. Bipartite multigraph after Euler partitioning.

Page 7: Applications of matching and edge-coloring algorithms to routing in clos networks

ROUTING IN CLOS NETWORKS 325

TABLE 1. A list of routing procedures for Clos networks with their sequential and parallel time complexities

4lgorithm Network Sequential Time Parallel Time

Matching ( Hopcroft-Karp)

Matching (Dulmage-Mendelsohn)

Matching (Cole-Hopcroft)

Edge-coloring ( Kempe-Konig-Gabow)

Edge-colon ng ( Euler-Gabow)

Minimal Edge-coloring (Euler-Gabow-this paper)

Edge-coloring (Lev et al.)

Parallel looping (Nassimi and Sahni)

Clos Clos: m is a power of 2 BeneS; m = 2 Complementary BeneS; m = N/2

Clos Clos: rn is a power of 2 BeneS; m = 2 Complementary BeneS; m = N/2

Clos Clos (m is a power of 2) BeneS; m = 2 Complementary BeneS; m = h;12

Clos Clos. tn is a power of 2 BeneS: m = 2 Complementary BeneS; m = 1‘/2

Clos Clos; rn is a power of 2 BeneS: m = 2 Complementary BeneS; m = Y/2

Clos Clos; m is a power of 2 BeneS; m = 2 Complementary BeneS; m = N/2

Clos Clos: m is a power of 2 BeneS; m = 2 Complementary BeneS; m = N/2

Clos Clos: m is a power of 2 BeneS; m = 2 Complementary BeneS; i n = N/2

complexities. It is seen that the performance of each al- gorithm depends on the values of the parameters m and li . For example, for Clos networks, the Hopcroft-Karp algorithm performs better than the Dulmage-Mendelsohn algorithm fork 6 m and performs worse than it fork % m. The first algorithm also performs better than the minimal edge-coloring algorithm when k 4 log m and performs worse when k 9 log i n . Similar relations can also be de- rived between other pairs of algorithms. For the BeneS network. the Euler-Gabow and Lev et al. edge-coloring algorithms have the best serial run time and match the O ( N ) steps of the looping algorithm. In fact, O( N ) time is the best possible since it takes at least O ( N ) time to read in the permutation to be set up. On the other hand, the minimal edge-coloring algorithm has the worst serial run time, and in parallel time, Lev et al.’s algorithm

outperforms all other algorithms. As for the complemen- tary BeneS network, the Hopcroft-Karp matching and Kempe-Konig-Gabow edge-coloring algorithms have the best serial run times, which are also optimal. On the other hand, the Dulmage-Mendelsohn and Cole-Hopcroft matching algorithms have the worst serial run times for the same network. These observations confirm the earlier remark that no single algorithm performs well over all Clos networks.

5. CONCLUSIONS

The paper has shown that matching and edge-coloring algorithms are firmly related to the setup problem in Clos networks. Both sequential and parallel time complexities

Page 8: Applications of matching and edge-coloring algorithms to routing in clos networks

326 CARPlNELLl AND ORUC

of several matching and edge-coloring algorithms have been examined in connection with the complexity of the setup problem. The run times of these algorithms are gen- erally superior to those of matrix decomposition algo- rithms and they do not have excessive space requirements. As for further research, it will be worthwhile to investigate whether the current matching and edge-coloring algo- rithms can be further improved for bipartite graphs with an arbitrary degree and number of vertices. Apart from being valuable in its own right, such an improvement will simplify the complexity of the setup problem for arbitrary Clos networks and may settle the question of whether an O( log N) parallel setup algorithm is attainable.

REFERENCES

V. E. BeneS, Mathematical Theory of Connecting Networks and Telephone Trafic. Academic Press, New York (1965). C. Berge, Graphs and Hypergraphs. North-Holland, Am- sterdam (1973). K. Brenner and A. Huang, Optical implementations of the perfect shuffle interconnection. Appl. Opt. 27 ( 1988) 135-137.

J. Carpinelli, Interconnection networks: Improved routing methods for Clos and BeneS networks. PhD. Thesis, Rensselaer Polytechnic Institute, Troy, NY, August 1987. J. Carpinelli and A. Y. Oruc, Parallel set-up algorithms for Clos networks using a tree-connected computer. Pro- ceedings of the Second International Conference on Su- percomputing, Santa Clara ( 1987) 321-327. C. Clos, A study of non-blocking switching networks. Bell Syst. Tech. J. 32 (1953) 406-424. R. Cole and J. Hopcroft, On edge coloring bipartite graphs. SIAM J. Comput. 11 ( 1982) 540-546. S. Fiorini and R. Wilson, Edge-Colourings of Graphs. Pit- man, London (1977). H. Gabow, Using Euler partitions to edge color bipartite multigraphs. Int. J. Comput. Info. Sci. 5 ( 1976) 345- 355. H. Gabow and 0. Kariv, Algorithms for edge coloring bipartite graphs and multigraphs. SIAM J. Comput. 11 (1982) 117-129.

J. Hopcroft and R. Karp, An n5I2 algorithm for maximum matching in bipartite graphs. SIAMJ. Comput. 2 ( 1973)

F. Hwang, Control algorithms for rearrangeable Clos net- works. IEEE Trans. Commun. COM-31 (1983) 952- 954. A. Jajszczyk, A simple algorithm for the control of rear- rangeable switching networks. IEEE Trans. Commun.

W. Kautz et al., Cellular interconnection arrays. IEEE Trans. Comput. C-17 (1968) 443-451.

G . Lev, N. Pippenger, and L. Valiant, A fast parallel al- gorithm for routing in permutation networks. IEEE Trans. Comput. C-30 (1981) 93-100. S. Lin, T. Krile, and J. Walkup, Two dimensional optical Clos network and its uses. Appl. Opt. 27 (1988) 1734- 1741.

D. Nassimi and S. Sahni, Parallel algorithms to set up the BeneS permutation network. IEEE Trans. Comput. C-

V. Neiman, Structure et command optimales de reseaux de connexion sans blocage. Ann. Telecommun. 24 ( 1969)

D. Opferman and N. Tsao-Wu, On a class of rearrangeable networks. BellSyst. Tech. J . 50 (1971) 1579-1618. 0. Ore, The Four-Color Problem. Academic Press, New York (1967). D. Parker, Notes on shuffle/exchange-type switching net- works. IEEE Trans. Comput. C-29 ( 1980) 213-222. H. Ramanujam, Decomposition of permutation networks. IEEE Trans. Comput. C-22 (1973) 639-643. M. Taylor and J . Midwinter, Optically interconnected switching network. IEEE J. Lightwave Technol. 9 ( 1991 )

V. Vizing, On an estimate of the chromatic class of a p - graph. Diskret. Anal. (1964) 25-30. A. Waksman, A permutation network. J. ACM 15 ( 1968)

225-23 1.

COM-33 (1985) 169-171.

31(1982)148-154.

232-238.

79 1-798.

159-163.

Received May 1993 Accepted March 1994