Document not found! Please try again

Broadcasting and Multicasting by Shortest Path in

0 downloads 0 Views 376KB Size Report
Nov 21, 1996 - fx; yg has weight d(x; y), the distance between x and y in G. Consider ...... Transaction on Parallel and Distributed Systems, 6(2):200{204, 1995.
Laboratoire de l’Informatique du Parallélisme Ecole Normale Supérieure de Lyon Unité de recherche associée au CNRS n°1398

Broadcasting and Multicasting by Shortest Path in Cut-through Routed Networks

Johanne Cohen Pierre Fraigniaud Jean-Claude Konig Andre Raspaud

November 1996

Research Report No 96-36

Ecole Normale Supérieure de Lyon 46 Allée d’Italie, 69364 Lyon Cedex 07, France Téléphone : (+33) 72.72.80.00 Télécopieur : (+33) 72.72.80.80 Adresse électronique : [email protected]−lyon.fr

Broadcasting and Multicasting by Shortest Path in Cut-through Routed Networks

Johanne Cohen Pierre Fraigniaud Jean-Claude Konig Andre Raspaud November 1996

Abstract This paper addresses the one-to-all broadcasting problem, and the one-to-many broadcasting problem. Broadcasting is the information dissemination problem which consists, for a node of a network, to send a same piece of information to all the other nodes. Multicasting is a partial broadcasting in the sense that only a subset of nodes forms the destination set. Both problems have many applications in parallel and distributed computing. In this paper, we study these problems under both line model, and cut-through model. We present a new time optimal broadcasting and multicasting algorithm in both line model and cut-through model. We show how the behavior of this algorithm can again be improved in case of tree networks. We will also show that most of the optimization problems relative to the maximization of the eciency of broadcasting or multicasting algorithms in term of switching times or vertex load are NP-complete.

Keywords: Broadcasting, multicasting, line model, circuit-switched, cut-through model. Resume Ce papier traite des problemes de di usion et de multidi usion. La di usion a partir d'un processeur u est l'operation qui consiste a envoyer un message a tous les processeurs a partir de l'initiateur unique u. Une multidi usion est une di usion partielle : l'ensemble de destinations est une partie des noeuds du reseau. Ces types de problemes sont lies aux communications globales structurees telles que celles de nies dans la bibliotheque MPI (Message Passing Interface). Dans cet article, nous considerons deux modes de communication, le mode communications ar^etes-disjointes et le mode commutation de circuits. Nous nous concentrons uniquement sur le nombre d'etapes. Nous montrons principalement qu'il est non seulement possible de di user en dlog2 ne etapes dans le mode commutation de circuits, mais aussi que toutes les communications realisees a chaque etape de la di usion peuvent s'e ectuer sur des plus courts chemins. Ce papier traite aussi de nombreux autres parametres comme la charge des sommets, etc. Nous montrons que minimiser ces parametres sont des problemes NP-complets.

Mots-cles: Di usion, Multidi usion, mode communication ar^etes-disjointes, mode commutation de circuit.

Broadcasting and Multicasting by Shortest Path in Cut-through Routed Networks

Pierre Fraigniaudy LIP { CNRS Ecole Normale Superieure de Lyon 69364 Lyon Cedex 07, France

Johanne Cohen LIP { CNRS Ecole Normale Superieure de Lyon 69364 Lyon Cedex 07, France

Andre Raspaud LaBRI { CNRS Universite de Bordeaux 1 33405 Talence Cedex, France

Jean-Claude Konig Departement d'informatique Universite d'Evry 91025 Evry Cedex, France

November 21, 1996 Abstract This paper addresses the one-to-all broadcasting problem, and the one-to-many broadcasting problem, usually simply called broadcasting and multicasting, respectively. Broadcasting is the information dissemination problem which consists, for a node of a network, to send a same piece of information to all the other nodes. Multicasting is a partial broadcasting in the sense that only a subset of nodes forms the destination set. Both problems have many applications in parallel and distributed computing. For instance, a broadcasting procedure is included in the collective communication routines of the MPI library. Multicasting has also many applications for the control, and the programming of distributed memory parallel computers, and of networks of processors. In this paper, we study these problems under both line model, and cut-through model. The former assumes long distance calls between non neighboring processors. The latter completes the line model by taking into account the use of a routing function. Long distance calls are possible in any circuit-switched or wormhole routed machine, and in any networks supporting ATM protocol or optical facilities. It is known that one can nd time optimal broadcast and multicast protocols in the line model in polynomial time. Unfortunately, theses protocols are usually inecient from a practical point of view because they do not use the resources of the network in a balanced way. We present a new time optimal broadcasting and multicasting algorithm in both line model and cut-through model. This algorithm eciently use the bandwidth of the network. We show how the behavior of this algorithm can again be improved in case of tree networks. We will also show that most of the optimization problems relative to the maximization of the eciency of broadcasting or multicasting algorithms in term of switching times or vertex load are NP-complete.  y

Additional support by the DRET of the DGA. Additional support by the research program ANM of the CNRS

1

1 Introduction

The broadcast and multicast problem

Given any point-to-point interconnection network [27] modeled as a graph G = (V; E), broadcasting is the information dissemination problem which consists to send a same piece of information from a unique source to all the other nodes of the network. Such a communication scheme typically appears in many applications on distributed memory parallel computers [21, 22, 32, 33], and is one of the kernel of the collective communication routines of the MPI library (Message Passing Interface [8, 13]). Broadcasting is actually a particular case of multicasting in which a source node has a unique message to send to a subset of nodes. Again, multicasting has many applications for the control of parallel computers, like barrier synchronization or cache coherence. It is also a basic tool used to implement parallel data-bases [36]. Another major example of the use of a multicasting procedure is when a given user of a parallel machine can only make use of a subset of processors (a group of processor in the MPI terminology) and not of the entire machine. In this case, broadcasting a message in the user domain at the application level is actually a multicast at the system level. The broadcasting problem was intensively studied under the store-and-forward routing mode in which packets that proceed along a path in the network must be entirely stored on each intermediate node before being transmitted to the next one. The reader can consult the surveys [10, 15, 17]. The communication constraint that was mostly considered in the literature is the telephone model in which communications take place in a sequence of calls such that (i) a call involves exactly two neighboring nodes, (ii) a node can participate to at most one call at a time, and (iii) each call takes a unit of time. A round is then de ned as the set of calls performed in parallel at the same time. Although hypothesis (iii) might be not realistic since it does not take into account the length of the messages that are exchanged along the communication links, it applies for short message lengths, or when startup times are much larger than propagation times. Moreover, even if for very long messages, the linear model [22, 35] gives a good approximation of the real complexity of the communications in message passing systems. Best algorithms obtained in this model are often derived from algorithms obtained in the telephone model by pipelining messages [10].

Cut-through routed networks

In most of the modern distributed memory parallel computers, the store-and-forward routing mode has been replaced by various types of virtual cut-through routing [24] including directconnect on several Intel's machines, circuit-switching, and wormhole routing [29]. In the circuitswitched mode, when a node x sends a message to a non neighboring node y, a path is created between x and y to directly connect these two nodes. The message from x is then transmitted along this path. Intermediate processors do not receive the message that goes through them because nodes generally consist of several components: the processing unit, its local memory, and a router which is in charge of transmitting messages (see Figure 1). A router sends a message to the local memory of its node only when the message is precisely destined to its node. Wormhole routing di ers from the circuit-switched routing in message transmission. In wormhole routing, a message is splited into small units called its. The rst it is used to inform each intermediate node about the route followed by the message , and the remaining its follow in a pipeline fashion (the last it releases the intermediate connections). Wormhole routing does not require a whole path to be reserved between the source and the destination, it makes use of a number of links proportional to the length of the message. Long distance calls are also possible in any networks supporting ATM protocol [14, 31], and in any all-optical networks [1, 28]. Like any virtual cut-through routing, circuit-switched and wormhole routing are not sensitive to the path length. Indeed, the time Tx!y (L) to send a message of size L from x to y is generally modeled by + dx!y  + Lb where is the start-up time that consists of local initialization processes (hard or soft),  is the switching time of the routers, dx!y is the length of the route

2

from x to y, and b is the bandwidth of the links (see [11]). In general, we have   and  1b . Therefore, as for the store-and-forward mode, assuming Tx!y (L) = constant is a good approximation when L is not too large.

The line and cut-through models

In this paper, we are interested in the communication complexity of broadcasting and multicasting in virtual cut-through routed networks. In the following, we will make use, in particular, of the so-called line model [4] which supposes that (1) a call involves exactly two nodes (these two nodes might be at distance greater than one), (2) a node can participate to at most one call at a time, (3) each call takes a unit of time (Tx!y (L) = 1), and (4) any two paths corresponding to two simultaneous calls must be edge-disjoint. Unlike the telephone model which allows neighbor-to-neighbor communications only, the line model allows long distance calls between non neighboring processors, as it is possible in any virtual cut-through implementation. However, the line model su ers from a major drawback. Indeed, in virtual cut-through routing, the paths followed by messages are, in general, determined by a routing function. In a network modeled by a graph G = (V; E), a routing function R is a collection of local functions R = fRx : V 7! E; x 2 V g such that any message destined to node y arriving or originated in x is transmitted from x along the edge (or channel) Rx (y). (To be well de ned Rx must satisfy that Rx (y) is an incident edge of x for any y 2 V , that is Rx : V 7! Ex where Ex = f(x; y) 2 E; y 2 V g.) Two typical examples of routing functions are e-cube routing in hypercubes (messages are routed in dimension order), and XY -routing on meshes (messages are rst routed horizontally and then vertically). Note however that a lot of recent papers on multicasting in meshes (see the references in [6, 7]) make use of more tricky routing functions which o er better properties. To take into account the natural use of a routing function, we will consider the following simple additional hypothesis to the line model : (5) paths followed by messages are constructed by application of a routing function R = fRx : V 7! Ex; x 2 V g at each intermediate node. In this paper, the line model plus hypothesis 5 is called the cut-through model. Note that one may be interested in considering other types of routing functions. A typical example is when Rx : Ex  V 7! Ex, that is when the local decision depends of the input port of the message. Such type of routing functions, called input-dependent, is particularly useful in wormhole routing to take into account the several virtual channels possibly introduced to avoid deadlocks [2]. However, since deadlock avoidance is not the main interest of this paper, we will restrict our study to the simple hypothesis 5, although most of the results derived in this paper apply also for input-dependent routing functions. Many results have been also derived when hypothesis 2 is replaced by the all-ports hypothesis, that is when a node can simultaneously communicate with as many nodes as its number of ports (see for instance the references in [16, 30]). Similarly, the broadcasting and the gossiping problems have also been investigated when hypothesis 4 is replaced by a vertex-disjoint constraint [25], or by a pseudovertex-disjoint constraint [18, 19]. Unfortunately, most of these variations yield NP-complete problems when looking for time optimal broadcasting or multicasting protocols.

Farley's theorem

In the line model, most of the known results concern particular network architectures as trees [4, 26], cycles [23], meshes or tori [5, 11]. A major result which applies to any topology is due to Farley [4] who has shown that, under the line model, for any network G of n nodes, the broadcasting time from any node of G is dlog2 ne. This result will be referred as Farley's Theorem in the following. Note that this theorem is optimal since hypotheses 1 and 2 imply that the number of informed nodes can at most double at each round. Note also the strong di erence between the line model and the telephone model: under the telephone model, knowing whether

3

Input links

Router

output links

From other nodes

To other nodes

From memory

To memory

Processor + Memory

Figure 1: A node of the network the broadcasting time of an arbitrary node of an arbitrary network is less than an arbitrary constant is NP-complete [12]. Also, the diameter is not a limitative constraint for broadcasting in the line model whereas it is a lower bound for any broadcasting algorithm under the telephone model. Farley's theorem can be easily extended to the multicast problem: for any network G = (V; E), for any source node u 2 V , and for any destinations set D  V , u 2 D, the multicasting time of u in D is dlog2 jDje. As broadcasting, multicasting has been intensively studied in the past under both store-and-forward or cut-through-like models (see the references in [6]). In most of the cases, the network is xed (generally a mesh) and the in uence of the multicasting algorithm on the trac was measured by simulation. Note also that many papers dealing with multicasting make use of an additional hypothesis, called the path-based hypothesis [6] which speci es that a node is able to \read" any message traversing its router. In this paper, we will consider the line model applied to arbitrary network topologies.

Limitation of Farley's theorem

Farley's theorem does not close the discussion about the line model (for instance, papers [5, 11, 23] optimize other criteria related to the topology of the network). Indeed, in practice it is usually required that the trac generated by a broadcasting or a multicasting does not interfere with other possible trac. For instance, any broadcasting initiated by a speci c user of a multiuser parallel machine inside its own processor domain must not slow down communications of other users, especially when their respective domains are disjoint. More generally, multicastings are often initiated by system processes which must not reduce the ability of any user processes to exchange messages at their maximum rate. In other words, one requires the number of resources used to multicast or to broadcast to be minimal, or, at least, small. The dlog2 ne-time protocol of Farley's theorem is based on transmitting the message along the edge of a spanning tree, and therefore does not allow to minimize the resources used to perform a broadcast. For instance, the routes followed by the several copies of the broadcasted message can be quite long compared to the shortest paths between their sources and destinations. The length of the paths is not a major issue for cut-through routing. However, the simultaneous use of a lot of long paths implies that many links will be reserved, in spite of other possible communications. Our main goal in this paper is to gure out whether it is possible to derive optimal dlog2 ne-time broadcast protocols achieving better use of the available resources of the network. Among the several possible parameters which measure the eciency of a multicast or a broadcast protocol, we will consider: Number of links. We will be interested in minimizing the total number of communication links which are used, either at each round of the protocol, or globally during the whole protocol. The less number of links is used, the most furtive is the protocol.

4

Number of transmitters. A transmitter is a router which is explicitly used to forward a

message during a broadcast of a multicast protocol. We will be interested in minimizing the number of transmitters, again either at each round of the algorithm, or during the whole protocol. Minimizing the number of transmitters allows to potentially decrease the number of nodes which will be disturbed by the multicast protocol. Load of the transmitters. Alternatively, we will be interested in minimizing the maximum number of communication paths that a given transmitter handles simultaneously (that is the maximum number of paths, induced by a broadcasting or a multicasting, which traverse a router simultaneously). We would like to not overload intermediate routers so that they keep their ability to route other messages at their maximum speed. Of course, there is a tradeo between the number of transmitters and the load of these transmitters. Maximum path length. We will be interested in minimizing the maximum length of the paths used during a broadcast or a multicast protocol. This parameter will allow us to estimate the possible degradation of the time complexity of the protocol when the switching time of the routers cannot be neglected when a message proceed along a long path. For all these parameters, we will give algorithms minimizing their values, or we will show that the corresponding decision problem is NP-complete.

Contents and organization of the paper

In Section 2, we will present an example which clearly shows the di erence between the line model and the cut-through model. In Section 3, we will derive a new polynomial algorithm which returns, for any networks G, a time optimal multicast protocol (and, as a particular case, a time optimal broadcast protocol) in G in the line model. This protocol minimizes the total number of edges used at each round (Theorem 1). A major point is that our new algorithm also applies to the cut-through model under the simple condition that the routing function generates shortest paths only (Theorem 2), whereas all time optimal protocols derived in the literature up to now required, to be applied to the cut-through model, a routing function using the edges of a spanning tree (such a routing function cannot be used in practice since it creates a lot of contentions at the root of the tree, and the lengths of the routes could be much too large compared to the shortest paths between the sources and the destinations). Of course, there is no reason why our algorithm which minimizes the number of edges used at each round should also minimize the sum, taken over all the rounds, of the total number of edges used at every round. In fact, we will show that the decision problem corresponding to this minimization problem is NP-complete (Theorem 3). However, we will show that our algorithm is optimal up to a logarithmic factor (Theorem 4). In section 4, we will derive speci c lower and upper bounds for trees (Theorem 5). The rest of the paper (Sections 5 and 6) is dedicated to the NP-completeness of minimizing the number (Theorem 6) or the load (Theorem 7) of the transmitters, or minimizing the total switching time, i.e. the maximum length of the routing paths used to broadcast or multicast (Theorem 8). These results imply, in particular, that routers must be sophisticated enough to support simultaneous routing of many paths without degradation of their switching time. Similarly, even if it is not a major issue to minimize the length of the routes, these results show that broadcasting or multicasting messages of small size is dicult to optimize when the switching time cannot be neglected. Finally, Section 7 contains some concluding remarks.

2 Line model versus cut-through model Before starting our study, let us point out the di erence between the line model and the cutthrough model to make clear these di erent models. Let us consider the network on Figure 2. It is a double-star Sn2 = (V; E) with two centers u and v, and n ? 2 rays. First, let us show

5

(2)

(1)

(3)

(0)

u

v (7)

(6)

(4)

(5)

Figure 2: A double star of 8 vertices. how to broadcast in dlog2 ne rounds from any source of Sn2 in the line model (Farley's theorem insures that such a broadcast protocol exists). Nodes at the extremities of the rays are labeled from 1 to n ? 2, node u is labeled 0, and node v is labeled n ? 1. Note that nodes u and v play the same role. There are only two cases to be considered: either the source of the broadcasting is a center (say node 0), or it is one of the extremities of the n ? 2 rays (say node 1). In both cases, one can always proceed so that both nodes 0 and 1 are aware of the broadcasted message after one round. Now, if one consider the subgraph of the double star obtained by removing all the edges between v and the other nodes but u, we obtain a usual star of center u. On this star, the dlog2 ne ? 1 next rounds are given by: at round i, i > 1, if the node labeled k is aware of the message, then it informs the node labeled k + 2i?1. There is no edge contention, and, after round dlog2 ne, all nodes are aware of the message. Let us now consider the routing function R that routes the messages on the double star as follows: 8 < 8w 2 V; w 6= u; w 6= v; 8x 2 V; Rw (x) = u; 8x 2 V; R (x) = v; : 8x 2 V; Ru(x) = x: v Assume n = 8. It is not possible to broadcast in 3 rounds from any source in the double star of 8 vertices under the cut-through model. Indeed, to broadcast in 3 rounds, the last round would consists of 4 calls performed at the same time. Therefore, at least two of these calls would use the arc from u to v, which is impossible. (Recall that both line model and cut-through model require edge-disjoint paths.) This example shows that the cut-through model is more restrictive than the line model. In particular, it is not true that, for any network G, and for any routing function R on G, there exists a broadcast protocol from any node of G that performs in dlog2 ne rounds. However, one can state the following result: Property 1 (cut-through version of Farley's theorem). Under the cut-through model, for any network G of n nodes, there exists a routing function R such that the broadcasting time from any node of G is dlog2 ne. Proof. There exist many proofs of Farley's theorem and similar results (see [4, 9, 20, 26]). All of them use an arbitrary spanning tree of the considered network, and all the calls are performed along the edges of this spanning tree. Any spanning tree induces a routing function R since there is a unique path between any two nodes in a tree. Therefore, all paths used by the broadcast protocols derived in [4, 9, 20, 26] can be generated by a routing function.



The proof of Property 1 produces a routing function which follows the edges of a spanning tree of the network. Such a routing function induces a lot of contentions and hot-spots when

6

it is used for other communication problems. Indeed, the trac is not balanced, and the root of the tree is clearly overloaded. Moreover, though the use of shortest paths is not necessarily important in network using circuit-switched or wormhole routing, such a routing function may route messages exchanged between neighbors along a path of length twice the diameter of the network! In the next section, we will show that it is possible do much better.

3 Using the minimum number of links In this section, we will focus on the total number of links that are used by a broadcasting or a multicasting algorithm at each round, or during the whole protocol. As we saw, this parameter can be considered as a measure of the furtiveness of the protocol. Note that by total number of links used during the whole protocol, we mean the sum, over all the rounds, of the number of links used at each round. At each round of a broadcasting algorithm, nodes aware of the message are \matched" with other nodes that did not have received the message yet. Let us formalize this fact: De nition 1 Let U be a subset of vertices of a graph G = (V; E). A pseudo-matching in U is a set P of b jU2 j c pairwise edge-disjoint paths in G such that every vertex of U (but one if jU j is odd) is an extremity of a path in P .

The following result shows, in particular, that a pseudo-matching in U exists for any choice of U  V . We denote by d(x; y) the distance between two nodes x and y of a graph G. Lemma 1 Let U be a subset of vertices of a graph G = (V; E). One can group the vertices of U in pairs (x1; y1 ); (x2; y2); : : :; (xk ; yk ) where k = b jU2 j c, xi 2 U , yj 2 U , xi 6= xj , yi 6= yj , and xi 6= yj for all i; j 2 f1; : : :; kg, such that any shortest path between xi and yi is edge-disjoint P with any shortest path between xj and yj , i 6= j , and such that ki=1 d(xi ; yi) is minimum among all the possible choices of the pairs (xi ; yi); i = 1; : : :; k. Proof. Let m = jU j, and let us consider the complete graph Km of m vertices where each vertex of Km is identi ed to a vertex of U. We add weights on the edges of Km : the edge fx; yg has weight d(x; y), the distance between x and y in G. Consider a perfect matching of minimum weight in Km . This matching induces a set P of b jU2 j c shortest paths in G such that every vertex of U (but one if jU j is odd) is an extremity of a path in P . (In case of multiple shortest paths between two matched vertices, choose one arbitrarily.) We claim that the paths of P are pairwise edge-disjoint. Indeed, assume that two paths Pfx;yg and Pfx0;y0 g of P are not edge-disjoint. It means that there exist two vertices z and z 0 such that Pfx;yg = Pfx;zg [ Pfz;z0 g [ Pfz0 ;yg , and Pfx0 ;y0 g = Pfx0 ;zg [ Pf0z;z0 g [ Pfz0 ;y0 g or Pfx0;y0 g = Pfx0;z0 g [ Pf0z0 ;zg [ Pfz;y0g where Pfz;z0 g and Pf0z;z0 g have at least one edge in common. Assume without loss of generality that Pfx0 ;y0 g = Pfx0 ;zg [ Pf0z;z0 g [ Pfz0 ;y0 g . It implies that the two matching fx; yg and fx0; y0 g can be replaced by two other matching fx; x0g and fy; y0 g. The former matching has a weight of d(x; z)+d(z 0; y)+d(x0 ; z)+d(z 0; y0 )+2d(z; z 0) whereas the later has a weight of d(x; x0)+d(y; y0 ) which is less or equal than d(x; z)+d(z 0; y)+d(x0; z)+d(z 0 ; y0 ). Since d(z; z 0) 6= 0, we obtain a contradiction with the fact that the original matching is of minimum weight, and therefore the paths of P are pairwise edge-disjoint.



We can de ne the weight of a pseudo-matching P in U as the sum of the lengths of all the paths in P . We are interested in minimizing the weights of the several pseudo-matching generated at any round of a multicasting or a broadcasting algorithm. A pseudo-matching of small weight requires low use of the bandwidth to performs exchanges between the extremities of its paths. The following theorem shows that such this minimization is possible in polynomial time. It strongly improves Farley's theorem.

7

Theorem 1 For any network G = (V; E) of n nodes, and any node u of G, one can compute in polynomial time a multicast protocol from u to any set D in G, u 2 D, which performs in dlog2 jDje rounds in the line model, and such that: (i) all the calls are performed along shortest paths; (ii) at any of the dlog2 jDje rounds, the weight of the corresponding pseudo-matching is minimum.

Proof. The dlog2 jDje pseudo-matching are constructed backward. Start with U1 = D, and by Lemma 1, compute a pseudo-matching P1 in U1 of minimum weight, and containing shortest paths only. Then choose one of the two extremities of each path in P1. This choice is arbitrary but for the source u that must be selected. Keep also the unique isolated unmatched vertex in U1 if exists. All these nodes form a set U2 . Then compute a pseudo-matching P2 in U2 of

minimum weight and containing shortest paths only. Again, this is possible by Lemma 1. Then, we extract a set U3 from U2 as U2 was extracted from U1 , and repeat the process until a set Ui is reduced to u. Clearly i satis es i = dlog2 jDje. This protocol can be computed in polynomial time because one can compute a perfect matching of minimum weight in the complete graph in polynomial time [3] and, thus we can apply the construction of Lemma 1 in polynomial time.



Now, this result also holds in the cut-through model because, in the proof of Lemma 1, the way the shortest paths are selected does not matter. In particular, they can have been constructed by any shortest path routing function. Therefore, we get the following result which strongly improves Property 1: Theorem 2 For any network G = (V; E) of n nodes, any node u of G, and any shortest path routing function on G, one can compute in polynomial time a multicast protocol from u to any set D in G, u 2 D, which performs in dlog2 jDje rounds in the cut-through model, and such that, at any of the dlog2 jDje rounds, the weight of the corresponding pseudo-matching is minimum. Theorem 2 says that, whatever is the network and the routing function on this network, if this routing function routes messages along shortest paths, it will be possible to broadcast and multicast optimally in logarithmic time. Most of the routing functions used in the usual topologies (meshes, multi-dimensional tori,: : :) routes on shortest paths (XY -routing, e-cube routing,: : :). If wormhole routing is used, it is interesting to point out that there is no contradiction between the search for a deadlock free routing function, and the search for a routing function that insures optimal broadcasting. Indeed, most of the classical deadlock free routing functions generate shortest paths only. Theorems 1 and 2 both say that one can easily minimize the annoyance of each round of any multicasting algorithm, and therefore one can easily insure that the additional trac due to this process will not perturb too much other user trac. Unfortunately, it does not say that the sum of the lengths of all the paths used during the whole multicasting is minimum. The next result shows that minimizing this parameter is NP-complete.

Theorem 3 The following problem is NP-complete: Minimum-Total-Path-Length (MTPL) Instance:

A graph G = (V; E), a vertex u of G, a subset D  V , u 2 D, and an integer k.

Does there exist a multicast protocol from u to D in G performing in dlog2 jDje rounds in the line model, and such that the sum of all the lengths of all the communication paths generated by this protocol is at most k?

Question:

The proof of Theorem 3 is based on the following lemma:

Lemma 2 The following problem is NP-complete: Log-Broadcast (LogB) Instance:

A graph G = (V; E) of n vertices, and a vertex u of G.

8

Does there exist a broadcast protocol from u in G performing in at most dlog2 ne rounds in the telephone model?

Question:

Proof. It is well known that the following problem has been shown to be NP-complete by Johnson (see [34] for his proof): Broadcast

Instance: A graph G = (V; E), a vertex u of G, and an integer k. Question: Does there exist a broadcast protocol from u in G performing in at most k

rounds in the telephone model? Lemma 2 can be proved using slightly the same technic as the one used in [34] to show that the problem Broadcast is NP-complete. The only di erence is that one have to add vertices until k is equal to dlog2 ne.

 Proof of Theorem 3. MTPL is clearly in NP. MTPL is NP-complete by transformation from Problem LogB. Let G; u be an instance of the LogB problem. We transform this instance in an instance G; D; u; k of the MTPL problem by setting D = V and k = n ? 1. Clearly, if there exists a broadcast protocol from u in G performing in at most dlog2 ne rounds in the telephone model, then there exists a broadcast protocol from u in G in dlog2 ne rounds in the line model and such that the sum of all the lengths of the communication paths is at most n ? 1. Reciprocally, if there exists a broadcast protocol from u in G performing in dlog2 ne rounds in the line model, and such that the sum of all the lengths of the communication paths is at most n ? 1, then all calls are performed between neighboring vertices, and therefore there exists a broadcast protocol from u in G performing in at most dlog2 ne rounds in the telephone model. 

Theorem 3 implies that it is dicult to optimize the total edge-load of a multicasting or a broadcasting algorithm. However, one can approximate this value up to a logarithmic factor. More precisely, for any network G = (V; E), any node u 2 V , and any set D  V , u 2 D, let us denote by S(G; D; u) the minimum, taken over all the multicast protocols from u to D in G performing in dlog2 jDje rounds, of the sum of all the lengths of all the paths generated by the protocol. Theorem 3 shows that minimizing S(G; D; u) is an NP-complete problem. However, we have, in the case of the broadcasting problem: Theorem 4 Let G = (V; E) be any graph, and let u 2 V . There exists a broadcast protocol from u in G which performs in dlog2 ne rounds in the line model, and such that the total sum of all the paths generated by the algorithm is at most dlog2 neS(G; V; u). Proof. S(G; V; u)  n ? 1, because jV j ? 1 vertices must receive the message. At any round of the protocol of Theorem 1, the pseudo-matching P which is constructed forms a forest (i.e. a set of disjoint trees). Indeed, if it would not be the case, we could construct another pseudomatching P 0 with fewer edges as follows. Assume for the purpose of contradiction that there is a cycle in P , and let C = fx0; x1; : : :; xk?1g, k  3, be this cycle. C is actually composed of union of sub-paths of p paths of P . We identify particular vertices of C called doors. A door is a vertex xi of C such that (xi?1 mod k ; xi) and (xi; xi+1 mod k ) do not belong to the same path of P . Clearly the number of doors is > 1. If the number of doors is 2, then C is composed of parts of two paths P1 = fy1 ; y2; : : :; yr ; x0; x1; : : :; xs; yr+1 ; : : :; y` g and P2 = fz1; z2 ; : : :; zr0 ; xs; xs+1; : : :; x0; zr0 +1 ; : : :; z`0 g: These paths could be easily replaced by P10 = fy1 ; y2; : : :; yr ; x0; zr0 +1 ; : : :; z`0 g, and P20 = fz1 ; z2 ; : : :; zr0 ; xs; yr+1 ; : : :; y`g: This would yield a pseudo-matching of smaller weight. A contradiction.

9

If the number of doors is > 2, let P be one of the paths of P using edges of C. P = fy1; y2 ; : : :; y`g. Let i be the smallest index such that (yi ; yi+1 ) 2 C. We have yi = xj for some j, 0  j  k ? 1. xj is a door. There is another path of P , say P 0 = fz1; z2 ; : : :; zm g, such that (xj ?1 mod k ; xj ) 2 P 0. We replace the two pairs of matched vertices y1 ; y` , and z1 ; zm by z1 ; y`, and y1 ; zm . The number of edges used by the new pseudo-matching is the same, but the number of doors of C has been decreased by one. We iterate this process until the number of doors is 2, yielding a contradiction. Therefore P is a forest, and hence it uses at most n ? 1 edges. Thus our protocol generates paths of total length at most (n ? 1)dlog2 ne  S(G; V; u)dlog2 ne.



4 Broadcasting in trees In this section, we will derive upper and lower bounds on S(G; D; u) for trees. Let us start with few de nitions. Notation. Let be any non negative integer.PIfk 2k?1  < 2k , then the binary expression of is denoted by k ; : : :; 2; 1 such that = i=1 Pi 2i?1. We denote by g( ) the number of 1's in the binary representation of , that is g( ) = ki=1 i . We also de ne the function f by induction: f(0) = 0, f(1) = 1, and,   for > 1, f( ) = min f(d 2 e); f(b 2 c) + mod 2: In term of binary expression, the reader can check that for any non empty binary string M, f(M0) = f(M), f(M01) = f(M) + 1, and, for any string N = 11 : : :11 of length at least 2, f(N) = 2, and f(M0N) = f(M1) + 1. For instance, f(110011101011) = f(1100111011) + 1 = f(11001111) + 2 = f(1101) + 3 = f(11) + 4 = 6: Let T = (V; E) be a tree with n vertices. Let u be the source of a multicast of destination set D, u 2 D. We consider T as rooted in u. Any set U, u 2 U, then induces a weight function wU on the edges of T as follows. For any edge e = (x; y) 2 E, the removing of e from T decomposes T is two trees Tx and Ty . We denote by Te the tree which does not contain u. We de ne wU (e) = jTe \ U j. We have the following result: Theorem 5 In any tree T = (V; E), there exists a multicast protocol from its root u to any subsetPD of vertices, u 2 D, which performs in dlog2 jDje rounds in the line model, and such P that e2E f(wD (e))  S(T; D; u)  2 e2E g(wD (e)). Proof. As we already did all along this paper, we will consider the dual problem of multicasting, that is the accumulation problem (reversing the communication scheme for accumulation results in a communication scheme for multicasting). In the accumulation problem, each node of D has some piece of information which must be collected by u. An accumulation algorithm will be described by a sequence U0 ; U1; : : :; Udlog2 jDje of subsets of nodes with U0 = D, Udlog2 jDje = u, and Ut+1  Ut . For 0  t  dlog2 jDje, Ut actually denotes a sets of nodes such that the union of all the pieces of information known by them at round t is exactly the union of all the pieces of information originally known by the vertices of D. The set Ut+1 is constructed by using the information of Ut only. Ut is called the active set at time t. A vertex belonging to an active set is called an active node. In the considered tree, given a set U of active vertices, an edge e is said to be even relatively to U if the removal of this edge decomposes the tree in two subtrees, each rooted at one extremity of e, which have both an even number of active vertices of U. The edge e is said to be odd relatively to U otherwise. Upper bound. Let us introduce another notation: given two vertices x and y of the tree, we denote by st (x; y) the number of the zero second rightmost (penultimate) bits of the binary

10

expression of the weights wUt (e) of the edges e on the shortest path from x to y in T. In other words, if they are q edges on the shortest path from x to yPin T, and if the weights of these q edges are denoted by w(1); : : :; w(q) , then st (x; y) = q ? qi=1 w2(i) . Finally, for the sake of simplicity, let us rst assume that D = 2k . Our accumulation algorithm proceeds as in the proof of Theorem 1 by a successive construction of pseudo-matchings of the active sets Ut , t = 0; : : :; dlog2 jDje. The only thing that we have to specify carefully is the way to choose which extremity of each path of the pseudo-matching we keep for the next round. More precisely, round t of our algorithm can be decomposed in two phases: 1. Construct a pseudo-matching in Ut using only odd edges relatively to Ut . 2. For each pair of vertices x and y matched in the pseudo-matching in Ut , let z be the rst common ancestor of x and y. If st (z; x) = st (z; y), then choose the vertex which is the closest to the root u, and put it in the set Ut+1 (choose arbitrarily any of these two vertices if d(x; u) = d(y; u)). If st (z; x) < st (z; y) then put x in Ut+1 , and if st (z; x) > st (z; y) then put y in Ut+1 . We refer the reader to [20, 26] to gure out how phase 1 can be performed in polynomial time. Let us show that this dlog2 jDje-time algorithm satis es that the sum P over its dlog2 jDje rounds of the number of edges used at each round is upper bounded by 2 e2E g(wD (e)). For this purpose, let us prove the following: Claim 1. If there are odd edges before the round t (that is relatively to Ut ), then there are at most + =2 odd edges after round t (that is relatively to Ut+1 ), where is the sum of the penultimate bits of the weights wUt (e) of all the edges e 2 E. Indeed, since jDj = 2k , the number of active nodes is divided by 2 after each round. Clearly, for any even edge e at round t, wUt+1 (e) = wU2t (e) , and its parity at round t + 1 depends on the penultimate bit of wUt (e): an even edge turns odd if the penultimate bit of its previous weight was a 1. The case of odd edges is more complicated. Any odd edge e relatively to Ut will be used during round t, say for a communication between x and y. Let z be the rst common ancestor of x and y, let wUt (e) = 2k +1, and let us consider the several possibility for the choice of the node v 2 fx; yg put in Ut+1 . { If v 2 V n Te , then wUt+1 (e) = k, and, hence, e stays odd if and only if the penultimate bit of its previous weight was a 1. This case is therefore taken into account in the term of Claim 1. { If v 2 Te , then wUt+1 (e) = k + 1, and, hence, e stays odd if and only if the penultimate bit of its previous weight was a 0. Since v minimizes the number of zeros at the penultimate position of the weights of the edges between x, y and their common ancestor z, this case is therefore taken into account in the term =2 of Claim 1. Therefore, as claimed, if there are odd edges before the round t, then there are at most + =2 odd edges after round t, where is the sum of the penultimate bits of the weight wUt (e) of all the edges P e 2 E. Now, let (wD (e))i be the ith bit of the binary representation of wD (e), and let Si = e2E (wD (e))i , for 1  i  dlog2 ne. By de nition, we have X e2E

g(wD (e)) =

dlog 2 ne X i=1

Si

(1)

At the rst round, at most S1 edges are used since there are only S1 odd edges. Following Claim 1, at most S2 + S1 =2 edges are used at the second round. More generally, we have: Claim 2. At any round t, 1  t  dlog2 jDje, at most Pti=1 2St?i i edges are used in the pseudomatching. We prove this claim using Claim 1 in showing that the sum of the penultimate bits of the weights wUt (e) of all the edges e 2 E is equal to St . Indeed, we have seen that if wUt (e) is even, then wUt+1 (e) = wU2t (e) , and therefore the most signi cant bits of wD (e) are not modi ed. If wUt (e) = 2k + 1, two cases can be considered: wUt+1 (e) = k or wUt+1 (e) = k + 1. In the

11

former case, the most signi cant bits of wD (e) are not modi ed. The latter case occurs only when the penultimate bits of wUt (e) is a 0, and therefore the most signi cant bits of wD (e) are not modi ed. This shows that the sum of the penultimate bits of the weights wUt (e) of all the edges e 2 E is equal to St . Now, it is easy to check, that dlogX t 2 jDje X

that is, using Equation 1,

2 jDje Si  2 dlogX Si ; t?i t=1 i=1 2 i=1

dlogX t 2 jDje X

Si  2 X g(w (e)): D t?i t=1 i=1 2 e2E This completes the poof of the upper bound when jDj = 2k . If jDj is not a power of two, say jDj = 2k ? a where 0 < a < 2k , one can consider multicasting in a tree T 0 of n + a vertices consisting in T plus a \new" vertices directly connected to the root u, and forming a stable set S. Let D0 = D [ S. D0 has a power of two vertices. One can apply the previously described algorithm to T 0 and D0 , so that a vertex of S communicates either with another vertex in S, or with u. Let us call A0 this algorithm. Thus, if one does not consider communications involving vertices in S, A0 induces an algorithm A which accumulates the information of D in the root u of the tree T. Note that u is the only possible idle vertex of any active set during the execution of A. Let us denote by SA (respectively SA0 ) the global sum of the lengths of the paths P generated by the execution of A (respectively A0). Since jD0 j is 0 a power of 2, we have SA  2 e2E (T 0 ) g(wD0 (e)). Actually, we can strength a bit this upper P ^ 1;a; K1;a ; u) where K1;a is the star of a + 1 vertices bound: SA0  2 e2E (T ) g(wD0 (e)) + S(K rooted in u, and the function S^ is de ned as S excepted that the minimization is taken over all the multicast protocols in which the only possible unmatched active vertex is the source of ^ 1;a ; K1;a; u). Therefore S(T; D; u)  2 Pe2E (T ) g(wD0 (e). the multicast. Now, SA  SA0 ? S(K P Finally, since g(wD0 (e)) = g(wD (e)), we get S(T; D; u)  2 e2E (T ) g(wD (e)) which concludes the proof of the upper bound. Lower bound. Assume rst that D = 2k . We prove by induction on k, that any edge e is used at most f(wD (e)) times during any multicasting protocol from u to D. This result clearly holds for k = 0. Let k > 0, and assume that any edge e is used at most f(w(e)) times during any multicasting protocol from u to any set D such that jDj = 2i, 0  i < k. At any round of any multicast algorithm performing in an optimal number of rounds, all the active nodes take part of the communications, and, as proved in [20, 26], only the odd edges can be used in the pseudo-matching. Let D0 be the set of active nodes after the rst round of an arbitrary accumulation algorithm. jD0 j = 2k?1. { If the edge e is even before the rst round, then no call made use this edge, and the weight of e is simply divided by 2. By induction hypothesis, the edge e will be used at least f(wD0 (e)) times during any multicast algorithm, that is at least f(wD (e)) times by de nition of f since wD (e) is even. { If the edge e is odd before the rst round, then a call between two vertices makes use of this edge at the rst round of any accumulation algorithm. According to the choice of the active node for the next round, the weight of edge e will be equal to dwD (e)=2e or bwD (e)=2c. Therefore the edge e is used at least 1 + min(f(dwD (e)=2e); f(bwD (e)=2c)), that is at least f((wD (e)) by de nition of the function f. The case where jDj is not a power of 2 can be solved using the same argument as in the proof of the upper bound. This concludes the proof.



Although we think that the two bounds of Theorem 5 di er in average by a small factor (possibly a constant), we did not succeed to prove this fact. There are trees for which the two

12

bounds di er by more than a constant. However, in many examples like the path, the star, the complete binary tree, and the binomial tree, these two bounds di er by at most a factor of 3. Also, the expected value of the ratio 2fg(( )) when is uniformly randomly chosen is bounded by a constant.

5 Number and load of the routers In this section, we address the ability of a multicasting algorithm not to disturb other applications by traversing nodes which are not directly concerned by the multicasted message. Moreover, we also study the load of the routers during a multicasting or a broadcasting algorithm. Indeed, a router is usually able to route any permutation of its input channels on its output channels. However, the output channel allocation process is sequential in general, and thus could be time consuming when many messages traverse a same router. Therefore, it could be an issue to minimize the load of the routers.

5.1 Number of routers

We show below that minimizing the number of routers involved in a time optimal multicast algorithm is an NP-complete problem. De nition 2 Let P be a pseudo-matching in a subset U of vertices of a graph G. A transmitter is a vertex of G which is traversed by a path of P . The following theorem shows that minimizing the number transmitters at any round of a broadcasting or multicasting algorithm is dicult.

Theorem 6 The following problem is NP-complete:

Minimum-Number-Of-Transmitters (MNOT)

Instance: Question:

A graph G = (V; E), a subset U  V of vertices, and an integer k. Does there exist a pseudo-matching in U which has at most k transmitters?

Proof. MNOT is clearly in NP. MNOT is NP-complete by transformation from 3SAT. Let C = fc1; c2; : : :; cm g be an instance of 3SAT (where each clause ci has exactly three literals ci[1]; ci[2], and ci [3]) on the boolean variables B = fb1; b2; : : :; bng. We construct an instance of MNOT as follows. We associate two copies of K3 to each clause ci of C. In each K3 , there is a vertex for each literal. They are denoted by ci;1; ci;2, and ci;3 . We also associate one copy of K2;2 to each boolean variable bi in B: the rst partition is composed of two vertices denoted bi and bi, and the second partition is composed of two vertices denoted xi and yi . We connect the literals of each clause to the corresponding boolean vertices as follows (see Figure 3): if ci[`] = bj (resp. ci [`] = bj ) then add an edge between the two vertices of the form ci;j and the vertex bj (resp. bj ). We obtain a graph G with 6m+4n vertices. Let U be the subset of vertices composed of the 6m vertices of the complete graphs K3 , plus the 2n vertices xi; yi , i = 1; : : :; n. Set k = n (note that there are at least n transmitters in any pseudo-matching in U because of the vertices xi and yi in each K2;2). We claim that C is satis able if and only if there exists a pseudo-matching in U with at most n transmitters (i.e. with exactly n transmitters). Assume C is satis able. We construct a pseudo-matching in U with exactly n transmitters as follows. For i = 1; : : :; n, connect xi to yi with a path traversing the vertex bi if the solution provides bi = true, or traversing the vertex bi if the solution provides bi = false. For i = 1; : : :; m, at least one of the 3 literals in ci is true. Choose such a true literal ci [j], and connect the two vertices ci;j by a path traversing the vertex ci [j]. Then, in each copy of K3 corresponding to ci, connect the two vertices ci;j 0 and ci;j 0 , j 0 6= j 6= j 00, by a path of length 1. We get a pseudomatching in U with exactly n transmitters. Conversely, assume the exists a pseudo-matching in U with exactly n transmitters. Due to the structure of U and G, there is a transmitter in each copy of K2;2. These transmitters induce 13

x j

y j

x

j’

y j’

x

j’’

y j’’

b

bj

b j’

b j’

b j’’

bj’’

j

c

c

i,1

c

i, 3

c

c

i, 2

i,3

i,1

c

i, 2

Figure 3: Construction in the proof of Theorem 6. The clause ci satis es ci [1] = bj , ci[2] = bj 00 , and ci [3] = bj 0 . a assignation bi = true or bi = false for all the boolean variables bi ; i = 1; : : :; n. In each K3 , one vertex must be connected by a path of length at least 2 to a vertex of another K3 . This path traverses one of the transmitters. Therefore there is at least a true literal in each clause, and C is satis able.

 Remark. From the proof of Theorem 5, one can check that the problem MNOT is solvable in

polynomial time for trees (indeed, in the terminology of this proof, only odd edges take part of the pseudo-matching, and, therefore, one can check in polynomial time whether a vertex is or is not a transmitter according to the number of its incident odd edges). The following result shows that minimizing the number of involved router is not only dicult when one considers a single round, but also when one considers the whole protocol.

Property 2 The following problem is NP-complete: Minimum-Number-of-Routers (MNOR)

A graph G, a vertex u of G, and an integer k. Does there exist a time optimal broadcast protocol from u in the line model which involves at most k routers during its whole execution?

Instance: Question:

Proof. The problem MNOR with k = 0 is equivalent to the NP-complete problem LogB. Indeed, if there exists a dlog2 ne-time broadcasting algorithm B such that no vertex is a transmitter, then all the communications are neighbor-to-neighbor, and therefore only use one edge. So the algorithm B satis es the telephone model constraints. Conversely, if B is a dlog2 ne-time broadcasting algorithm in the telephone model, then the corresponding number of transmitters is reduced to zero.



5.2 Matching index, and load of the routers

Let P be a pseudo-matching of a subset of vertices U of a graph G. Let us de ne the load of a given transmitter x to be the number of paths which are traversing x (x is not an end vertex). This parameter is denoted by (U; P ; x). The load of the pseudo-matching P in U is denoted by (U; P ), and is de ned by (U; P ) = maxx (U; P ; x). De nition 3 The matching index of subset of vertices U of a graph G = (V; E) is the minimum, taken over all the pseudo matching P in U of (U; P ). It is denoted by (U). The matching index of a graph G is (V ). When the minimization is restricted to pseudo-matching containing shortest paths only, this parameter is denoted by m (U)

14

Clearly, if one wants to minimize the load of the routers, one will try to nd the pseudo matching P for which (U; P ) = (U) at each round of the multicast or the broadcast algorithm. Unfortunately, we get the following result:

Theorem 7 The following problem is NP-complete:

Matching-Index-of-Shortest-Paths (MISP) Instance: Question:

A graph G = (V; E), a vertex u of G, a subset U  V , and an integer k. m (U; P )  k?

Proof. Clearly, MISP 2 NP because one can check in polynomial time that a pseudo matching P in U contains shortest path only, and satis es (U; P )  k. To show that MISP is NP-complete, let consider the following problem: Matching-Index-of-Shortest-Path(1) (MISP(1))

Instance: A graph G, a vertex u of G a subset U  V . Question: m(U; P )  1?

Let us prove that MISP(1) is NP-complete by transformation from the Vertex Cover problem: Vertex Cover (VC)

Instance: A graph G = (V; E), and a positive integer b. Question: Is there a vertex cover of size b or less, i.e, a subset S  V such that jSj  b and, for each edge (u; v) 2 E, at least one of u and v belongs to S?

Let an arbitrary instance of VC be given by the graph G = (V; E), and the positive integer b. We construct a graph G0 = (V 0; E 0), and a subset of vertices U such that, in the graph G0, the subset U satis es m (U)  1 if and only if G has a vertex cover of size b or less. The graph G0 consists of 2b paths Pi , i = 1; : : :; 2b, of three vertices (xi; yi ; zi ) plus other vertices. Connections between these other vertices are functions of the connections of the vertices of G: each edge e of G corresponds to a subgraph Ge = (Ve ; Ee) of G0 . Such a subgraph is called the gadget of e. The gadget of an edge e = (u; v) 2 E is illustrated on Figure 4. It is composed of 44 vertices. Only 20 of them are explicitly drawn on Figure 4. The 24 others are virtually presented in the form of dotted lines: each dotted line C = c1 ? c2 represents a cross of ve vertices. The ve vertices at the top (resp. bottom) of the gadget of edge e = (u; v) as drawn on Figure 4 are denoted by (e; ui), i = 1; : : :; 5 (resp. (e; vi ), i = 1; : : :; 5). We also identify two particular vertices denoted by e(1) and e(2) on Figure 4. For each vertex v 2 V , let e1 ; :::; ed be its incident edges (d is the degree of v). For i = 1; : : :; d ? 1, the gadget of the edge ei is joined to the gadget of edge ei+1 by an edge ((ei ; v5 ); (ei+1; v1 )) (see Figure 5). All these connections form a path Qv = f(e1; v1 ); (e1; v2) : : :; (e1; v5 ); (e2; v1); : : :; (e2 ; v5); : : :; (ed ; v1 ); : : :; (ed ; v5)g: Finally, the rst and last vertices of Qv , (e1 ; v1) and (ed ; v5) are connected to vertices y1 ; :::; y2b by a complete bipartite graph K2;2b (see Figure 5). The set U is then de ned by

f(e; u1); (e; u5); (e; v1); (e; v5); e(1) ; e(2); e 2 E g[fc3; c5 ; for each cross C g[fxi; yi ; zi; i = 1; : : :; 2bg: All these nodes are marked in grey on Figures 4 and 5. Of course, G0 and U can be constructed in polynomial time from G and b. Let us list some simple properties which are satis ed by the gadget of an edge e = (u; v). For any shortest path pseudo-matching P in U satisfying (U; P )  1, we have the following properties: 1. In any cross C, vertices c3 and c5 must be connected together, otherwise (U; P ; c4) > 1. Moreover, no other matching can pass through cross C otherwise the load of c4 would be increased.

15

(e,u 1)

(e,u 2)

(e,u 3)

(e,u 4)

e1

(e,v1 )

c1

e2

(e,v 2)

C

(e,u 5)

(e,v ) (e,v ) 5 4

(e,v ) 3

c

2

=

c1

c

c3 c

4

c

2

5

Figure 4: The gadget of an edge e = (u; v ) used in the proof of the Theorem 7 (doted lines represent a cross of ve vertices). Vertices in U are marked in grey. 2. Vertices e(1) , and e(2) must be connected together. Indeed, connecting e(1) by a shortest path to any node of U distinct from e(2) requires to pass through a cross C, and we have seen that this is not possible. 3. Vertex (e; u1) can only be connected to vertex (e; u5) or to a vertex which does not belong to the same gadget, otherwise the matching would require to pass through a cross C. 4. If vertex (e; u1 ) is matched to vertex (e; u5), then vertex (e; v1) is not matched to vertex (e; v5), otherwise the load of (e; u3 ) or (e; v3) would be greater than 1 because of the matching e(1) ? (2). In other words, at least two of the four vertices of the form (e; u1 ), (e; u5), (e; v1 ) or (e; v5 ) must be matched to vertices which do not belong to the same gadget. Now, let us show that there exists a shortest path pseudo-matching in U of maximum load 1 if and only if G has a vertex cover of size b or less. (. Suppose that there exists a shortest path pseudo-matching P in U such that (U; P )  1. From properties 1 to 4 stated before, we already know how matchings involving nodes inside a gadget look like. For each path Pi , only one vertex of Pi can be matched to a vertex not in Pi otherwise the load of yi would be strictly greater than 1. For the same reason, no path connecting two vertices not belonging to Pi can pass through the vertex yi . Without loss of generality, we can assume that vertex yi is the vertex which must be matched to a vertex not in the path Pi . Let u be a vertex of G, and let e1 ; e2; : : :; ed be its incident edges. If the vertex (e1 ; u1) is matched to a vertex yi , then, from Property 3, vertex (e1 ; u5) will be matched to vertex (e2 ; u1). Then (e2 ; u5) will be matched to (e3 ; u1), and so on until vertex (ed ; u5) is matched to some vertex yj . Let S be the set of vertices of G such that u 2 S if and only if (e1 ; u1) and (ed ; u5) are both matched to vertices of type yi , i 2 f1; : : :; 2bg, in the pseudo-matching de ned above. Note that jS j  b. Assume that S is not a vertex cover of G. Then let e be an edge of G such that none of its two endpoints belong to S. From Property 4, at least two vertices of the gadget corresponding to

16

a e

G=

e

1

b

(e ,a ) 1 1

(e ,b ) 1 1

e 2 c

e

(e ,a ) 1 5

3 d

4

(e ,a ) 2 1

(e ,a ) 2 5

(e ,c ) 2 1

(e ,b ) 1 5

(e ,a ) 3 1

(e ,c ) 2 5

(e , d ) 3 1

(e ,a ) 5

(e , d ) 5

(e , d ) 5 4

(e ,c ) 4 1

G ’= (e ,c ) 4 5

(e , d ) 1 4 z

x

y

1 y

1

x z

2

2

2

1

Figure 5: Example of the construction of the proof of Theorem 7 when b = 1. The diamonds are symbol of the gadget of the edges drawn on Figure 4. e must be connected to a vertex not in this gadget. Let u be an extremity of e such that (e; u1) and (e; u5) are both matched to vertices not in the gadget of e. Vertex (e; u5 ) is matched to a vertex (e0 ; u1), vertex (e0 ; u5) is matched to a vertex (e00 ; u1), and so on. Finally, if the degree of u is d, and if e1 ; e2; : : :; ed denote the d incident edges of u, then vertex (ed?1 ; u5) is matched to vertex (ed ; u1) of path Qu, and vertex (ed ; u5) must be matched to a vertex belonging to fyi ; i = 1; :::; 2bg. For the same reason, (e1 ; 1) must be matched to a vertex belonging to fyi ; i = 1; : : :; 2bg. Thus u 2 S, contradiction. Therefore, S is a vertex cover of G size b or less. ). Conversely, suppose that S  V is a vertex cover of G of size b or less. If jS j < b, then we can add some vertices to S in order to obtain a vertex cover S 0 of exactly b vertices. So, we can assume without loss of generality that jS j = b. For any vertex s of G, let d be its degree, and e1 ; e2 ; : : :; ed be its d incident edges. Vertices of S are labeled from 1 to b. We construct the pseudo-matching P in U as follows:  if s 2 S, then let i be its label in S, y2i is matched to (e1 ; s1 ), (e1 ; s5 ) is matched to (e2 ; s1 ), : : :, (ed ; s5 ) is matched to y2i+1 ;

17

 if s 2= S, then for any i 2 f1; : : :; dg, vertex (ei ; s1 ) is matched to (ei ; s5), and the path

(2) from e(1) i to ei passes through the vertex (ei ; v3) where ei = (s; v). One can check that this pseudo-matching P is such that the (U; P )  1, and that all paths in P are shortest paths.



Theorem 7 shows that it is dicult to minimize the load of the routers at each round. Unfortunately, this is also true for the whole protocol. Given a graph G, and a vertex u of G, we denote by M(G; u) the minimum, taken over all the broadcast protocols B from u in G which perform in dlog2 ne rounds in the line model, of maxi=1;:::;dlog2 ne (Ui ; Pi) where Pi is the set of paths corresponding to the pseudo-matching in Ui generated at round i by the broadcasting algorithm B. We have:

Property 3 The following problem is NP-complete: Minimum Broadcast Load (MBL) Instance: Question:

A graph G, a vertex u of G, and an integer k. M(G; u)  k?

Proof. If there exists a broadcasting algorithm B such that M(G; u) = 0, then, no vertex is a transmitter at any round. So, algorithm B is a broadcasting algorithm from u in dlog2 ne rounds in telephone model. Clearly, the reciprocal holds. Therefore, the problem MBL with k = 0 is equivalent to the NP-complete problem LogB.



6 Global switching time In this section, we focus on the switching times induced by long paths between two vertices. Given a pseudo-matching P of a subset U of vertices of a graph G, we denote by L(U; P ) the maximum length of the paths of P . Let L(U) = minP L(U; P ), where P is a pseudo-matching of U. If the switching time of the routers cannot be neglected, L(U) is an important parameter to minimize at each round of a multicast algorithm. Unfortunately, we have:

Theorem 8 The following problem is NP-complete:

Maximum-Length-of-a-Pseudo-Matching (MLPM) Instance: Question:

A graph G = (V; E), a vertex u of G, a subset U  V , and an integer k. L(U)  k?

Proof. MLPM is clearly in NP. To prove that it is NP-complete, we transform the Vertex Cover problem to MLPM with k = 5. Let an arbitrary instance of VC be given by a graph G = (V; E), and a positive integer b. We construct an instance of MLPM, that is a graph G0 = (V 0 ; E 0) and a subset U of vertices of G0 such that U has a pseudo-matching P satisfying L(U; P ))  5 if and only if G has a vertex cover of size b or less. The construction of G0 is quite similar to the one of the proof of Theorem 7. The only di erences are: 1. each of the 2b paths Pi of length 3 is transformed into a single vertex yi , i = 1; : : :; 2b; 2. the gadgets of the edges of G are as shown on Figure 6; 3. each bipartite graph K2;2b connecting the two endpoints of a path Qu to the vertices yi , i = 1; : : :; 2b, is slightly transformed by replacing each edge by a path of length 5. The set U is de ned exactly as in the proof of Theorem 7. The reader can check that the gadgets presently de ned have the same properties as the gadgets de ned in the proof of Theorem 7. In fact, the remainder of the proof is identical to the proof of Theorem 7. 

Concerning the whole protocol, we have a similar bad news for both the maximumlength and the sum of the maximumlength of the paths. Given a graph G and a vertex u of G, we denote by

18

(e,u 1)

(e,u ) 2

(e,u ) (e,u ) 4 3

e1

(e,v ) 1

(e,u ) 5

(e,u ) 6

e2

(e,v ) 2

(e,v3)

(e,v ) (e,v ) 4 5

(e,v ) 6

Figure 6: The gadget of edge e = (u; v ) used in the proof of the Theorem 7. Vertices in U are marked in grey. Lsum (G; u) the minimum, taken over all the broadcast protocols B from u performing in dlog2 ne rounds in the line model, of the sum of all the maximum length of the dP log2 ne pseudo-matching 2 ne in U generated by this protocol. More formally: Lsum (G; u) = minB dlog i=1 L(Ui ; Pi) where Pi is the pseudo matching of round i of B , i = 1; : : :; dlog2 ne.

Property 4 The following problem is NP-complete: Sum-Max

Instance: Question:

A graph G, a vertex u of G, and an integer k. Lsum (G; u)  k?

Proof. If there exists a broadcasting algorithm B such that Lsum (G; u)  dlog2 ne, then every calls satisfy the telephone model constraints. Thus algorithm B is a broadcasting algorithm from u in dlog2 ne rounds in telephone model. The reciprocal clearly holds. So the Sum-Max problem with k = dlog2 ne is equivalent to the NP-complete problem LogB.  Given a graph G and a vertex u of G, we denote by Lmax (G; u) the minimum, taken over all the broadcast protocols B from u performing in dlog2 ne rounds in the line model, of the maximum length of all the paths generated at each round in the dlog2 ne pseudo-matching generated by this protocol. More formally: Lmax (G; u) = minB maxi=1:::dlog2 ne L(Ui ; Pi) where Pi is the pseudo matching of Ui at round i of B , i = 1; : : :; dlog2 ne. Property 5 The following problem is NP-complete: Max-Max

Instance: Question:

A graph G, a vertex u of G, and an integer k. Lmax (G; u)  k?

Proof. Similar to Property 4: the Max-Max problem with k = 1 is equivalent to the NPcomplete problem LogB.



7 Conclusion and open problems Table 1 summarizes the complexities of the minimization problems related to the multicast and the broadcast problems. Even if the situation seems \despairing" at the rst glance (most of the

19

problems are NP-complete), the reader must keep in mind that the main parameter to optimize in cut-through networks is the use of the bandwidth, that is the rst property that must satisfy a communication protocol in this model is to be free of link contention. From these points of view, we have provided important results: 1. It is possible to multicast or broadcast in an optimal number of rounds, such that all calls are performed on shortest paths, and the sum of the paths lengths at any round is minimum. In other words, such that the total bandwidth required at each round is minimum. 2. Even if minimizing the use of the bandwidth for the whole protocol is NP-complete, we have described a protocol which reaches the lower bound up to a logarithmic factor. The minimization of many second order parameters as the number of transmitters or theirs load, the maximum length of the paths or the sum of the maximum paths used at each round of the multicast or a broadcast protocol yield NP-complete problems. Since these problems might be not so critical for cut-through routing, we did not try to derive approximated solutions. However, if minimizing these parameters turn to be a major issue for some speci c reasons, such algorithms should be given. Broadcasting/multicasting Pseudo-matching Sum of the paths lengths NP-complete (Theorem 3) P (Theorem 1) Number of transmitters NP-complete (Property 2) NP-complete (Theorem 6) Load of the transmitters NP-complete (Property 3) NP-complete (Theorem 7) Maximum path length NP-complete (Property 4) NP-complete (Theorem 8) Sum of the maximum paths lengths NP-complete (Property 5)

Table 1: Complexities of minimization problems related to the pseudo-matching problem, and to the broadcast and multicast problems Other problems seem to be more important to solve. We indicate below two directions that we are currently investigating:  the all-port model. As we pointed out in the introduction, one can consider a model in which any node u are able to generate u messages which are simultaneously sent to the router where u is the degree of the router associated to node u. If the network is regular of the degree , we have b(G)  dlog+1 ne.  The gossiping problem. This problem is also called all-to-all broadcasting, it consists of a simultaneous broadcasting from all the nodes of the network. In the 1-port line model, we have b(G)  g(G)  2 minu2V b(G; u) ? 1, in performing rst an accumulation of all the messages in same node, and then a broadcasting from this node. Although such an algorithm is quite ecient in term of rounds, it does not balance the trac and create hot spot.

References [1] J-C. Bermond, L. Gargano, S. Perennes, A. Rescigno, and U. Vaccaro. Ecient collective communication in optical networks. Manuscript. [2] W.J. Dally and C.L. Seitz. Deadlock-free message routing in multiprocessor interconnection networks. IEEE Transaction on Computers, c-36(5):547{553, 1987. [3] J. Edmonds. Maximum matching and a polyhedron with 0,1-vertices. Journal of Research of the Natianal Bureau of Standards-B, 69B:125{130, 1965. [4] A. Farley. Minimum-time line broadcast networks. Networks, 10:59{70, 1980.

20

[5] R. Feldmann, J. Hromkovic, S. Madhavapeddy, B. Monien, and P. Mysliwietz. Optimal algorithms for dissemination of information in generalized communication modes. Technical Report 115, Fachbereich Mathematik-Informatik, Universitat-Gesamthoschule Paderborn, Germany, 1993. [6] E. Fleury and P. Fraigniaud. Strategies for Multicasting in Meshes. Research Report (Submitted to the Journal of Parallel and Distributed Computing) 94-07, Laboratoire de l'Informatique du Parallelisme, ENS-Lyon, http://www.ens-lyon.fr/LIP/, 1994. [7] E. Fleury and P. Fraigniaud. Strategies for multicasting in meshes. In 23rd International Conference on Parallel Processing (ICPP'94), 1994. [8] Message Passing Interface Forum. MPI: A message-passing interface standard. Technical Report CS-94-230, Computer Science Department, University of Tennessee, Knoxville, TN 37996, 1994. [9] P. Fraigniaud. Broadcasting in trees. Research report 95-26, Laboratoire de l'Informatique du Parallelisme, ENS-Lyon, France, 1995. [10] P. Fraigniaud and E. Lazard. Methods and Problems of Communication in Usual Networks. Discrete Applied Mathematics, 53:79{133, 1994. [11] P. Fraigniaud and J. Peters. Structured Communication in torus networks. In IEEE, editor, 28th Annual Hawaii International conference on system sciences, pages 584{593, 1995. [12] M. Garey and D. Johnson. Computers and Intractability: a guide to theory of NPcompleteness. Freeman, San Fransisco, 1979. [13] W. Gropp, E. Lusk, and A. Skjellum. Using MPI: Portable Parallel Programming with the Message Passing Interface. The MIT Press, 1994. ISBN 0-262-57104-8. [14] R. Handler and M. Huber. Integrated broadband networks: an introduction to ATM-based networks. Addison-Wesley, 1991. [15] S.M. Hedetniemi, S.T. Hedetniemi, and A.L. Liestman. A survey of gossiping and broadcasting in communication networks. Networks, 18:319{349, 1986. [16] C-T. Ho and M-Y. Kao. Optimal broadcast in all-port wormhole-routed hypercubes. IEEE Transaction on Parallel and Distributed Systems, 6(2):200{204, 1995. [17] J. Hromkovic, R. Klasing, B. Monien, and R. Peine. Dissemination of information in interconnection networks (broadcasting and gossiping). In Ding-Zhu Du and D. Frank Hsu, editors, Combinatorial Network Theory, pages 125{212. Kluwer Academic, 1995. [18] J. Hromkovic, R. Klasing, and E. Stohr. Dissemination of information in vertex-disjoint paths mode. Part 1: general bounds and gossiping in hypercube-like networks. Technical report TR-RI-93-129, University of Paderborn, Germany, 1993. [19] J. Hromkovic, R. Klasing, E. Stohr, and Wagener H. Dissemination of information in vertex-disjoint paths mode. Part 2: Gossiping in d-dimensional grids and planar graphs. Technical report TR-RI-93-130, University of Paderborn, Germany, 1993. [20] J. Hromkovic, R. Klasing, W. Unger, and H. Wagerer. Optimal algorithm for broadcast and gossip in the edge-disjoint path mode. In Springer-Verlag, editor, 4th Scandinavian Workshop on Algorithm Theory (SWAT'94), volume 824 of LNCS, pages 219{230, 1994. [21] S.L. Johnsson. Communication ecient basic linear algebra computations on hypercube architectures. Journal of Parallel and Distributed Computing, 4:133{172, 1987. [22] S.L. Johnsson and Ching-Tien Ho. Optimum broadcasting and personalized communication in hypercubes. IEEE Transaction on Computers, 38(9):1249{1268, 1989. [23] J.O. Kane and J. Peters. Line broadcasting in cycles. Technical Report CMPT TR 94-11, School of Computing Science, Simon Fraser University, Burnaby, Canada, 1994. [24] P. Kermani and L. Kleinrock. Virtual cut-through: a new computer communication switching technique. Computers Networks, 3:267{286, 1979.

21

[25] G. Kortsarz and D. Peleg. Approximation algorithms for minimum time broadcast. In Springer-Verlag, editor, Proceedings of the 1992 Israel Symposium on Theory of Computer Science, number 601 in Lecture Notes in Computer Science, 1992. [26] C. Laforest. Broadcast and gossip in line-communication mode. Technical Report 1005, Laboratoire de Recherche en Informatique, Univ. Paris Sud, 91405 Orsay, France, 1995. [27] T. Leighton. Introduction to Parallel Algorithms and Architectures: Arrays, Trees, Hypercubes. Morgan Kaufmann, 1992. [28] M. Marsan, A. Bianco, E. Leonardi, and F. Neri. Topologies for wavelength-routing alloptical networks. IEEE/ACM transaction on networking, 1(5):534{546, 1993. [29] L.M. Ni and P.K. McKinley. A survey of wormhole routing techniques in direct networks. Computers, 26(2):62{76, feb 1993. [30] J. Peters and M. Syska. Circuit-switched broadcasting in torus networks. CMPT TR 93-04, Simon Fraser University, 1993. [31] G. Pujolle. Commutateurs ATM. Techniques et Sciences informatiques, 11(1), 1992. [32] Y. Saad and M.H. Schultz. Data communication in hypercubes. Journal of Parallel and Distributed Computing, 6:115{135, 1989. [33] Y. Saad and M.H. Schultz. Data communication in parallel architectures. Parallel Computing, 11:131{150, 1989. [34] P. Slater, E Cockayne, and S Hedetniemi. Information dissemination in trees. SIAM Journal on Computing, 10(4):692{701, 1981. [35] Q.F. Stout and B. Wagar. Intensive hypercube communication 1. CRL-TR-9-87, University of Michigan, 1987. [36] H. Xu, P. K. McKinley, and L. M. Ni. Ecient implementation of barrier synchronization in wormhole-routed hypercube multicomputers. Journal of Parallel and Distributed Computing, 16:172{184, 1992.

22