Optimal Algorithms for the Single and

Multiple Vertex Up dating Problems of a

Minimum

y

Donald B Johnson Panagiotis Metaxas

z

Dartmouth College

Abstract

The vertex up dating problem for a minimum spanning tree MST

is dened as follows Given a graph G V E and an MST T for G

G

nd a new MST for G to whichanewvertex z has b een added along

with weighted edges that connect z with the vertices of GWe present

a set of rules that pro duce simple optimal parallel algorithms that run

in O lg n time using n lg n EREW PRAM pro cessors where n

jV j These algorithms employanyvalid treecontraction schedule that

can b e pro duced within the stated resource b ounds These rules can

also b e used to derive simple lineartime sequential algorithms for the

same problem The previously b est known parallel result was a rather

complicated algorithm that used n pro cessors in the more p owerful

CREW PRAM mo del Furthermore we showhow our solution can

b e used to solve the multiple vertex up dating problem Up date a

given MST when k new vertices are intro duced simultaneously This

k n

problem is solved in O lg k lg n parallel time using EREW

lg k lg n

PRAM pro cessors This is optimal for graphs having kn edges

Keywords Optimal parallel and sequential algorithms EREW PRAM

mo del vertex up dating minimum spanning tree

email address djohnsoncardigandartmouthedu

y

Current address Department of Computer Science Wellesley College WellesleyMA

email takisbambamwellesleyedu

z

Department of Mathematics and Computer Science Hanover NH

Address for Corresp ondence Panagiotis T Metaxas Departmentof

Computer Science Wellesley College Wellesley MA

Intro duction

Denition The vertex up dating problem for a minimum spanning tree

MST is dened as follows We are given a weighted graph G V E

G

along with an MST T V E The graph is augmented by a new vertex z

and n weighted edges connecting z to every vertex in V Wewant to compute

 

a new MST T V fz gE

In this pap er we present an optimal yet simple solution for the EREW

PRAM mo del Our solution works in O lg n time lg n denotes log n using

n lg n parallel pro cessors where n jV j the number of vertices in the graph

Brents theorem applies and implies that using p n log n pro cessors the

running time is O lg n np In the last section we showhow this solution

ertex up dating problem an existing MST can b e used to solve the multiple v

T is up dated simultaneously by k new vertices having weighted edges to T

The mo del of parallel computation we will use throughout this pap er

is the EREW PRAM exclusivereadexclusivewrite parallel random access

machine The virtue of an algorithm in the EREW mo del is that no

arbitration of concurrent access requests need b e provided in the machine

on which it runs Such arbitration is necessary in the more p owerful CREW

and CRCW mo dels employed in all previous work on these problems

Weintro duce a set of rules that make use of a few simple observations

on MSTs as well as of the fact that it is preferable to break the cycles in

tro duced by the new edges b ecause there is only a p olynomial number of

them than to compute the tree from scratch These rules are dened to

apply lo cally on the no des of the existing MST so we get parallel algorithms

using treecontraction as well as sequential ones using for example depth

rstsearch

History The vertex up dating problem of a minimum spanning tree

was rst addressed by Spira and Pan in where an O nsequential algo

rithm was presented Another solution using depthrstsearch and having

the same time complexitywas later given by Chin and Houck in while

Pawagi and Ramakrishnan gave a parallel solution to the problem Their

algorithm which runs in O lg n time using n CREW PRAMs precomputes

all maximum weight edges on paths b et ween any pair of no des in the tree

and then breaks the cycles simultaneously in constant time Varman and

Doshi presented an ecient solution that works in the same parallel time

but uses n CREW PRAM pro cessors They use divideandconquer to split

p

the problem into approximately n equallysized subproblems which they

solve recursivelyEven though their idea is rather simple the implementa

tion details make the algorithm rather complex More recentlyJungand

Mehlhorn have given an optimal solution for the more p owerful CRCW

PRAM mo del by reduction to an all subexpression evaluation problem They

use an optimal tree contraction algorithm as a subroutine as do we How

ever their approach to breaking cycles is dierent from ours In our case

we are able to restrict consideration of cycles to those with no more than

four vertices and as we will show they can b e treated without concurrent

writing Also b ecause of the all subexpression evaluation reduction they

need to haveanupwards and a downwards pass on the tree to complete the

calculation our approach simply computes an MST in the upward pass

There is of course an obvious algorithm for solving the problem com

pute from scratch an MST of the graph having as edges the old MST edges

plus the added edges of z This however requires O log n log log ntime

using n m EREW PRAM pro cessors employing very elab orate tech

niques The solution we present here is faster and signicantly simpler

The pap er is organized as follows The remainder of this section discusses

a useful input representation Section has an outline of the solution and

describ es the rules and the invariant used Section presents the main theo

rem and some of the algorithms that can b e derived using the rules Finally

Section shows how the vertex up dating algorithms can b e used to solve

the multiple vertex up dating problem in parallel An earlier version of this

pap er was presented in However the presentversion diers considerably

and is simpler than the previous one

Representation As is well known anyMSTT ofagiven graph G can

b e found by a sequence of deletions of an edge of maximum weight MaxWE

from some cycle Since the same sequence of deletions can b e followed on the

graph augmented with the new vertex z there is an MST in the augmented

graph in which none of these original nontree edges app ears Therefore it

is sucient to p ose the MST problem in the augmented graph on a graph

comp osed of the original MST and the edges to the new vertex z This

graph whichwe call the sucient graph has at most n edges We

cho ose to represent the sucient graph as a tree T with n weighted edges

corresp onding to the given MST and with weights on eachofitsn no des

corresp onding to weights of the newly intro duced edges to z We will call

this ob ject a weightedtree Figure Apathbetween anytwoweighted

a c

z

b

Figure a The initial given MST b the sucient graph after intro duc

ing the new vertex z along with its weighted edges and c the corresp onding

weighted tree

no des in the weighted tree corresp onds to a cycle in the graph augmented

with z Such a graph with n edges is shown in Figure b and is implied

by the weighted tree shown in Figure c In the discussion that follows

reference to the weight of a no de will mean reference to the corresp onding

edge in the sucient graph unless noted otherwise

Breaking the Cycles

Outline of the Algorithm As wementioned we are given the input in

the form of a weighted ro oted tree We assume that eachvertex has a p ointer

to a circular linked list of its children and the linked lists are stored in an

array The representation of the input is not crucial since it can b e derived

in O lg n time using n lg n pro cessors from any reasonable representation

We should mention at the outset that in the course of our description

we treat every case where read or write conicts might b e exp ected to o ccur

and weshow in eachcasehow these conicts are avoided The basic idea is

that when only a constantnumber of vertices are involved in a computation

avoiding conicts is always p ossible with a constant dilation in running time

and is in fact straightforward to implement

v

v u

w

u

w v

w

w

w

u

w

w

v

w

u

v v v v

v

v

w

w

v v

Figure Binarization A no de with more than twochildren is represented

by a right path of unremovable edges

The algorithm consists of a numb er of phases During each phase leaves

and no des of degree of the weighted tree such as the ro ot or internal no des

having one child are processedEach treeno de is pro cessed once in the en

tire course of the algorithm The order in which the no des are pro cessed in

parallel is dictated by a treecontraction schedule Pro cessing a no de means

examining the edges comp osing smal l cycles cycles of length or that

contain the no de and breaking these cycles by removing a MaxWE that ap

p ears in them eectively computing an MST of the subgraph induced bythe

examined edges This is done by a set of rules which also up date neighb oring

no des so that the size of the unpro cessed part of the tree decreases

A sequential algorithm needs only to apply the appropriate rule while

visiting the no des of the tree Thus a depthrstsearch or a breadthrst

search visit of the no des suces When working in parallel though the rules

can apply to many no des at once provided that no confusion arises from the

simultaneous up dating of neighb oring no des A valid treecontraction sched

ule like the ones presented in Section suces to assure that neighb oring

no des are not pro cessed at the same time After pro cessing all the no des an

MST of the sucient graph has b een computed and the algorithm terminates

Binarization The rules we present assume a binary tree as input so

some prepro cessing is needed to transform the weighted tree to a binary

weightedtree This can b e achieved in O lg n time using n lg n EREW

PRAM pro cessors and is needed only for ordering the pro cessing of a no des

children Note that only the parallel algorithms need this transformation

This transformation is p erformed by the pro cedure binarizewhichwede

scrib e here Eachnodev having k children v v is represented bya

k

right path Figure comp osed of v u and k fakenodes u u

k 

so that no de u is the rightchild of u for j k No de v for

j j  i

the rightchild of i k b ecomes the left child of no de u andv

k i

u We assign weights of to the edges of the right path which makes

k 

them unremovable by our rules Since the fake no des are intro duced only to

x the pro cessing order of v s children they are assigned weight making

it imp ossible to retain them in the MST connecting z and v Of course the

real no des v and the v s keep their weights At the end of the algorithm each

i

right path is always included in the MST of the binarized problem giving a

unique obvious solution to the original problem

Some treecontraction schedules require a regular binary tree as input

For these cases the binarization is extended to handle no des v with only one



child in the input tree For each of them a second child v is intro duced for

 

which w v and w v v

The binary weighted tree has the same numb er of cycles but mayhave

heightmuch greater than the input tree and may contain twice as many

no des This fact though do es not aect the asymptotic running time of the

algorithm which is logarithmic in the number of tree nodes

Invariant and Rules The rules are divided into two categories Rules

that are applied to leaves pruning rules and rules that are applied to no des

with only one child shortcutting rules Each no de is examined exactly once

for rule application Then its incident edges are identied as b eing either

included in the new MST or excluded from it

We will make use of the following twowellknown facts whichwe state

here without pro of

Fact The edge with minimum weight incident to some node wil l always be

included in the MST

Actually Prims and other sequential and parallel algorithms are

based on this fact Edge inclusion in our rules makes use of this observation

G Gfu v g

c

G

w

w

c

min fc c g

u

c

uv

c

w c v

w

Figure Contraction of edge fu v g in G pro duces G Gfu v g

c

Fact Whenever some edge is found to correspond to the MaxWE of some

cycle it can beremovedfrom the graph without aecting the computation of

the MST of the graph

Kruskals MST algorithm makes use of this fact Edge exclusion in our

rules is based on this observation

A useful Lemma Let w V E R givetheweights of the no des and

the edges At the b eginning of the algorithm the weightofa node v is the

weight of the edge connecting v to z To resolv e ties we adopt the convention

that the currently pro cessed no de has weight larger than its equally weighted

neighb ors

For the purp oses of this lemma we assume that the edges of G can b e

assigned lab els based on their endp oints eg edge fu v g receives the lab el

labfu v g and that these lab els p ersist under the change of endvertices in

the contraction op eration wenow dene Given a weighted graph G and an

edge fu v gwe dene the contractedgraph Gfu v g as follows Delete edge

u v and then replace vertices u and v with a new vertex uv retaining the

original edges and edge lab els with only the indicated endp oint renamed

Thus any edge incidentonvertiex u for example is now incidentonvertex

uv Figure In the case where there originally was an edge from a vertex

w to b oth u and v delete the now parallel edge with the greater weight or

in the case of a tie one of the parallel edges

Lemma For fu v g MST G

MST Gfu v g MST Gfu v g

wheretheMST is dened by its edges and equality is over edge labels that

persist under the contraction operation Gfu v g

Pro of Let us denote the contracted graph Gfu v g with G The lemma

c

states that MST Gfu v g MST G

c

G MST G there is Consider an MST G Then for each edge e

c c c

a cycle comp osed of edges in G among which e is the MaxWE

c

Observe that from the way G is constructed each edge in G has a cor

c c

resp onding edge in G The opp osite is not true Now consider a subgraph

S G induced by fu v g and the edges of G corresp onding to MST G

c



Note that S is a spanning tree of GWe will show that for eachedge e GS



there is a cycle in G in which e is the MaxWE this will prove the lemma

To see that we consider two cases



e corresp onds to edge e in G Since e MST G there is a cycle

c c

in G in which e is the MaxWE Each one of the edges in this cycle

c



corresp onds to an edge in Gand e is the MaxWE in this cycle

 

e do es not corresp ond to an edge in G Then e was one of the edges

c

deleted by the contraction therefore it has one of its endp oints at u or



v Without loss of generalitywe assume that e fw ug Then there



is another edge fw v g G with weight less than the weightof e which

has a corresp onding edge in G namely fw uv gThus there is a cycle

c

 

involving edges e fw v g fu v g in which e is the MaxWE

We are ready now to present our rules Each application of a rule will

preserve the following invariant

Invariant Whenever the rules include an edge e then there is some MST G

dges already included for which e MST G Whenever the containing al l e

minfb cg c

a min fa bg

a

a

v v

b

b minfa bg min fa cg

v

b

Figure Pruning Rules for a Leaf An included edge is dotted and wekeep

its weight letter We erase an excluded edge along with its weight letter



rules exclude an edge e then there is some MST G containing al l edges



already included and e MST GUpdates in the weights of the vertices

reect the eect of contracting the includededge

Pruning Rules

Consider a small cycle involving leaf v pv the parentof v in the

weighted tree of the sucient graph and z Letw v pv a w v b

w pv c Figure The cycle of length they form can b e broken in and

sucha waythattheinvariant is preserved We consider the following cases

a minfa bg Then a should b e included and the edge corresp onding to

maxfb cg should b e excluded We up date w pv minfb cg

b minfa bg Now b should b e included while the edge corresp onding to

maxfa cg should b e excluded Similiarly with the previous case we

up date w pv minfa cg

Some sp ecial care to avoid concurrent writing must b e taken in the case

that v s sibling say u is also a leaf Figure and is pro cessed at the same

time Actually the ACD scheduling metho d whichwe describ e in a later

section schedules v and u to b e pro cessed at the same time Section

discusses howweavoid concurrent accesses

e

minfd eg

a

a

d

a min fa b dg

c

b

min fb cg

e

d

b minfa b dg

min fa cg

b

min fa eg

b d min fa b dg

d

c

Figure Shortcutting Rules

Shortcutting Rules

Nowwe consider a situation where v has only one child say uThere

are two p ossible small cycles involving v z v u z and z v pv zWe will

describ e how to break these cycles in a way that the invariant is preserved

Let w v a w v u b w u c w v pv d and w pv e

Figure

a minfa b dg Then a should b e included and the edges corresp onding

to maxfe dg and maxfc bg should b e excluded We up date w pv

minfe dg and w u minfc bg

d minfa b dg Then d should included and the edge corresp onding to

maxfa eg should b e excluded Weupdate w pv minfa eg

b minfa b dg Similiarly b should b e included and the edge corresp onding

g to maxfa cg should b e excluded Weupdate w u minfa c

The fact that shortcutting a no de may up date b oth parent and child no des

creates a p ossibility of a write conict This can b e easily avoided since at

most three pro cessors may try to access the same memory cell simultaneously

Section describ es how this conict is avoided

Up dating weights should b e implemented in suchaway that the original

edge whose weight app ears after the up date on the no de is rememb ered

One p ointer p er no de p ointing to this original edge suces to accomplice

this

Correctness Lemma Wehave describ ed a set of rules that dene a

prune op eration which removes the leaves of a tree and a shortcut op eration

whichremoves no des of degree two from the tree Note that individual

prunings and shortcuttings take O time to b e p erformed

Wearenow ready to prove the following

Lemma Application of a pruning or a shortcutting rule on some node v

of the weightedgraph preserves the invariant

Pro of Without loss of generalitywemay assume that G has a unique MST

This can b e easily accompliced by assigning unique weights on the edges of

the sucient graph The invariant states three things

Whenever the rules include an edge e it is b ecause e is the minimum

weight edge incident to a no de and byFact e MST G



e it is b ecause there is a small Whenever the rules exclude an edge

 

cycle in which e is the MaxWE and byFact e MST G

In every application of a rule if wewere to contract the included edge

then wewould havetointro duce an edge with weight equal to the

up dated weight

We dene a valid treecontraction schedule to b e one whichschedules the

no des of the binary tree for pruning and shortcutting in sucha waythati

when a no de is op erated up on it has degree one or two and ii neighb oring

no des are not op erated up on simultaneously

Lemma When the rules are applied on the nodes of a binary weightedtree

at times given by any valid treecontraction scheduling they correctly produce

the updated minimum spanning tree

Pro of As we said a valid contraction schedule denes pro cessing times

on no des having degree or So only the prune and shortcut op erations

are needed and they are provided by the rules Moreover anynodemaybe

accessed simultaneously by at most three pro cessors This conict can b e

resolved as describ ed in Section Therefore the shortcutting and pruning

op erations can b e done without confusion and their application according

to Lemmas and preserves the invariant Thus at the end of the schedule

the MST of the sucient graph has b een computed

The Algorithms

Wesaythata sequential algorithm for some problem of size n is optimal if it

runs in time that matches a lower b ound for the problem to within a constant

factor

Let tn denote the parallel running time for some parallel algorithm

and pn denote the numb er of pro cessors employed by the algorithm Then

w ntnpn denotes the work p erformed by the algorithm A parallel

algorithm for some problem is said to b e optimal if it has p olylogarith

mic parallel running time and the work w n p erformed by the algorithm is

O T n where T n is the running time of the b est sequential algorithm for

the same problem

The vertex up dating problem has a lower b ound of n sequential time

Also any parallel algorithm for the problem must have running time of

log n To see that consider the following argument Consider a tree

all of whose no des are on a path of length n and therefore having only

two leafno des If weaddtwonewweighted edges connecting z to eachof

the two leaves the up dating MST problem is equivalent to the problem of

computing the maximum of n weights on the cycle created This problem

has a sequential lower b ound of nandaparallellower b ound of log n

We next present the algorithms

Theorem Thereare optimal paral lel and sequential algorithms that solve

the MST vertex updating problem based on the rules presentedabove The par

al lel algorithms run on a binary weightedtreeinO log n time using n lg n

EREW PRAM processors and the sequential algorithms run in O n

Pro of a the optimal parallel algorithms There are actually

several valid tree contraction schedules that pro duce optimal b ehavior in our

algorithm First prop osed suchaschedule whichwas constructed on the

y by an optimal randomized algorithm The problem and its applications

drew the attention of researchers and so on several optimal deterministic

algorithms were presented

Shunting We will briey describ e here the simplest of these schedules

called Shuntingwhichwas prop osed indep endently by and The

algorithm is comp osed of a numb er of phases each containing the following

steps Figure

Numb er the leaves of the tree from lefttoright Here the input is

supp osed to b e a regular binary tree ie a binary tree in whichevery

internal no de has exactly twochildren The numb ering can b e done

within the desired b ounds using the eulerian tour technique

Prune the o ddnumb ered leaves that are the left children of their parent

Then shortcut their parent This is the shunt op eration

Shunt the o ddnumbered leaves that are the rightchildren of their

parent

Shift out the last bit of the numb ers of the remaining leaves and rep eat

steps to until the whole tree has b een contracted

d Lemma The shunting algorithm computes a valid contraction sche

ule which has length O lg n

If we had a pro cessor assigned to each no de we could contract the tree

using n pro cessors in the desired time But the time at which pro cessing

o ccurs can b e computed b eforehand for each leaf and placed in an arrayof

length dne The array is lled with p ointers to leaves having numb ers

then to leaves having numb ers etc In general there

are O lg n phases numbered i dlg n e and in each of them leaves

i i i i

numb ered are shunted Having the arrayittakes

time O np using p n lg n pro cessors to do the contraction Optimality

is achiev ed for p n lg n Example of the algorithm using the shunting

schedule is shown in Figure

b

a

c

Figure The Shunting Schedule The rst phase a Numb ering of the

leaves b Step Shunting of o dd numb ered left children c Step

Shunting of o dd numb ered rightchildren

c b

a

Figure Run of the Parallel Algorithm using Shunting on the tree of

Figure Dotted edges are included in the MST deleted edges are excluded

from it a In black are the rst two pro cessed vertices b Third step c

Fourth and nal step

ACD The accelerated centroid decomp osition ACD technique was pro

p osed by and also provides an optimal valid scheduling Using their

technique another optimal algorithm for the vertex up dating problem is ac

quired To conserve space we will not describ e this metho d here we refer

the interested reader to

b the optimal sequential algorithms The rules we present

do not dep end on the particular order in which the no des of the tree are

removed Therefore dierent removal sequences of the no des yield dierent

algorithms and we can derive sequential algorithms from the parallel ones In

particular the Shunting and the ACD numb erings givetwosuch algorithms

Their running times dier only by a constant In the next paragraphs w e

presenttwo more sequential algorithms

Remove on the y Use depthrstsearch or breadthrstsearch to visit

the no des of the tree Every time a no de of degree or is encountered

pro cess it using pruning or shortcutting rule resp ectivelyEach no de will b e

visited at most twice on the waydown the tree and on the way up the tree

so its running time is O n

Postorder Probably the simplest to implement sequential algorithm is

the following Visit the no des of the weighted tree in p ostorder using for

example depthrstsearch A no de is pro cessed after all its children have

b een pro cessed so in this case only the pruning rules are needed Since each

no de is pro cessed at most once wehaveanO n sequential algorithm

Remarks Several researchers who havegiven solutions to other tree

contraction problems have used a variety of names to denote the removal

of a leaf and removal of a no de with degree two op erations Rake has

b een used as a synonym for prune compress and bypass as synonyms for

shortcut Finally shunt and rake have b een used to denote the application

of a prune followed by a shortcut

The algorithms presented do not exhaust the p ossible sequential and

parallel algorithms that can b e derived based on the rules but include only

the simpler ones Other treecontraction techniques lead to dierent

algorithms with the same b ounds

The shunting metho d describ ed in requires that the ro ot of the

tree not b e shunted until the end This is needed mainly for the expression

tree evaluation algorithm In our case shunting the ro ot is p ermitted since

there is no toptob ottom information to b e preserved

Binarization

Theorem Therearelogarithmictime optimal paral lel algorithms solving

dating problem on a rootedtree the MST vertex up

Pro of The binarized graph describ ed in Section has exactly the same

numb er of cycles as the given graph and at the end of the algorithm the edges

comp osing the right path are always included into the new MST Therefore

the solution of the binarized problem shows a corresp onding unique and

unambiguous solution to the general problem

Similar binarization techniques to the one describ ed havebeenusedin

and Another technique plants a balanced binary tree over

the v s with v as the ro ot The internal no des and the internal edges have

i

weights as those in the right path in the previously describ ed technique Both

constructions require the list ranking algorithm which runs within the

desired b ounds Actually in the Eulerian tour technique is used which

has the list ranking pro cedure as a subroutine

minfmaxfa bg maxfd egg

c

a d

v u v u

b

e

minfa bg minfd eg

Figure When v s sibling is a leaf

x

v v

a

a

c

b y b

a b

Figure Memory Access Conicts and how to resolve them Two a and

three b pro cessors attempt to up date v

Memory Access Conicts

We rst describ e howtoavoid concurrent writing when prunning simul

taneously two leaves Figure Let w u e and w u pv d Prunning

b oth v and u will result in an attempt by the pro cessors assigned to them to

up date w pv at the same time The correct execution of the algorithm re

quires that a cycle of length namely z v pv uz b e broken by excluding

its MaxWE So w pv must b e up dated to either maxfa bg or maxfd eg

dep ending on whichchild was connected to the excluded edge This is done

by the pro cessor assigned to say u as follows If maxfa bg maxf d eg

then maxfa bg is excluded and w pv maxfd eg Else if maxfd eg

maxfa bgmaxfd eg is excluded and w pv maxfa bg

This is the only conict that can o ccur during prunnings The fact that

shortcutting may up date b oth parentandchild no des creates a p ossibility

of a write conict Consider the following situation Let no des x v y satisfy

py v and pv x and assume that no des x and y are to b e pro cessed

simultaneously Figure a Moreover lets assume that shortcutting no de x

calls for up dating child no de v with w v a and shortcutting no de y calls

for up dating parentnode v with w v b

The write conict actually represents a cycle involving no des z x v y

and p ossibly xs parent andor y s child Since two pro cessors may try to

write on the same memory cell the conict can b e avoided and the cycle

b ehind it should b e broken by removing the edge maxfa bg while up dating

w v minfa bg

This is the only kind of access conict that can b e created by the shunting

schedule we describ ed There are other schedules though which create a

slightly more complicated conict when up dating a no de with three values

Figure b say a band c Again this can b e resolved by breaking the

MaxWEs of the three cycles b ehind the conict Therefore in this case

the algorithm should up date w v minfa b cg and should exclude the

edges that corresp ond to the other twovalues Note that the write conict

we describ ed in the b eginning of this section when two sibling leaves are

pruned simultaneously can b e viewed as a sp ecial case of this conict

On the Multiple Vertex Up dates Problem

We dene the problem of multiple vertex updates of an MST as follows Let

G V E beaweighted graph on n vertices and m weighted edges and

G G

T V E b e its MST Supp ose G is augmented with k jV j new vertices

G T k

that are connected to V s vertices by kn jE j new weighted edges but

G k

they are not connected among themselves We are asked to compute the new



MST T

The problem of multiple vertex up dates was considered byPawagi

and a parallel algorithm was presented running in O lg n lg k time using nk

CREW PRAM pro cessors The problem was also addressed in and

We will showhow our solution for the single vertex up date problem can

b e used to achieve a b etter solution for the multiple up dates problem on a

weaker mo del of parallel computation Note that this is optimal for graphs

having kn edges

Theorem The multiple updates MST problem can be solvedinparal lel in

time O lg n lg k using nk lg n lg k EREW PRAM processors

Pro of The algorithm follows in general the one presented in but in

certain parts uses dierent implementation techniques to achieve the tighter

time and pro cessor b ounds The algorithm consists essentially of three parts

Make k copies of T and solve k up date MST problems in parallel

Combine the MSTs of the k solutions into a new graph G This graph

z

maycontain cycles Transform it to an equivalent bipartite graph G

b

Solve the bipartite MST problem on the graph G

b

We will show that each of these parts can b e implemented within the

desired b ounds

Solving k Up dating Problems Making k copies of T requires

O kn op erations and it can b e done in constant time if kn pro cessors are

n lg k time using knlg n lg k available Therefore it can b e done in O lg

pro cessors following Brents technique

According to Theorem a single up dating of an MST can b e done in

O lg n time when n lg n pro cessors are available Here wehave k problems

to solve eachofsizen Allo cating nlg n lg k pro cessors p er problem it

takes O lg n lg k time to solveeach one in parallel

Creating the Bipartite Graph Next wehavetocombine the

k solutions found in the rst part into a new graph G which in turn is

z

transformed to an equivalent bipartite graph G By equivalent here we

b

mean that there is a cycle in G if and only if there is a cycle in G Graph G

b z z

will never b e explicitly created it is only dened for the sake of description

If some edge v w E did not app ear in at least one of the k solutions

T

it was the MaxWE of some cycle and thus m ust b e excluded So G

z

V fz z gE is comp osed of edges v w E that app ear in al l k

k z T

solutions along with edges of the form z v E i f kg It is

i k

easy to see that the formation of G can b e done within the desired b ounds

z

b ecause there are at most n such edges p er solution to examine

We can view G as a collection of subtrees C of the old MST that are

z j

held together bythe z s Figure Every cycle in G can b e viewed as

i z

starting at some z thenentering subtree C at a no de v and visiting some of

i j e

z z z

k

C C C

j

Figure The graph G results from putting together the k solutions The

z

gure p oints out G s bipartite nature

z



its no des then exiting through a no de v and visiting z etcuntil returning

l

e

backto z Figure The no des v that are adjacent to some z are called

i e i

enodes The new graph G V fz z gE has a set of vertices V

b b k b b

whichcontains one vertex v for each eno de v of G Consider a path from

e z

z to some eno de v and let x b e the MaxWE on this path Then edge

i e

xs cost The z v E corresp onds to this path and has cost equal to

i b

algorithm needs therefore to compute all MaxWE on all paths from z to

i

eno des v

e

Note that solving the MST on G eectively solves the MST problem on

b

G There is a onetoone corresp ondence b etween cycles in G and G Each

z b z

cycle in G is broken by identifying and deleting the MaxWE in it Suchan

b

edge is also the MaxWE in the corresp onding cycle in G and should b e

z

deleted to compute the MST of G

z

This is done as follows First all eno des v are recognized Then we

e

ro ot each of the T s at z Both of these op erations can b e done within the

i i

desired b ounds Nowwehave to compute the MaxWEs on the paths b etween

z s and eno des by solving k instances of the following problem Given a

i

regular binary ro oted tree with n no des having weights asso ciated with its

edges nd the MaxWE for each path from a no de to the ro ot in O lg n

np time using p n lg n EREW PRAM pro cessors Each solution is a

z

z

r

p

C C

q s

Figure Cycles in G They are comp osed of alternative visits to z s and

z i

to tree comp onents Vertices that are connected to z s are called evertices

i

In this picture a cycle of length is shown

simple application of the treecontraction problem We allo cate n lg n lg k

pro cessors p er tree and compute the problem in time O lg n lg k

The Bipartite MST Problem For the third part of the algorithm

we need the following denition of the bipartite MST problem Let G

V V Ebeaweighted bipartite graph where jV j k and jV j n

k n k n

k nWewant to compute its MST The following Lemma concludes the

description of the algorithm along with the pro of of Theorem

Lemma The bipartite MST problem can be solvedinO lg n lg k paral lel

n lg k EREW PRAM processors time using knlg

Pro of The algorithm that weuseisa wellknown algorithm whose main

idea is attributed to Boruvka and was describ ed in its parallel form in

The analysis however and the timepro cessors b ounds for the bipartite

MST problem are new

First let us give some denitions A pseudotree is a in

which eachvertex has outdegree one A pseudotree has at most one simple

cycle A is a graph whose comp onents are pseudotrees The

algorithm consists of a numb er of stages In each stage eachvertex v selects

the minimum weight edge v w incident to it This creates a pseudoforest of

vertices connected via the selected edges In this case the cycle of each pseu

dotree involves only twovertices so the pseudotree can b e easily transformed

into a tree Next each tree is contracted to a star using p ointerdoubling

and vertices in the same comp onent are identied with the ro ot of the star

The crucial observation here is that since every pseudotree must contain

at least one z after the rst stage there will b e no more than k vertices

i

in the resulting graph and the problem can b e solved in O lg k time using

k lg k pro cessors So weonlyhavetoshow that the rst stage can b e

p erformed within the desired b ounds

As we said the rst stage consists of nding the minima of O nsetsof

vertices each with cardinality O k and then to reduce the O k resulting

pseudotrees of height O n to stars For the rst part Brents technique

applies For the second part we use the optimal listranking technique of

Acknowledgement The authors would like to thank the anonymous

referee for the careful reading of a previous draft and for p ointing out

Lemma that simplied the presentation of this pap er

References

PM Spira and A Pan On nding and up dating spanning trees and

shortest paths SIAM Journal on Computing September

F Chin and D Houck Algorithms for up dating minimal spanning trees

Journal of Computer and System Sciences

S Pawagi and IV Ramakrishnan An O log n algorithm for parallel

up date of minimum spanning trees Information Processing Letters

April

PVarman and K Doshi A parallel vertex insertion algorithm for mini

mum spanning trees In th ICALP Lecture Notesvolume pages

H Jung and K Mehlhorn Parallel algorithms for computing maximal

indep endent sets in trees and for up dating minimum spanning trees

Information Processing Letters April

R Karp and V Ramachandran Parallel algorithms for sharedmemory

machines Handbook for Theoretical Computer Science

DB Johnson and P Metaxas A parallel algorithm for computing min

imum spanning trees In Proc of the th Annual ACM Symposium on

Paral lel Algorithms and Architectures SPAA pages June

KW Chong and TW Lam Finding connected comp onents in

O log n log log n time on the EREW PRAM In Pr oc of the th ACM

SIAM Symposium on Discrete AlgorithmsJanuary

DB Johnson and P Metaxas Optimal algorithms for the vertex up dat

ing problem of a minimum spanning tree In Proc of the th Intl Paral lel

Proccessing Symposium IPPS pages March

FY Chin J Lam and IN Chen Ecient parallel algorithms for some

graph problems Communications of ACM September

R Cole and U Vishkin The accelerated centroid decomp osition tech

nique for optimal parallel tree evaluation in logarithmic time Algorith

mica

G L Miller and J H Reif Parallel tree contraction Part Funda

mentals Advances in Computing Research Part in th

FOCS

K Abrahamson N Dadoun DG Kirkpatrick and T Przytycka A sim

ple parallel tree contraction algorithm Journal of Algorithms

S Rao Kosara ju and Arthur L Delcher Optimal parallel evaluation of

treestructured computations by raking Aegean Workshop on Comput

ing pages

A Gibb ons and W Rytter An optimal parallel algorithm for dynamic

expression evaluation and its applications In Proc of Symposium on

Foundations of SoftwareTechnology and Theoretical Computer Science

volume pages Springer Verlag

H Gazit G L Miller and S H Teng Optimal tree contraction in

the EREW mo del In Concurrent Computations Algorithms Architec

ture and Technology New York Tewksbury and Dickinson and

Schwartz editors Plenum Press

RE Tarjan and U Vishkin An ecient parallel biconnectivity algo

rithm SIAM Journal of Computing

S Co ok C Dwork and R Reischuk Upp er and lower time b ounds for

parallel random access machines without simultaneous writes SIAM

Journal of Computing February

R Cole and U Vishkin Approximate parallel scheduling Part The

basic technique with applications to optimal parallel list ranking in log

arithmic time SIAM Journal of Computing February

RJ Anderson and GL Miller Deterministic parallel list ranking Al

gorithmica Also Pro c rd AWOC

S Pawagi A parallel algorithm for multiple up dates of minimum span

ning trees In International ConferenceonParal lel Processingvolume

I I I pages

S Pawagi and O Kaser Optimal parallel algorithms for multiple up

dates of minimum spanning trees Technical rep ort Dept of Comp Sc

SUNY at Stony Bro ok Unpublished Manuscript

A Schaer and PVarman Parallel batch up date of minimum spanning

trees Technical rep ort Dept of Elec and Comp Engin Rice University

May Unpublished Manuscript

RE Tarjan Data Structures and Network algorithms So ciety for In

dustrial and Applied Mathematics Philadelphia Pennsylvania