Sublinear Time MST Algorithm in Networks
Sublinear Time MST Algorithm in Networks
Abstract. This paper considers the question of identifying the parameters governing the be-
havior of fundamental global network problems. Many papers on distributed network algorithms
consider the task of optimizing the running time successful when an O(n) bound is achieved on an
n-vertex network. We propose that a more sensitive parameter is the network’s diameter Diam. This
is demonstrated in the paper by providing a distributed minimum-weight spanning tree algorithm
whose time complexity is sublinear in n, but linear in Diam (specifically, O(Diam + nε · log∗ n) for
ε = ln 3
ln 6
= 0.6131...). Our result is achieved through the application of graph decomposition and
edge-elimination-by-pipelining techniques that may be of independent interest.
PII. S0097539794261118
1. Introduction.
1.1. Motivation. In many papers on distributed network algorithms, the task of
optimizing the running time is considered successful when an O(n) bound is achieved
on an n-vertex network. Typically, the justification is that there exist n-vertex graphs
for which this bound is the best possible. The sequence of solutions to the leader
election problem (LE) exemplifies the reasoning above. Following the O(n log n) run-
ning time and a first improvement by Chin and Ting [CT] and Gafni [G] (with an
O(n log∗ n) running time), Awerbuch gave an “optimal” O(n)-time solution to the
problem [A1]. Again, this solution is optimal in the sense that there exist networks
for which this is the best possible.
This type of optimality may be thought of as “existential” optimality; namely,
there are points in the class of input instances under consideration for which the al-
gorithm is optimal. A stronger type of optimality, which we may analogously call
“universal” optimality, occurs when the proposed algorithm solves the problem opti-
mally on every instance.
An interesting “side effect” of universal optimality is that a universally optimal
algorithm precisely identifies the parameters of the problem that are inherently re-
sponsible for its complexity. For example, returning to the LE problem, a more careful
∗ Received by the editors January 3, 1994; accepted for publication (in revised form) February
5, 1996. Based on A sub-linear time distributed algorithm for minimum-weight spanning trees (pre-
liminary version), by J. A. Garay, S. Kutten, and D. Peleg, which appeared in the Proceedings of
the 34th Annual IEEE Symposium on the Foundations of Computer Science, Palo Alto, CA, IEEE
Computer Society Press, Los Alamitos, CA, 1993, pp. 659–668.
[Link]
† IBM T.J. Watson Research Center, P.O. Box 704, Yorktown Heights, NY 10598 (garay@ wat-
[Link]). Part of this author’s work was done while visiting the Weizmann Institute of Science,
Rehovot, Israel.
‡ IBM T.J. Watson Research Center, P.O. Box 704, Yorktown Heights, NY 10598 (kutten@
[Link]).
§ Department of Applied Mathematics and Computer Science, The Weizmann Institute of Science,
Rehovot, 76100, Israel (peleg@[Link]). The work of this author was supported in
part by a Walter and Elise Haas Career Development Award and by a grant from the Basic Research
Foundation. Part of the work was done while visiting IBM T.J. Watson Research Center, Yorktown
Heights, NY.
302
SUBLINEAR TIME DISTRIBUTED MST ALGORITHM 303
look reveals that the inherent parameter is the network’s diameter Diam. Indeed, it
was observed in [P] that it is possible to give a trivial O(Diam)-time distributed LE
algorithm (although it should be noted that the solutions mentioned above were also
message-optimal, whereas the algorithm of [P] is not).
The interesting question that arises is, therefore, whether it is possible to identify
the inherent graph parameters associated with the distributed complexity of vari-
ous fundamental network problems and to develop universally optimal algorithms for
them.
A closely related question has been dealt with before in the context of study-
ing the role of locality in distributed computing. Various problems were shown to
be essentially local and hence amenable to a localized algorithm with very fast (e.g.,
polylogarithmic) running times. Notable examples include computing maximal in-
dependent sets and graph coloring [GPS, L, AGLP, PS2]. Locality-based techniques
were also developed for reducing communication and time complexities for other prob-
lems whose local natures are less apparent [AP1, AP2, AKP].
In contrast, we are interested here in problems that are essentially global, i.e.,
ones that do not admit localized solutions but rather always require the algorithm
to “traverse” the network. Problems of this type still raise the interesting (if more
modest) question of deciding whether Ω(n) time is essential—or is the network’s
diameter the inherent parameter? In the latter case, it would be desirable to devise
algorithms for these network problems that have a better complexity for the case of
graphs with low diameter.
In this paper, we tackle the classical minimum-weight spanning tree (MST) prob-
lem. This problem has been studied before as a canonical example for a graph-
algorithmic problem whose communication-efficient distributed solution poses some
surprisingly nontrivial subtleties [GHS]. The time complexity of the algorithm of
[GHS] is O(n log n), which was later improved to the (existentially) “optimal” O(n)
in [A1]. As with other problems, such as the above LE example, it is natural to ask
whether O(n) is universally optimal or if it can be improved.
Once again, the MST problem proves to be a worthy candidate for this type
of study. In other tree constructions, such as the breadth-first-search (BFS) tree
(which is closely related to the LE problem), it is intuitively clear that the true time
bound should be related to the network’s diameter Diam, since the depth of the
constructed tree is proportional to Diam. In contrast, the MST of a given network
may be considerably deeper than Diam, and in fact, may be as high as Ω(n). Hence
construction methods based on communication on the tree structure itself are doomed
to require Ω(n) time, and the problem of breaking the Ω(n) barrier seems intrinsically
harder.
In this paper we get closer to identifying the inherent parameters governing the
behavior of distributed MST construction by presenting a distributed MST algorithm
whose time complexity is sublinear in n, and linear in Diam (specifically, O(Diam +
nε · log∗ n) for ε = ln 3
ln 6 = 0.6131...), thus breaking the O(n) barrier. This result
is achieved through the application of graph decomposition and edge elimination
techniques that may be interesting in their own right.
1.2. Model and definitions. In this paper we focus on the problem of devis-
ing a time-efficient distributed MST algorithm. The statement of the problem is as
follows. The network is represented by an undirected graph G = (V, E), where V
is the set of nodes and E is the set of links between them. (Henceforth we use the
terms “graph” and “network” interchangeably, when no ambiguity arises.) The graph
304 JUAN GARAY, SHAY KUTTEN, AND DAVID PELEG
is given with a weight function ω : E → R+ on the edges, such that each node in
V is associated with its own processor, and processors are able to communicate with
each other via the edges in E. The goal is to have the nodes (processors) cooperate
to construct a tree covering the nodes in V whose total edge weight is no greater than
any other spanning tree for G.
We assume that nodes have unique identifiers and that each edge e ∈ E is asso-
ciated with a distinct weight ω(e) known to the adjacent nodes. The usefulness of
having distinct edge weights stems from the fact that this property guarantees that
the MST is unique. Clearly, having distinct weights is not an essential requirement,
since one can always “create” them by appending the adjacent node’s numbers to
them. However, it is known that if the graph has neither distinct edge weights nor
distinct node identifiers, then no distributed algorithm exists for computing an MST
with a bounded number of messages [GHS].
For every subgraph F of the network, let Diam(F ) denote the diameter of F , i.e.,
the maximum distance between any two vertices of F , where distance is measured in
the unweighted sense, i.e., in the number of hops.
In order to be able to concentrate on the central issue of time complexity, we shall
follow the common trend of stripping away nonessential complications. In particular,
we ignore the communication cost of our algorithm, i.e., the number of messages
it uses. (We comment that while this number is not optimized in any way in our
solution as presented in the current paper, it is not very large. In particular, it is still
considerably smaller than the number of messages needed for every node to learn the
topology of the entire network, as is used in a number of existing routing schemes,
e.g., Internet routing [MRR].)
We also assume that the computation performed by the network is synchronous;
namely, computation proceeds in rounds, governed by a global clock, with each round
taking one time unit. In each round each processor can examine the messages sent to
it by its neighbors (if any), compute, and send messages to any subset of its neighbors.
Such messages, if sent, are available to their recipients in the next round. The time
complexity of a synchronous algorithm is the number of time units elapsing until
the termination of the algorithm. This assumption is quite common in the literature.
Note, however, that here it is not essential, since our decision to ignore communication
costs allows us to freely use a synchronizer of our choice; for example, synchronizer
α [A2] enables an asynchronous network to run any protocol that was designed for
synchronous networks, with the same time complexity, at the cost of some increase in
the message complexity.
Still, we shall not adopt the extreme model employed in previous studies of locality
issues (cf. [L]), in which messages of arbitrary size are allowed to be transmitted
in a single time unit, since in this model the refined distinctions we focus on here
disappear. Clearly, if unbounded-size messages are allowed, then the problem can be
trivially solved in time O(Diam(G)) by collecting the entire graph’s topology into a
central node, computing an MST locally, and broadcasting the result throughout the
network.
Consequently, we will assume the more realistic (and rather common) model in
which messages have size O(log n), and a node may send at most one message on each
edge at each time unit.
We will also make the assumption that edge weights are polynomial in n, so an
edge weight can be sent in a single message. (This assumption is required for the time
analysis of all previous algorithms as well [GHS, A1].)
SUBLINEAR TIME DISTRIBUTED MST ALGORITHM 305
1.3. Our results. The original distributed MST algorithm of Gallager, Hum-
blet, and Spira [GHS] has a time complexity of O(n log n). This was later improved
by Awerbuch, who gave an O(n)-time algorithm [A1]. In this paper, we present
a distributed MST algorithm with time complexity O(Diam(G) + nε · log∗ n) for
ε = ln 3
ln 6 = 0.6131... .
nodes along the paths leading to the center. This can be achieved if, instead of at-
tempting to build the MST, we concentrate on eliminating candidate edges, using the
so-called “red rule” for MST construction (cf. [T, p. 71]).
In order to control the complexity of the edge-elimination process, we employ a
new efficient pipelining technique aimed at overcoming congestion. This new tech-
nique deserves some discussion, since it is different and considerably simplified com-
pared to the one presented in an earlier version of this paper [GKP]. The new tech-
nique is motivated by the following complication in the solution of [GKP]. In the
end of the first stage of the algorithm, nodes are informed about candidate edges in
the graph (those that connect clusters). In the third stage of the [GKP] algorithm,
the nodes forward the description of those edges to their parents on a spanning tree,
toward the root. The problem is that there might be too many such edges, congest-
ing the accumulation process on the tree. The algorithm of [GKP] overcomes this
difficulty by introducing an intermediate stage employing a rather complex method
(centered on locality-based ideas related to [ADDJ, AGPV, B, PS1]) for eliminating
short cycles, and thus reducing the number of remaining edges for the third stage.
The algorithm presented here has only two stages. Both the second (cycle elim-
ination) and the third stages of [GKP] are replaced by a single stage, similar to the
third stage of [GKP], in which the nodes forward descriptions of candidate edges to
their parents on a breadth-first-search spanning tree. However, we incorporate a new
technique of cycle elimination into this stage. This new pipelining technique is very
simple, and the main novelty lies in its analysis. As in the third stage of the algorithm
in [GKP], nodes on the spanning tree forward the descriptions of their candidate edges
to their parents toward the root. However, here a node avoids forwarding the descrip-
tion of cycle-heavy edges. That is, a node forwards the description of edges according
to their weight and does not forward the description of an edge that closes a cycle with
edges whose description has already been forwarded. Let us now give a hint regarding
the difficulty in analyzing this stage of the protocol. It is not hard to prove that all
non-MST edges get eliminated by this process. The difficulty lies in analyzing the
time complexity. Note that the description above (i.e., that a node does not forward
a description of a cycle-heavy edge) seems to suggest that at certain points in time a
node might be forced to wait, due to not having an edge description that is eligible for
forwarding. Thus, it may seem that the convergecast may not be fully pipelined, and
hence may take a long time. We prove that this simple convergecast is fully pipelined,
and thus its running time is the one required, eliminating the need for the complex
cycle elimination stage of [GKP]. This pipelining proof may be of interest in itself.
2.3. Combined approach. Let us now outline the structure of our algorithm.
The algorithm consists of two parts as follows.
Algorithm Sublinear-MST
Part I: Controlled-GHS;
The combined fragment has a root; it is the node with the higher Id of the two
endpoints of the core edge. (This can be simulated in the case that nodes do not have
distinct Id’s but edges have distinct weights.)
This concludes the description of a single phase. In the next phase, the new frag-
ment finds its own minimum-weight outgoing edge, and the entire process is repeated
until all the nodes in the graph have combined themselves into one single fragment.
Each fragment (of size 2 or greater) is identified by the fragment’s core edge and root.
We remark that in the original GHS algorithm, all nodes operate asynchronously.
This creates the risk of undesirable “growth patterns” of fragments, resulting in exces-
sive communication costs (measured in number of messages). This problem is handled
by using special rules for merging fragments, designed to prevent these complications.
These rules are based on a “balanced data structure” approach. A phase number is
associated with each fragment. If phase(F ) = l for a given fragment F , then the
number of nodes in F is greater than or equal to 2l . Initially, all fragments (singleton
nodes) are at phase 0. When two fragments at phase l are combined together, the
resulting new fragment has phase l + 1. Thus, the total number of messages is kept
to O(n log n) (although some more complex rules are needed to allow merges between
fragments of unequal phases). Similarly, it is not hard to show by induction on the
phase numbers that the time complexity of the algorithm is O(n log n) time units.
We refer the reader to [GHS] for further details.
3.2. Computing a small dominating set on a tree. In this subsection we
present a procedure Small-Dom-Set for computing a small dominating set on a given
tree. The procedure makes use of a subprocedure for computing a maximal indepen-
dent set in the tree. (A set M of vertices in a tree T is said to dominate the tree
if every vertex outside M has a neighbor in M .) A distributed version of procedure
Small-Dom-Set will later be used as a component in our Controlled-GHS algorithm,
which is a modification of GHS.
Our goal is as follows. Given a rooted tree T with a vertex set V (T ), find a set
of vertices M ⊆ V (T ) such that
1. M dominates V (T ), and
2. |M | ≤ |V (T
2
)|
.
Furthermore, we would like this procedure to be amenable to a fast distributed
implementation.
The procedure is based on the following. For a vertex v ∈ V (T ), let Child(v)
denote the set of v’s children in T . We use a level function Ľ(v) on the nodes, defined
as follows:
0 if v is a leaf,
Ľ(v) =
1 + minu∈Child(v) (Ľ(u)) otherwise.
L(v)>2 MIS
L(v)=2 non-MIS
L(v)=1
L(v)=0
(a) (b)
Fig. 1. (a) The level numbers marked by the algorithm on a given tree T . (b) A small domi-
nating set M on the tree T .
|Ľ0 ∪ Ľ1 |
(1) |Ľ1 | ≤ .
2
We now claim that
|R ∪ Ľ2 |
(2) |Q| ≤ .
2
This can be proved by selecting for every v ∈ Q a distinct match ω(v) ∈ (R ∪ Ľ2 ) − Q,
thus establishing that |R ∪ Ľ2 | ≥ 2 · |Q|. The matching is done as follows: pick ω(v) to
310 JUAN GARAY, SHAY KUTTEN, AND DAVID PELEG
Fig. 2. A phase of Controlled-GHS: the tree T of Figure 1b is broken into “small” trees
(represented by the solid edges) according to the MIS.
The algorithm of [GPS] (henceforth referred to as the GPS algorithm) has the
following properties.
Lemma 3.3 (see [GPS]). Applied in a given n-vertex tree G, Algorithm GPS
computes (in a synchronous manner) a maximal independent set (MIS) of G using
O(log n)-bit messages, and its time complexity is O(log∗ n).
Note that although procedure Dist-SDS is applied to the trees of the fragment
forest F F , it is actually executed on the original network itself. Hence the procedure
operates by simulating each fragment by a single representative, say, its root.
3.3.2. Analysis of controlled-GHS. The bounds on the number and diameter
of fragments are established by the next lemma. Given a fragment forest F F , let
Diam(F F ) = maxF ∈F F {Diam(F )}. Let F Fi denote the fragment forest produced
by the algorithm Controlled-GHS at the end of the ith phase. (F F0 is the initial set
of vertices.)
Lemma 3.4. In each phase i of Controlled-GHS,
1. the number of fragments at least halves, i.e., |F Fi | ≤ |F Fi−1 |/2, and
2. the maximum diameter of a fragment increases by a factor of at most 3
(possibly plus 2), i.e., Diam(F Fi ) ≤ 3Diam(F Fi−1 ) + 2.
Proof. The number of new fragments in each tree T = T (F ) of the fragment forest
F F at the end of a phase is equal to |M (T )|. By Lemma 3.2, |M (T )| ≤ |V (T )|/2.
Hence the same holds for the entire fragment forest, and claim 1 of the lemma follows.
Claim 2 is readily satisfied since the merges are star shaped.
Corollary 3.5. After running Controlled-GHS for I phases,
312 JUAN GARAY, SHAY KUTTEN, AND DAVID PELEG
The size and diameter properties of the resulting fragment forest follow directly from
Corollary 3.5.
The rather even graph decomposition obtained by Algorithm Controlled-GHS
may conceivably be useful for other purposes as well.
4. Part II: Edge elimination. The second part of our algorithm starts at the
point where we are given a fragment graph F̃l , whose vertex set V (F̃l ) is a fragment
forest F FI containing N ≤ N (I) fragments of the MST, and whose edge set E(F̃l ) is
a collection of interfragment edges, which are the remaining candidates for joining the
MST. We now proceed to reduce the total number of remaining interfragment edges
(to the necessary N − 1).
4.1. The pipeline algorithm. We need the following technical definition. For
a set of edges Q and a cycle-free subset U ⊆ Q, define Cyc(U, Q) as the set of all
edges e ∈ Q \ U such that U ∪ {e} contains a cycle.
We are now ready to describe our pipelined procedure, given in Figure 3.
4.2. Analysis. Our analysis hinges on two main properties of the procedure.
First, the edges reported by each intermediate node to its parent in the tree are
sent in nondecreasing weight order. Second, each intermediate node transmits edges
upwards in the tree continuously until it exhausts all the reportable edges from its
subtree; namely, once the set of candidates RC is empty, the node will learn of no
more reportable edges.
Let us first make the following straightforward but crucial observation.
SUBLINEAR TIME DISTRIBUTED MST ALGORITHM 313
RC = Q \ (U ∪ Cyc(U, Q)).
Lemma 4.1. The edges reported by each intermediate node to its parent in the
tree form a forest.
Proof. This follows immediately from the rule used by the procedure to select the
next edge to be transmitted upwards.
Lemma 4.2. Every node v starts sending messages upwards at pulse Ĥ(v), where
Ĥ(v) is the height function defined as follows:
0 if v is a leaf ;
Ĥ(v) =
1 + maxu∈Child(v) (Ĥ(u)) otherwise.
Proof. The proof is straightforward by induction on the tree structure, from the
leaves upward.
Our main technical lemma concerns the properties of a node on the tree in some
round of the algorithm. Consider an intermediate node v at height H that has still
314 JUAN GARAY, SHAY KUTTEN, AND DAVID PELEG
not terminated its participation in the algorithm, at round t, for some t ≥ H. Note
that each of the children of v in the tree is of height H − 1 or lower, hence, by Lemma
4.2, all of them started transmission at round H − 1 or earlier. Call a child active if
it has not terminated yet (i.e., it has upcast an edge to v on round t − 1). Let
At (v) = {v1 , . . . , vp }
X
(3) xi = |U | = m.
i
(4) |D| ≥ m + 1.
Suppose, for the sake of contradiction, that none of the edges upcast by u is a
candidate in round t. In other words, for each edge e ∈ D, either e was upcast by v
earlier (namely, e ∈ U ), or e closes a cycle with the edges of U (namely, e ∈ Cyc(U )).
Thus, every such edge e has both of its endpoints in U . Furthermore, e cannot possibly
connect endpoints that belong to two different trees Ui and Uj (since in that case, e
would have been in neither U nor Cyc(U )).
This implies that the set D can be partitioned into sets D1 , . . . , D` such that all
the edges of Di are restricted to vertices V (Ui ) of the tree Ui , for 1 ≤ i ≤ `. Moreover,
notice that each such set Di is a forest, since the entire set D is a forest by Lemma
4.1.
The last two facts combined imply that
X X
m + 1 ≤ |D| = |Di | ≤ xi = m,
i i
REFERENCES
[ADDJ] I. Althöfer, G. Das, D. Dobkin, and D. Joseph, Generating sparse spanners for
weighted graphs, in Proc. 2nd Scandinavian Workshop on Algorithm Theory, Lec-
ture Notes in Comput. Sci. 447, Springer-Verlag, New York, 1990, pp. 26–37.
[A1] B. Awerbuch, Optimal distributed algorithms for minimum-weight spanning tree, count-
ing, leader election and related problems, in Proc. 19th ACM Symp. on Theory of
Computing, ACM, New York, 1987, pp. 230–240.
[A2] B. Awerbuch, Complexity of network synchronization, J. ACM, 32 (1985), pp. 804–823.
[AGLP] B. Awerbuch, A. Goldberg, M. Luby, and S. Plotkin, Network decomposition and
locality in distributed computation, in Proc. 30th IEEE Symp. on Foundations of
Computer Science, IEEE Computer Society Press, Los Alamitos, CA, 1989, pp. 364–
375.
[AGPV] B. Awerbuch, O. Goldreich, D. Peleg, and R. Vainish, A tradeoff between information
and communication in broadcast protocols, J. ACM, 37 (1990), pp. 238–256.
[AKP] B. Awerbuch, S. Kutten, and D. Peleg, Competitive distributed job load balancing,
Proc. 24th ACM Symp. on Theory of Computing, ACM, New York, 1992, pp. 571–
580.
[AP1] B. Awerbuch and D. Peleg, Network synchronization with polylogarithmic overhead,
in 31st IEEE Symp. on Foundations of Computer Science, IEEE Computer Society
Press, Los Alamitos, CA, 1990, pp. 514–522.
[AP2] B. Awerbuch and D. Peleg, Concurrent online tracking of mobile users, Proc. ACM
SIGCOMM Symposium on Communication, Architectures and Protocols, ACM, New
York, 1991, pp. 221–233.
[B] B. Bollobás, Extremal Graph Theory, Academic Press, New York, 1978.
[CT] F. Chin and H. F. Ting, An almost linear time and O(n log(n) + e) messages distributed
algorithm for minimum-weight spanning trees, in Proc. 26th IEEE Symp. on Founda-
tions of Computer Science, IEEE Computer Society Press, Los Alamitos, CA, 1985,
pp. 257–266.
[G] E. Gafni, Improvements in the time complexity of two message-optimal election algo-
rithms, in Proc. 4th Symp. on Principles of Distributed Computing, ACM, New York,
1995, pp. 175–185.
[GHS] R. Gallager, P. Humblet, and P. Spira, A distributed algorithm for minimum-weight
spanning trees, in ACM Trans. Programming Lang. Systems, 5 (1983), pp. 66–77.
[GKP] J. Garay, S. Kutten, and D. Peleg, A sub-linear time distributed algorithm for
minimum-weight spanning trees, in Proc. 34th IEEE Symp. on Foundations of Com-
puter Science, IEEE Computer Society Press, Los Alamitos, CA, 1993, pp. 659–668.
[GPS] A. V. Goldberg, S. Plotkin, and G. Shannon, Parallel symmetry breaking in sparse
graphs, in Proc. 19th ACM Symp. on Theory of Computing, ACM, New York, 1987,
pp. 315–324.
[L] N. Linial, Distributive graph algorithms—global solutions from local data, in Proc. 28th
IEEE Symp. on Foundations of Computer Science, IEEE Computer Society Press,
Los Alamitos, CA, 1987, pp. 331–335.
[MRR] J. M. McQuillan, I. Richer, and E. C. Rosen, The new routing algorithm for the
ARPANET, IEEE Trans. Comm., COM-28 (1980), pp. 711–719.
[P] D. Peleg, Time-optimal leader election in general networks, J. Parallel Distrib. Comput.,
8 (1990), pp. 96–99.
[PS1] D. Peleg and A. A. Schäffer, Graph spanners, J. Graph Theory, 13 (1989), pp. 99–116.
[PS2] A. Panconesi and A. Srinivasan, Improved distributed algorithms for coloring and net-
work decomposition problems, in Proc. 24th ACM Symp. on Theory of Computing,
ACM, New York, 1992, pp. 581–592.
[T] R. E. Tarjan, Data Structures and Network Algorithms, SIAM, Philadelphia, PA, 1983.