
68 R.G. Gallager, P. A. Humblet, and P. M. Spira
select the node in the network with the highest identity number. An efficient
distributed algorithm for this problem starts with the MST algorithm and then
uses the resulting tree to find the highest numbered node.
2. REVIEW OF SPANNING TREES
We assume the reader is familiar with the elementary definitions and properties
of graphs, paths, cycles, trees, etc., which can be found, for example, in [5, 6].
Suppose that each edge e of a graph has a weight w(e) associated with it. The
weight of a tree in the graph is defined as the sum of the weights of the edges in
the tree, and our objective is to find a spanning tree of minimum weight, that is,
an MST. A fragment of an MST is defined as a subtree of the MST, that is, a
connected set of nodes and edges of the MST. The algorithm starts with each
individual node as a fragment and ends with the MST as a fragment. Define an
edge as an outgoing edge of a fragment if one adjacent node is in the fragment
and the other is not.
PROPERTY 1. Given a fragment of an MST, let e be a minimum-weight
outgoing edge of the fragment. Then joining e and its adjacent nonfragment
node to the fragment yields another fragment of an MST.
PROOF. Suppose the added edge e is not in the MST containing the original
fragment. Then there is a cycle formed by e and some subset of the MST edges.
At least one edge x ~ e of this cycle is also an outgoing edge of the fragment, so
that w(x) >_ w(e). Thus, deleting x from the MST and adding e forms a new
spanning tree which must be minimal if the original tree was minimal. The
original fragment with e added is a fragment of the new MST. []
PROPERTY 2. If all the edges of a connected graph have different weights,
then the MST is unique.
PROOF. Suppose, to the contrary, that there are two different MSTs. Let e be
the minimum-weight edge that is in one but not both of the trees, and let T be
the set of edges of the MST containing e and T' be the edge set of the other
MST. The edge set (e} U T' must contain a cycle, and at least one edge of this
cycle, say e', is not in T (since T contains no cycles). Since the edge weights are
all different and e' is in one but not both of the trees, w(e) < w(e'). Thus {e} U
T' - (e'} is the edge set of a spanning tree of smaller weight than T', yielding a
contradiction. []
These properties immediately suggest a general type of algorithm for finding
the MST for a graph with different edge weights. One starts with one or more
fragments consisting of single nodes. Using Property 1, one can enlarge these
fragments in any order. Whenever two fragments have a common node, Property
2 assures us that the union of these fragments is also a fragment, allowing
fragments to be combined into larger fragments. The standard algorithms for
generating MSTs correspond to different orders in which the above fragments
are enlarged and combined. For example, the Prim-Dijkstra algorithm [2, 7]
starts with a single node and successively enlarges the fragment until it spans the
graph. The Kruskal algorithm [4] starts with all nodes as fragments and succes-
sively extends the fragment with the smallest-weight outgoing edge, combining
ACM Transactions on Programming Languages and Systems, Vol. 5, No. 1, January 1983.