A

Highly

Asynchronous

Minimum

Spanning

Tree

Protocol

Gurdip

Singh

Department

of

Computing

and

Information

Sciences

Nichols

Hall

Kansas

State

University

Manhattan

Kansas

Arthur

J.

Bernstein

Department

of

Computer

Science

SUNY

at

Stony

Brook

Stony

Brook

Long

Island

NY

Abstract

In

this

paper

we

present

an

efficient

distributed

protocol

for

constructing

a

minimum-weight

spanning

tree

-LRB-

MST

-RRB-

Gallager

Humblet

and

Spira

-LSB-

-RSB-

proposed

a

protocol

for

this

problem

with

time

and

message

complexities

O

-LRB-

N

log

N

-RRB-

and

O

-LRB-

E

N

log

N

-RRB-

respectively

A

protocol

with

O

-LRB-

N

-RRB-

time

complexity

was

proposed

by

Awerbuch

-LSB-

-RSB-

We

show

that

the

time

complexity

of

the

protocol

in

-LSB-

-RSB-

can

also

be

expressed

as

O

-LRB-

-LRB-

D

d

-RRB-

log

N

-RRB-

where

D

is

the

maximum

degree

of

a

node

and

d

is

the

diameter

of

the

MST

and

therefore

this

protocol

performs

better

than

the

protocol

in

-LSB-

-RSB-

whenever

D

d

N

log

N

We

give

a

protocol

which

requires

O

-LRB-

min

-LRB-

N

-LRB-

D

d

-RRB-

log

N

-RRB-

-RRB-

time

and

O

-LRB-

E+N

log

N

log

N

log

log

N

-RRB-

messages

The

protocol

constructs

a

minimum

spanning

tree

by

growing

disjoint

subtrees

of

the

MST

-LRB-

which

are

referred

to

as

fragments

-RRB-

Fragments

having

the

same

minimumweight

outgoing

edge

are

combined

until

a

single

fragment

which

spans

the

entire

network

remains

The

protocols

in

-LSB-

-RSB-

and

-LSB-

-RSB-

enforce

a

balanced

growth

of

fragments

We

relax

the

requirement

of

balanced

growth

and

obtain

a

highly

asynchronous

protocol

In

this

protocol

fast

growing

fragments

combine

more

often

and

therefore

speed

up

the

execution

This

work

was

supported

by

NSF

under

grants

and

Introduction

In

this

paper

we

develop

a

distributed

protocol

for

obtaining

a

minimum

spanning

tree

in

an

asynchronous

network

We

assume

that

each

edge

has

a

distinct

weight

associated

with

it

When

the

protocol

terminates

each

node

knows

which

edges

incident

on

it

are

in

the

minimum

spanning

tree

The

problem

of

obtaining

a

minimum

spanning

tree

is

an

important

one

Many

problems

such

as

leader

election

and

computing

a

global

function

can

be

solved

efficiently

by

maintaining

a

minimum

spanning

tree

The

problems

of

constructing

a

spanning

tree

and

leader

election

are

closely

related

and

are

reducible

to

each

other

using

O

-LRB-

E

-RRB-

messages

and

O

-LRB-

N

-RRB-

time

where

E

and

N

are

the

number

of

edges

and

nodes

respectively

in

the

network

-LRB-

i

e

given

a

protocol

with

message

and

time

complexities

O

-LRB-

M

-RRB-

and

O

-LRB-

T

-RRB-

respectively

for

one

of

them

we

can

obtain

a

protocol

for

the

other

with

message

and

time

complexities

O

-LRB-

M

E

-RRB-

and

O

-LRB-

T

N

-RRB-

respectively

-RRB-

As

observed

in

-LSB-

-RSB-

-LRB-

E

-RRB-

messages

are

necessary

to

construct

a

spanning

tree

in

a

network

with

an

arbitrary

topology

Also

as

shown

in

-LSB-

-RSB-

-LRB-

N

log

N

-RRB-

messages

are

required

for

leader

election

in

a

ring

-LRB-

therefore

constructing

a

spanning

tree

will

require

O

-LRB-

N

log

N

-RRB-

messages

in

a

ring

-RRB-

It

follows

that

-LRB-

E

N

log

N

-RRB-

messages

are

required

for

constructing

a

spanning

tree

in

a

network

with

an

arbitrary

topology

In

-LSB-

-RSB-

it

was

noted

that

-LRB-

N

-RRB-

is

a

lower

bound

on

the

time

complexity

for

this

problem

since

in

a

network

having

O

-LRB-

N

-RRB-

diameter

O

-LRB-

N

-RRB-

time

is

required

just

to

traverse

the

network

In

-LSB-

-RSB-

a

message

optimal

protocol

-LRB-

requiring

O

-LRB-

E

N

log

N

-RRB-

messages

-RRB-

was

given

to

construct

a

minimum

spanning

tree

-LRB-

MST

-RRB-

The

time

complexity

of

this

protocol

was

shown

to

be

O

-LRB-

N

log

N

-RRB-

which

is

not

optimal

This

protocol

maintains

a

spanning

forest

of

trees

-LRB-

referred

to

as

fragments

-RRB-

each

of

which

is

a

subtree

of

the

MST

Fragments

are

merged

over

their

minimum

weight

outgoing

edges

until

a

single

fragment

which

spans

the

entire

network

remains

In

order

to

keep

the

message

complexity

low

each

fragment

has

a

level

number

associated

with

it

which

is

a

measure

of

the

number

of

nodes

in

the

fragment

A

fragment

F

at

a

higher

level

which

makes

a

request

to

join

with

a

fragment

at

a

lower

level

is

made

to

wait

until

the

smaller

fragment

grows

to

the

point

where

its

level

number

is

equal

to

or

greater

than

F

s

level

number

Due

to

this

the

execution

time

is

determined

by

the

slowest

growing

fragment

This

may

result

in

a

large

execution

time

-LSB-

-RSB-

-LSB-

-RSB-

proposed

improved

message

optimal

protocols

for

this

problem

with

time

complexity

O

-LRB-

N

log?N

-RRB-

where

log?N

minfk

logkN

and

logkN

is

the

log

function

applied

successively

k

times

to

N

Finally

a

message

optimal

protocol

with

O

-LRB-

N

-RRB-

time

complexity

was

given

in

-LSB-

-RSB-

This

protocol

involves

an

initial

phase

in

which

the

number

of

nodes

in

the

network

are

counted

by

constructing

a

spanning

tree

This

phase

requires

O

-LRB-

N

-RRB-

time

on

all

networks

since

the

spanning

tree

constructed

is

arbitrary

and

can

have

O

-LRB-

N

-RRB-

diameter

Hence

the

protocol

in

-LSB-

-RSB-

requires

O

-LRB-

N

-RRB-

time

on

all

networks

In

this

paper

we

show

that

the

time

complexity

of

-LSB-

-RSB-

can

also

be

expressed

as

O

-LRB-

-LRB-

D

d

-RRB-

log

N

-RRB-

where

D

is

the

maximum

degree

of

a

node

and

d

is

the

diameter

of

the

MST

The

protocol

in

-LSB-

-RSB-

will

therefore

perform

better

than

the

protocol

in

-LSB-

-RSB-

whenever

D

d

is

less

than

N

log

N

Hence

the

protocol

in

-LSB-

-RSB-

is

not

optimal

for

a

large

class

of

networks

We

present

a

protocol

CompMST

which

requires

O

-LRB-

min

-LRB-

N

-LRB-

D

d

-RRB-

log

N

-RRB-

-RRB-

time

and

O

-LRB-

E

N

log

N

log

N

log

log

N

-RRB-

messages

To

arrive

at

this

protocol

we

first

develop

a

protocol

Async

In

Async

a

fragment

does

not

wait

for

another

fragment

to

reach

a

particular

level

before

it

can

combine

with

it

The

protocol

takes

at

most

O

-LRB-

min

-LRB-

N

-LRB-

D

d

-RRB-

log

N

-RRB-

-RRB-

time

and

O

-LRB-

-RRB-

messages

Although

it

is

not

message

optimal

it

requires

O

-LRB-

E

N

log

N

-RRB-

messages

after

all

fragments

have

reached

size

N

log

N

Similarly

the

protocols

in

-LSB-

-RSB-

-LSB-

-RSB-

are

not

time

optimal

but

require

O

-LRB-

min

-LRB-

N

-LRB-

D

d

-RRB-

log

N

-RRB-

-RRB-

time

up

to

the

point

at

which

all

fragments

have

size

at

least

N

log

N

We

combine

the

features

of

Async

and

the

protocol

in

-LSB-

-RSB-

to

obtain

CompMST

We

relax

the

requirement

of

balanced

growth

and

require

a

fragment

at

level

l

to

wait

for

a

neighboring

fragment

to

reach

a

level

greater

than

or

equal

to

l?log

l

before

combining

with

it

This

protocol

behaves

like

the

protocol

in

-LSB-

-RSB-

when

fragment

size

is

small

After

the

fragment

size

reaches

N

log

N

its

behavior

is

identical

to

that

of

Async

The

time

complexity

of

CompMST

is

equal

to

the

protocol

of

-LSB-

-RSB-

for

networks

in

which

D

d

N

log

N

and

to

the

protocol

of

-LSB-

-RSB-

for

networks

in

which

D

d

N

log

N

Further

the

protocol

does

not

require

counting

the

number

of

nodes

as

in

-LSB-

-RSB-

In

CompMST

fast

growing

fragments

combine

more

often

and

hence

speed

up

the

execution

Its

message

complexity

although

not

optimal

for

general

networks

is

optimal

for

all

networks

in

which

E

N

log

N

log

N

log

log

N

The

time

complexity

of

protocols

in

-LSB-

-RSB-

-LSB-

-RSB-

can

be

expressed

as

O

-LRB-

min

-LRB-

N

log?N

-LRB-

D

d

-RRB-

log

N

-RRB-

-RRB-

For

dense

networks

CompMST

is

an

improvement

over

the

protocols

in

-LSB-

-RSB-

-LSB-

-RSB-

However

for

sparse

networks

CompMST

improves

the

time

complexity

by

a

factor

of

log?N

at

the

expense

of

increasing

the

message

complexity

by

a

factor

of

log

N

log

log

N

Towards

this

end

we

give

a

technique

to

reduce

the

message

overhead

factor

of

CompMST

to

log

log

N

log

log

log

N

-LRB-

at

the

expense

of

increasing

the

time

complexity

by

a

constant

factor

-RRB-

This

report

is

organized

as

follows

In

the

next

section

we

describe

our

model

of

distributed

computation

In

Section

we

discuss

the

protocol

in

-LSB-

-RSB-

and

analyze

it

Section

describes

the

protocol

Async

In

Section

we

present

the

protocol

CompMST

and

its

analysis

Section

discusses

an

extension

to

the

protocol

and

Section

presents

the

conclusion

Model

In

this

problem

we

model

a

network

as

an

undirected

graph

with

N

nodes

-LRB-

which

represent

the

processors

of

the

network

-RRB-

and

E

edges

-LRB-

which

represent

the

communication

links

between

the

processors

-RRB-

All

nodes

are

assumed

to

have

distinct

identities

-LRB-

when

we

say

node

i

we

will

mean

a

node

with

identity

i

-RRB-

We

assume

that

all

edges

have

distinct

weights

and

each

process

knows

the

weight

of

all

edges

incident

on

it

The

nodes

communicate

via

messages

Message

are

not

lost

and

they

arrive

at

their

destination

within

finite

but

unpredictable

time

Further

messages

sent

over

an

edge

arrive

in

the

order

in

which

they

are

sent

On

the

initiation

of

the

protocol

we

assume

that

each

node

knows

the

weight

of

each

edge

incident

on

it

On

the

termination

of

the

protocol

each

node

knows

which

edges

incident

on

it

belong

to

the

minimum

spanning

tree

The

message

complexity

of

a

protocol

is

the

maximum

number

of

messages

sent

during

any

possible

execution

of

the

protocol

The

time

complexity

of

a

protocol

is

the

worst

case

execution

time

assuming

that

each

message

takes

at

most

one

time

unit

to

reach

its

destination

and

computation

time

is

negligible

Furthermore

intermessage

delay

on

a

link

is

at

most

one

time

unit

The

correctness

of

the

protocols

do

not

depend

on

this

assumption

The

MST

Protocol

of

-LSB-

-RSB-

In

-LSB-

-RSB-

a

protocol

was

given

to

construct

a

minimum

spanning

tree

-LRB-

MST

-RRB-

The

protocol

maintains

a

forest

of

rooted

trees

-LRB-

referred

to

as

fragments

-RRB-

The

root

of

a

fragment

is

the

root

of

the

corresponding

tree

and

the

root

's

identity

is

used

as

the

identity

of

the

fragment

The

best

edge

of

a

fragment

is

the

minimum

weight

edge

among

all

edges

leading

out

of

the

fragment

Each

fragment

has

a

level

number

associated

with

it

Fragments

containing

only

a

single

node

are

at

level

When

two

fragments

at

level

l

merge

a

new

fragment

at

level

l

is

created

For

such

a

level

numbering

scheme

it

can

be

shown

that

a

fragment

with

level

number

l

contains

at

least

nodes

Therefore

the

level

number

of

a

fragment

can

not

exceed

log

N

The

level

number

of

a

node

is

the

level

number

of

the

fragment

to

which

it

belongs

A

node

may

be

in

one

of

the

following

states

the

initial

state

Sleeping

-LRB-

a

node

is

in

this

state

until

it

starts

executing

the

protocol

-RRB-

the

state

Find

while

participating

in

a

fragment

's

search

for

its

best

edge

and

the

state

Found

at

other

times

When

a

node

wakes

up

it

changes

state

to

Find

and

sends

messages

to

awaken

all

neighbors

The

algorithm

starts

with

each

node

as

a

separate

fragment

Fragments

are

merged

iteratively

on

the

best

edges

and

the

algorithm

terminates

when

only

one

fragment

which

spans

the

entire

network

remains

In

each

iteration

a

fragment

determines

its

best

edge

and

combines

with

the

fragment

at

the

other

end

of

the

best

edge

When

two

fragments

having

the

same

best

edge

e

combine

to

form

a

new

fragment

the

node

with

the

larger

identity

among

the

two

end-points

of

e

becomes

the

new

root

of

the

combined

fragment

It

then

initiates

the

next

iteration

for

finding

the

best

edge

of

the

combined

fragment

To

initiate

an

iteration

the

root

of

a

fragment

changes

its

state

to

Find

and

sends

an

initiate

message

containing

the

fragment

identity

the

level

number

and

the

state

Find

to

all

nodes

in

the

fragment

After

receiving

this

message

node

i

updates

its

fragment

identity

and

level

number

Node

i

then

changes

its

state

to

Find

and

picks

a

local

best

edge

which

is

the

minimum

weight

edge

incident

on

the

node

which

leads

out

of

the

fragment

The

root

then

picks

the

global

minimum

weight

edge

among

these

local

best

edges

Each

node

i

keeps

the

identity

of

edges

incident

on

it

sorted

according

to

their

weights

in

a

list

unusedi

In

order

to

find

its

minimum

weight

outgoing

edge

node

i

picks

the

next

edge

-LRB-

i

j

-RRB-

from

unusedi

and

sends

a

test

message

with

its

fragment

identity

and

the

level

number

over

this

edge

When

site

j

receives

a

test

message

from

i

it

behaves

as

follows

If

the

fragment

identity

of

j

agrees

with

that

of

i

then

i

and

j

belong

to

the

same

fragment

and

therefore

j

responds

by

sending

a

reject

message

When

a

reject

message

from

j

is

received

by

i

it

deletes

the

edge

-LRB-

i

j

-RRB-

from

the

list

unusedi

and

continues

by

sending

a

test

message

over

the

next

edge

in

its

list

If

the

fragment

identities

of

i

and

j

are

different

and

the

level

number

of

j

is

greater

than

or

equal

to

that

of

i

it

sends

an

accept

message

to

i

-LRB-

which

indicates

that

-LRB-

i

j

-RRB-

is

an

outgoing

edge

-RRB-

Otherwise

j

delays

the

response

until

its

level

number

becomes

at

least

as

large

as

that

of

i

This

delay

is

required

because

when

two

fragments

join

the

nodes

in

these

fragments

-LRB-

other

than

the

roots

-RRB-

are

not

immediately

informed

of

the

identity

and

level

number

of

the

new

fragment

For

example

consider

the

situation

of

Figure

in

which

fragments

F

and

G

both

f

f

f

f

XXXXXXXXXX

GF

j

i

yx

Figure

Example

illustrating

the

merge

of

F

and

G

at

level

l

combine

on

the

edge

-LRB-

x

y

-RRB-

If

x

y

then

x

will

be

root

of

the

combined

fragment

Then

the

fragment

identity

and

level

number

of

nodes

in

the

combined

fragment

will

have

to

be

changed

When

a

node

i

-LRB-

originally

in

F

-RRB-

receives

the

initiate

message

it

updates

its

level

number

to

l

and

fragment

identity

and

starts

the

process

of

finding

its

local

best

edge

Consider

the

case

when

i

sends

a

test

message

to

site

j

-LRB-

originally

in

G

-RRB-

Site

j

may

not

have

received

the

initiate

message

from

x

containing

the

new

fragment

identity

and

hence

thinks

it

is

still

in

G.

Therefore

its

fragment

identity

will

be

different

from

that

of

i.

However

the

level

number

of

j

at

this

point

will

be

l

-LRB-

which

will

be

updated

to

l

on

the

receipt

of

the

initiate

message

-RRB-

Hence

it

will

delay

the

response

to

the

test

message

from

i.

Therefore

by

delaying

the

reply

until

the

level

number

of

j

is

at

least

as

high

as

that

of

i

the

algorithm

ensures

that

j

will

respond

correctly

After

the

nodes

in

a

fragment

have

found

their

local

best

edges

they

must

cooperate

to

find

the

fragment

's

global

best

edge

For

this

purpose

after

a

leaf

node

has

determined

its

local

best

edge

e

it

sends

a

report

message

to

its

parent

with

the

weight

of

e

A

non-leaf

node

waits

until

it

has

found

its

local

best

edge

and

received

report

messages

from

all

of

its

children

The

node

then

sends

the

smallest

of

these

edge

weights

to

its

parent

in

a

report

message

The

global

minimum

emin

is

then

picked

by

the

root

which

sends

a

message

change-root

to

the

node

in

the

fragment

with

emin

as

an

incident

edge

This

node

becomes

the

new

root

of

the

fragment

and

it

sends

a

connect

message

with

its

level

number

over

emin

This

marks

the

end

of

the

iteration

The

merging

of

the

fragments

depends

on

the

level

numbers

Let

site

j

which

is

in

fragment

G

at

level

lj

receive

a

connect

message

from

site

i

which

is

in

fragment

F

at

level

li

We

have

the

following

cases

to

consider

lj

li

Before

sending

a

connect

message

to

j

i

must

have

sent

a

test

message

to

j

to

determine

whether

-LRB-

i

j

-RRB-

is

an

outgoing

edge

Since

j

has

a

smaller

level

number

it

will

delay

responding

to

the

test

message

until

its

level

number

becomes

at

least

li

Hence

this

case

is

not

possible

lj

li

In

this

case

site

j

delays

responding

to

the

connect

message

until

its

level

number

becomes

greater

than

li

-LRB-

in

which

case

it

behaves

as

in

case

-RRB-

or

as

a

result

of

receiving

a

change-root

message

from

the

root

of

G

it

finds

that

-LRB-

i

j

-RRB-

is

the

best

edge

of

G

also

If

-LRB-

i

j

-RRB-

is

the

best

edge

of

G

then

F

and

G

are

merged

If

j

i

then

j

becomes

the

root

of

the

combined

fragment

It

increases

its

level

number

by

one

and

initiates

a

new

iteration

by

sending

an

initiate

message

to

its

neighbors

Otherwise

it

sends

a

connect

message

to

i

and

i

becomes

the

new

root

lj

li

-LRB-

a

-RRB-

If

site

j

has

received

an

initiate

message

and

not

yet

sent

the

report

message

then

it

sends

an

initiate

message

with

fragment

identity

G

level

number

lj

and

state

Find

to

i

and

waits

for

a

report

message

from

i

before

sending

its

report

message

Thus

F

is

absorbed

in

G

as

part

of

G

's

current

iteration

-LRB-

b

-RRB-

If

j

has

sent

the

report

message

then

its

local

best

edge

must

have

a

weight

smaller

than

that

of

-LRB-

i

j

-RRB-

-LRB-

the

edge

-LRB-

i

j

-RRB-

can

not

be

the

local

best

edge

of

j

because

i

will

not

respond

to

a

test

message

from

j

since

i

is

in

a

lower

level

fragment

-RRB-

Then

the

local

best

edge

of

j

has

a

weight

smaller

than

the

minimum

weight

outgoing

edge

of

F

Therefore

the

participation

of

F

in

the

search

for

the

best

edge

of

G

is

not

required

In

this

case

the

state

Found

is

included

in

the

initiate

message

to

i

A

node

which

receives

an

initiate

message

with

state

Found

changes

its

state

to

Found

updates

its

level

number

and

fragment

identity

and

propagates

the

message

to

its

children

However

it

does

not

engage

in

finding

the

local

best

edge

and

sending

a

report

message

Lemma

The

message

complexity

of

the

protocol

is

O

-LRB-

E

N

log

N

-RRB-

Proof

Since

the

level

number

of

a

fragment

can

be

at

most

log

N

and

the

level

number

increases

after

each

iteration

a

node

can

participate

in

at

most

log

N

iterations

In

an

iteration

each

node

in

a

fragment

can

receive

at

most

one

initiate

and

one

accept

message

It

can

transmit

at

most

one

report

and

one

change-root

or

connect

message

Hence

if

we

disregard

the

test

and

the

reject

messages

then

a

node

can

send

only

a

constant

number

of

messages

in

each

iteration

This

accounts

for

at

most

O

-LRB-

N

log

N

-RRB-

messages

At

most

two

reject

messages

are

sent

over

each

edge

These

messages

will

contribute

a

sum

of

O

-LRB-

E

-RRB-

Each

test

message

is

responded

to

by

either

a

reject

or

an

accept

message

Since

there

are

at

most

O

-LRB-

E

-RRB-

reject

messages

and

at

most

O

-LRB-

N

log

N

-RRB-

accept

messages

there

can

be

at

most

O

-LRB-

E

N

log

N

-RRB-

test

messages

Thus

the

message

complexity

of

the

protocol

is

O

-LRB-

E

N

log

N

-RRB-

Let

tl

be

the

time

at

which

the

node

with

the

smallest

level

number

changes

its

level

number

to

at

least

l.

Let

d

be

the

diameter

of

the

MST

and

D

be

the

maximum

degree

of

a

node

Since

a

message

is

initially

broadcast

to

all

nodes

every

node

will

receive

it

within

O

-LRB-

d

-RRB-

time

and

form

a

fragment

with

level

Hence

O

-LRB-

d

-RRB-

We

now

obtain

an

upper

bound

on

tl

tl

-LRB-

which

is

the

time

interval

for

which

l

is

the

lowest

level

in

the

network

-RRB-

Lemma

All

fragments

with

level

number

l

at

time

tl

will

send

a

connect

message

by

time

tl

Proof

A

node

i

in

fragment

F

reaches

level

l

when

it

receives

an

initiate

message

with

level

number

l

After

receiving

this

message

it

must

find

its

local

best

edge

It

can

send

at

most

D

test

messages

Since

the

level

number

of

any

node

is

at

least

l

the

response

to

a

test

message

sent

by

i

will

not

be

delayed

Therefore

site

i

will

find

its

local

best

edge

within

time

units

The

propagation

of

the

report

and

the

change-root

messages

will

take

at

most

time

units

Therefore

a

connect

message

will

be

sent

by

F

within

time

units

after

time

tl

Lemma

The

time

complexity

of

the

protocol

is

O

-LRB-

-LRB-

d

D

-RRB-

log

N

-RRB-

Proof

Let

F

be

a

fragment

at

level

l

at

time

tl

Then

from

Lemma

it

will

send

a

connect

message

within

the

next

d

time

units

Now

we

have

to

consider

the

time

for

which

fragment

F

has

to

wait

until

its

request

to

merge

results

in

a

level

increase

If

the

connect

message

reaches

a

fragment

with

a

higher

level

number

then

the

level

number

is

propagated

immediately

to

nodes

in

F

in

an

initiate

message

which

will

take

at

most

d

time

units

to

reach

all

nodes

in

F

As

a

result

all

nodes

in

F

will

have

increased

their

level

number

by

time

tl

If

the

connect

message

reaches

a

fragment

G

at

level

l

and

the

best

edge

of

G

is

the

same

as

that

of

F

then

F

and

G

will

merge

immediately

to

form

a

fragment

with

level

l

Since

G

is

also

at

level

l

it

will

also

send

a

connect

message

by

time

tl

The

new

level

number

will

reach

all

nodes

in

F

within

d

additional

time

units

and

therefore

all

nodes

in

F

will

have

increased

their

level

number

by

time

tl

If

the

connect

message

reaches

a

fragment

G

at

level

l

and

the

best

edge

of

G

is

not

the

same

as

that

of

F

then

a

response

to

the

connect

message

will

be

delayed

In

general

we

may

have

a

sequence

of

fragments

Fm

all

at

level

l

where

F

and

the

connect

message

of

Fi

arrives

at

a

node

in

Fi

where

i

m

and

the

best

edge

of

Fm

leads

to

a

fragment

with

a

higher

level

number

or

to

Fm

If

the

best

edge

of

Fm

leads

to

a

higher

level

fragment

with

level

number

then

an

initiate

message

with

level

number

will

be

immediately

propagated

to

nodes

in

Fm

Further

nodes

in

Fi

will

propagate

this

message

to

nodes

in

Fi

until

it

reaches

nodes

in

Since

the

sum

of

the

diameters

of

Fi

i

m

is

bounded

by

d

the

nodes

in

will

receive

the

initiate

message

within

d

time

units

If

the

best

edge

of

Fm

leads

to

Fm

then

Fm

and

Fm

will

merge

to

form

a

fragment

at

level

l

In

this

case

again

an

initiate

message

with

level

number

l

will

be

sent

which

will

reach

all

nodes

in

within

d

time

units

Hence

nodes

in

F

will

increase

their

level

numbers

within

time

units

after

time

tl

Therefore

tl

tl

O

-LRB-

D

d

-RRB-

The

time

complexity

of

the

protocol

is

given

by

PlogN

l

-LRB-

tl

tl

-RRB-

O

-LRB-

d

-RRB-

PlogN

l

O

-LRB-

D

d

-RRB-

O

-LRB-

-LRB-

d

D

-RRB-

log

N

-RRB-

A

protocol

with

O

-LRB-

N

-RRB-

time

complexity

was

given

in

-LSB-

-RSB-

The

protocol

proceeds

in

the

following

two

stages

In

the

first

stage

a

spanning

tree

of

the

network

is

found

The

number

of

nodes

in

the

network

are

counted

using

this

spanning

tree

The

second

stage

involves

finding

the

minimum

spanning

tree

In

this

stage

a

fragment

behaves

as

in

the

protocol

of

-LSB-

-RSB-

up

to

the

point

at

which

its

size

is

at

least

N

log

N

After

the

size

of

a

fragment

reaches

N

log

N

-LRB-

which

can

be

determined

since

N

is

now

known

-RRB-

it

executes

two

additional

procedures

Root-update

and

Test-distance

which

enables

the

fragment

to

update

its

level

number

more

quickly

thereby

reducing

the

time

complexity

Since

the

spanning

tree

constructed

in

the

first

phase

is

arbitrary

it

can

have

a

diameter

of

O

-LRB-

N

-RRB-

Therefore

the

time

complexity

of

this

protocol

is

O

-LRB-

N

-RRB-

for

all

networks

Hence

this

protocol

is

not

optimal

for

many

classes

of

networks

For

example

if

d

O

-LRB-

log

N

-RRB-

and

D

O

-LRB-

log

N

-RRB-

then

the

protocol

of

-LSB-

-RSB-

will

require

at

most

O

-LRB-

-LRB-

log

N

-RRB-

-RRB-

time

units

A

minimum

spanning

tree

protocol

In

this

section

we

develop

a

protocol

Async

in

which

we

do

not

maintain

level

numbers

The

response

to

a

test

message

is

therefore

not

delayed

on

the

basis

of

level

numbers

However

level

numbers

are

required

in

the

protocol

of

-LSB-

-RSB-

to

ensure

that

the

outgoing

edges

are

correctly

identified

For

this

purpose

we

execute

each

iteration

in

two

phases

In

the

first

phase

the

fragment

identity

is

propagated

to

all

sites

in

the

fragment

After

this

phase

is

over

the

root

initiates

the

second

phase

for

finding

the

best

edge

The

protocol

starts

with

all

nodes

as

individual

fragments

Fragments

are

merged

iteratively

over

the

best

edges

until

a

single

fragment

remains

Each

iteration

is

executed

in

two

phases

First-Phase

The

root

of

a

fragment

initiates

the

first

phase

by

sending

an

message

with

the

fragment

identity

-LRB-

which

is

the

identity

of

the

root

-RRB-

as

a

parameter

to

its

children

On

receiving

the

message

a

node

updates

its

fragment

identity

and

propagates

to

its

children

When

the

message

reaches

a

leaf

node

it

sends

a

finish

message

to

its

parent

An

intermediate

site

waits

for

a

finish

message

from

all

children

before

sending

a

finish

message

to

its

parent

When

the

root

receives

a

finish

message

from

all

children

it

knows

that

all

nodes

in

the

fragment

know

the

current

fragment

identity

The

root

then

initiates

the

second

phase

Second-Phase

The

root

of

a

fragment

initiates

the

second

phase

by

sending

to

its

children

In

this

phase

the

best

edge

of

the

fragment

is

found

The

process

of

finding

the

best

edge

is

the

same

as

in

-LSB-

-RSB-

A

node

sends

a

test

message

over

an

edge

to

ascertain

that

the

edge

is

outgoing

However

the

reply

to

a

test

message

is

not

delayed

-LRB-

because

if

the

receiving

node

is

in

the

same

fragment

then

it

must

know

the

correct

fragment

identity

since

the

first

phase

of

the

iteration

has

completed

-RRB-

After

a

node

has

determined

its

local

best

edge

it

propagates

this

edge

weight

towards

the

root

using

report

messages

The

root

picks

the

edge

with

the

minimum

weight

among

the

local

best

edges

and

send

a

change-root

message

to

the

node

in

the

fragment

with

this

as

an

incident

edge

This

node

becomes

the

new

root

of

the

fragment

and

sends

a

connect

message

over

the

best

edge

in

an

attempt

to

combine

with

the

fragment

at

the

other

end

Consider

the

case

when

a

connect

message

from

a

site

i

in

fragment

F

reaches

a

site

j

which

is

in

fragment

G

We

have

the

following

cases

-LRB-

a

-RRB-

If

j

has

received

and

has

not

yet

sent

a

finish

message

then

j

treats

-LRB-

i

j

-RRB-

as

an

edge

of

the

fragment

and

sends

to

i.

Further

site

j

waits

for

a

finish

message

from

i

before

sending

its

finish

message

In

this

case

nodes

in

F

are

absorbed

in

G

as

part

of

the

current

iteration

of

G.

-LRB-

b

-RRB-

If

j

has

already

sent

its

finish

message

then

the

response

to

the

connect

message

is

delayed

If

-LRB-

i

j

-RRB-

is

also

the

best

edge

of

G

then

G

will

also

send

a

connect

message

over

this

edge

and

F

and

G

will

merge

ending

the

iteration

The

node

with

the

larger

identity

among

the

two

end-points

of

the

best

edge

will

become

the

new

root

of

the

combined

fragment

and

will

initiate

the

next

iteration

Otherwise

when

j

gets

message

during

the

first

phase

of

the

next

iteration

it

will

send

an

message

to

i

and

as

a

result

F

will

be

absorbed

as

a

part

of

that

iteration

Hence

fragments

are

absorbed

only

while

a

site

is

executing

the

first

phase

No

new

sites

are

added

to

a

fragment

while

it

is

executing

its

second

phase

As

in

-LSB-

-RSB-

when

a

node

wakes

up

it

sends

messages

to

awaken

all

neighbors

Time

and

Message

Complexity

Analysis

We

define

the

level

number

of

a

fragment

F

to

be

blog

jF

jc

where

jF

j

is

the

number

of

nodes

which

receive

the

message

in

the

first

phase

The

level

number

of

a

fragment

does

not

change

during

the

second

phase

since

no

new

nodes

are

added

during

this

phase

A

fragment

may

be

in

one

of

the

following

states

active

or

inactive

-LRB-

these

states

have

been

introduced

for

complexity

analysis

only

and

a

fragment

does

not

know

which

state

it

is

in

-RRB-

Initially

all

fragments

are

active

An

active

fragment

F

becomes

inactive

when

the

connect

message

sent

by

a

node

in

F

reaches

its

destination

A

new

active

fragment

F

is

formed

when

the

root

of

F

is

found

and

it

initiates

a

new

iteration

Note

that

the

level

number

of

a

fragment

is

determined

only

when

its

first

phase

completes

We

say

that

an

active

fragment

F

has

level

l

at

time

t

-LRB-

even

if

it

is

executing

its

first

phase

at

time

t

-RRB-

if

l

blog

jF

jc

at

the

end

of

its

first

phase

Lemma

Let

F

be

a

fragment

with

level

number

l

Then

it

takes

at

most

-LRB-

-RRB-

time

units

to

execute

the

iteration

Proof

There

can

be

at

most

nodes

in

F

It

will

take

at

most

time

units

for

the

message

to

reach

all

nodes

and

at

most

time

units

for

the

finish

messages

to

reach

the

root

Further

it

will

take

at

most

time

units

for

the

message

to

reach

all

nodes

in

the

fragment

A

node

can

take

at

most

time

units

to

find

its

local

best

edge

since

at

most

reject

messages

can

be

received

-LRB-

because

reject

messages

can

only

be

received

from

nodes

in

the

same

fragment

-RRB-

The

propagation

of

report

and

the

change-root

messages

can

take

at

most

time

units

each

Hence

within

time

units

a

connect

message

will

be

sent

Lemma

The

execution

of

Async

takes

at

most

O

-LRB-

N

-RRB-

time

units

Proof

Let

tl

be

the

minimum

time

in

an

execution

after

which

no

active

fragment

with

level

less

than

or

equal

to

l

remains

At

the

beginning

of

the

execution

a

message

is

broadcast

to

awaken

all

nodes

This

message

will

reach

all

nodes

within

N

time

units

and

all

nodes

will

be

in

fragments

with

level

number

at

least

Hence

no

fragment

with

level

will

be

formed

after

time

N

and

therefore

O

-LRB-

N

-RRB-

We

will

now

show

that

tl

tl

O

-LRB-

-RRB-

Let

F

be

an

active

fragment

with

level

number

l

at

time

tl

If

F

has

not

already

sent

a

connect

message

then

in

the

worst

case

it

will

execute

the

first

phase

followed

by

the

second

phase

which

will

take

at

most

time

units

-LRB-

by

Lemma

-RRB-

Hence

a

connect

message

will

be

sent

within

time

units

after

time

tl

and

the

fragment

will

become

inactive

Thus

after

time

tl

all

active

fragments

which

were

at

level

l

at

time

tl

will

be

inactive

Let

F

be

a

fragment

at

level

l

formed

between

time

tl

and

tl

Then

a

connect

message

will

be

sent

within

time

units

and

the

fragment

will

become

inactive

This

connect

message

will

not

go

to

a

node

in

a

fragment

G

with

a

smaller

level

number

since

any

such

fragment

would

have

sent

a

connect

message

before

or

at

time

tl

and

would

have

been

absorbed

in

the

first

phase

Thus

G

must

have

level

at

least

l

and

therefore

F

will

merge

to

produce

a

fragment

of

size

at

least

l

Thus

no

new

active

fragment

at

level

l

will

be

formed

after

time

tl

Hence

after

time

no

active

fragment

with

level

l

will

remain

Therefore

tl

tl

O

-LRB-

-RRB-

Then

tlogN

PlogN

l

-LRB-

tl

tl

-RRB-

O

-LRB-

N

-RRB-

PlogN

l

O

-LRB-

-RRB-

O

-LRB-

N

-RRB-

O

-LRB-

-RRB-

O

-LRB-

N

-RRB-

No

active

fragments

with

level

less

than

log

N

will

remain

after

time

tlogN

From

the

fact

that

there

can

be

at

most

one

fragment

with

level

log

N

and

before

the

termination

there

must

be

some

active

fragment

only

one

fragment

which

contains

all

the

nodes

will

be

present

after

time

tlogN

This

fragment

will

determine

that

there

exist

no

outgoing

edge

within

N

time

and

the

protocol

will

terminate

Hence

the

execution

time

of

the

protocol

is

O

-LRB-

N

-RRB-

Lemma

The

protocol

takes

at

most

O

-LRB-

-LRB-

d

D

-RRB-

log

N

-RRB-

time

Proof

We

modify

the

proof

given

in

Lemma

as

follows

The

execution

of

the

first

phase

of

a

fragment

F

can

take

at

most

time

units

Since

a

node

can

send

at

most

D

test

messages

it

will

take

at

most

time

units

to

find

the

local

best

edge

The

propagation

of

report

and

change-root

messages

will

take

a

total

of

at

most

time

units

Hence

a

fragment

at

level

l

will

send

a

connect

message

within

-LRB-

-RRB-

time

units

after

tl

Therefore

in

the

proof

of

Lemma

we

can

replace

by

-LRB-

-RRB-

Then

it

follows

that

tl

tl

O

-LRB-

D

d

-RRB-

and

PlogN

l

-LRB-

tl

tl

-RRB-

O

-LRB-

-LRB-

D

d

-RRB-

log

N

-RRB-

Therefore

the

protocol

will

take

at

most

O

-LRB-

-LRB-

d

D

-RRB-

log

N

-RRB-

time

units

From

Lemma

and

Lemma

we

have

that

the

time

complexity

of

Async

is

O

-LRB-

min

-LRB-

N

-LRB-

d

D

-RRB-

log

N

-RRB-

-RRB-

Lemma

The

message

complexity

of

the

protocol

is

O

-LRB-

-RRB-

Proof

Consider

a

fragment

F

with

k

nodes

at

the

end

of

its

first

phase

In

the

first

phase

each

node

can

receive

at

most

one

message

and

send

at

most

one

finish

message

Therefore

the

first

phase

must

have

required

at

most

O

-LRB-

k

-RRB-

messages

In

the

second

phase

each

node

can

receive

at

most

one

and

one

accept

message

Each

node

can

transmit

at

most

one

change-root

one

report

and

one

connect

message

Hence

if

we

disregard

the

test

and

the

reject

messages

at

most

O

-LRB-

k

-RRB-

messages

will

be

required

to

execute

both

phases

Therefore

in

the

worst

case

at

most

O

-LRB-

N

-RRB-

messages

will

be

required

to

add

an

edge

to

the

spanning

forest

Adding

N

edges

will

therefore

require

O

-LRB-

-RRB-

messages

At

most

two

reject

messages

are

sent

over

each

link

Since

E

these

messages

will

contribute

a

sum

of

O

-LRB-

-RRB-

Each

test

message

is

responded

to

by

either

a

reject

or

an

accept

message

Since

there

are

at

most

O

-LRB-

-RRB-

reject

and

accept

messages

there

can

be

at

most

O

-LRB-

-RRB-

test

messages

Thus

the

message

complexity

of

the

protocol

is

O

-LRB-

-RRB-

Lemma

The

protocol

requires

at

most

O

-LRB-

E

N

log

N

-RRB-

messages

after

the

size

of

each

fragment

is

at

least

N

log

N

Proof

There

can

be

at

most

log

N

fragments

of

size

at

least

N

log

N

Hence

only

-LRB-

log

N

-RRB-

more

edges

will

be

needed

to

complete

the

MST

when

all

fragments

have

size

at

least

N

log

N

In

the

worst

case

addition

of

an

edge

can

take

at

most

O

-LRB-

N

-RRB-

messages

-LRB-

Lemma

-RRB-

Therefore

if

we

disregard

the

test

and

the

reject

messages

at

most

O

-LRB-

N

log

N

-RRB-

messages

will

be

required

to

add

log

N

edges

At

most

two

reject

messages

are

sent

over

each

link

Therefore

there

can

be

at

most

O

-LRB-

E

-RRB-

reject

messages

Each

test

message

is

responded

to

by

either

a

reject

or

an

accept

message

Since

there

are

at

most

O

-LRB-

N

log

N

-RRB-

accept

messages

and

O

-LRB-

E

-RRB-

reject

messages

there

can

be

at

most

O

-LRB-

E+N

log

N

-RRB-

test

messages

Therefore

the

protocol

will

send

at

most

O

-LRB-

E

N

log

N

-RRB-

messages

after

the

size

of

all

fragments

is

at

least

N

log

N

A

Composite

protocol

Although

the

protocol

Async

is

not

message

optimal

at

most

O

-LRB-

E

N

log

N

-RRB-

messages

and

O

-LRB-

min

-LRB-

N

-LRB-

D

d

-RRB-

log

N

-RRB-

-RRB-

time

units

are

required

after

the

size

of

all

fragments

is

at

least

N

log

N

-LRB-

Lemma

and

-RRB-

The

protocol

in

-LSB-

-RSB-

requires

O

-LRB-

N

log?N

-RRB-

time

and

O

-LRB-

E

N

log

N

-RRB-

messages

However

it

was

shown

in

-LSB-

-RSB-

that

this

protocol

requires

O

-LRB-

min

-LRB-

N

-LRB-

D

d

-RRB-

log

N

-RRB-

-RRB-

time

and

O

-LRB-

E+N

log

N

-RRB-

messages

up

to

the

point

at

which

all

fragments

have

size

at

least

N

log

N

We

can

obtain

a

protocol

with

O

-LRB-

min

-LRB-

N

-LRB-

D

d

-RRB-

log

N

-RRB-

-RRB-

time

complexity

and

O

-LRB-

E

N

log

N

-RRB-

message

complexity

by

executing

the

protocol

in

-LSB-

-RSB-

up

to

the

point

at

which

all

fragments

have

size

N

log

N

and

the

protocol

Async

thereafter

This

however

requires

that

the

number

of

nodes

in

the

network

be

known

to

all

nodes

so

that

a

switch

between

protocols

can

be

made

by

a

fragment

when

its

size

reaches

at

least

N

log

N

However

determining

the

number

of

nodes

in

a

network

is

as

difficult

as

finding

the

spanning

tree

In

-LSB-

-RSB-

a

protocol

for

counting

the

number

of

nodes

with

O

-LRB-

E

N

log

N

-RRB-

messages

and

O

-LRB-

N

-RRB-

time

was

given

The

protocol

is

very

complicated

and

the

constants

involved

are

high

In

this

section

we

develop

a

protocol

CompMST

which

does

not

require

knowledge

of

the

number

of

nodes

CompMST

behaves

like

the

protocol

in

-LSB-

-RSB-

when

the

fragment

size

is

small

and

like

Async

when

the

fragment

size

becomes

large

To

obtain

this

behavior

we

perform

synchronization

on

the

basis

of

the

fragment

size

In

contrast

to

Async

the

level

numbers

are

explicitly

stored

by

the

sites

and

we

require

that

the

response

to

a

test

message

sent

by

a

node

i

at

level

l

to

a

node

j

be

delayed

only

if

the

level

number

of

j

is

less

than

l-log

l

-LRB-

and

not

l

-RRB-

Since

log

l

increases

with

l

the

protocol

becomes

more

asynchronous

as

l

increases

In

particular

as

we

will

show

later

this

protocol

behaves

like

Async

when

all

fragments

have

size

at

least

N

log

N

oeoeoeoe

li

lj

level

lj

G

Fm

jm

im

jm

li

li

C

Fm

i

j

Figure

Fragments

Fm

are

absorbed

in

G.

Further

in

CompMST

we

want

the

level

number

of

a

fragment

to

be

proportional

to

the

amount

of

time

it

has

to

wait

before

updating

its

level

number

The

changes

required

in

Async

to

obtain

this

behavior

are

explained

in

the

following

First-Phase

The

initiator

site

-LRB-

which

is

the

root

of

the

fragment

-RRB-

sends

message

to

its

children

with

its

current

level

number

and

the

fragment

identity

On

receiving

a

site

updates

its

level

number

and

fragment

identity

and

propagates

to

its

children

The

number

of

nodes

are

counted

while

propagating

the

finish

-LRB-

count

-RRB-

messages

where

count

is

the

number

of

nodes

in

the

subtree

rooted

at

the

node

sending

this

message

A

leaf

node

sends

a

finish

-LRB-

-RRB-

message

to

its

parent

After

site

i

has

received

a

finish

-LRB-

countm

-RRB-

message

from

each

child

m

it

sums

up

the

counts

received

from

the

children

adds

one

to

it

and

sends

the

resulting

number

in

a

finish

message

to

its

parent

The

first

phase

terminates

after

the

initiator

receives

a

finish

message

from

each

child

Let

M

be

the

sum

of

the

counts

received

from

the

children

by

the

initiator

The

initiator

site

then

updates

its

level

number

to

blog

-LRB-

M

-RRB-

c

This

may

be

greater

than

the

level

number

previously

stored

in

the

initiator

due

to

fragments

absorbed

during

the

first

phase

The

complexity

of

this

phase

is

the

same

as

in

Async

The

Second

Phase

is

modified

as

follows

The

initiator

site

propagates

its

new

level

number

in

the

messages

and

sites

update

their

level

numbers

on

receiving

this

message

The

level

number

of

a

node

is

included

in

the

test

messages

sent

by

it

If

a

node

j

receives

a

test

message

from

a

node

with

level

l

and

fragment

identity

differs

from

the

one

received

then

the

response

is

delayed

by

j

until

its

level

number

becomes

at

least

l-log

l

In

addition

we

use

a

protocol

Update

which

allows

a

node

to

update

the

level

number

and

fragment

identity

of

the

nodes

in

its

fragment

The

initiator

site

starts

the

protocol

by

sending

an

update

message

to

its

children

with

its

fragment

identity

and

level

number

in

it

On

receiving

update

-LRB-

level

id

-RRB-

site

i

updates

its

level

number

and

fragment

identity

and

propagates

the

update

message

to

its

children

Consider

the

case

considered

in

the

proof

of

Lemma

in

which

there

is

a

sequence

of

fragments

Fm

all

at

level

li

such

that

the

connect

message

of

Fi

arrives

at

a

node

in

Fi

-LRB-

shown

in

Figure

-RRB-

If

the

best

edge

of

Fm

leads

to

a

node

in

a

fragment

with

a

higher

level

number

lj

then

the

level

numbers

of

nodes

in

Fm

are

updated

to

lj

in

the

protocol

in

-LSB-

-RSB-

This

updating

may

take

up

to

Pmi

jFij

-LRB-

Sli

-RRB-

time

This

is

a

problem

since

we

want

a

node

that

waits

O

-LRB-

Sli

-RRB-

time

before

updating

its

level

number

to

be

able

to

increase

its

level

number

to

at

least

blog

Slic

and

it

may

be

the

case

that

blog

Slic

lj

For

this

purpose

we

have

to

count

the

number

of

nodes

in

C

and

update

the

level

number

accordingly

The

changes

required

in

the

protocol

for

this

are

explained

in

the

following

Consider

the

case

when

a

connect

message

from

i

in

fragment

F

at

level

li

is

received

by

a

node

j

in

fragment

G

at

level

lj

If

j

has

already

sent

a

connect

message

to

i

-LRB-

so

that

both

F

and

G

have

the

same

best

edge

-RRB-

then

F

and

G

are

merged

If

j

i

then

j

becomes

the

root

of

the

combined

fragment

and

initiates

a

new

iteration

Otherwise

i

becomes

the

new

root

If

j

has

not

sent

a

connect

message

to

i

then

j

behaves

as

follows

li

lj

In

this

case

site

j

delays

response

to

the

connect

message

until

its

level

number

becomes

at

least

li

-LRB-

the

connect

message

is

then

handled

as

described

in

case

below

-RRB-

or

it

sends

a

connect

message

to

i

-LRB-

in

this

case

the

fragments

are

merged

as

described

above

-RRB-

li

lj

We

have

the

following

subcases

-LRB-

-RRB-

Site

j

has

received

and

has

not

sent

the

finish

message

In

this

case

site

j

propagates

to

i

and

waits

for

a

finish

message

from

i

before

sending

a

finish

message

to

its

parent

Thus

F

is

absorbed

in

G

and

nodes

in

F

participate

in

the

current

iteration

of

the

protocol

in

G

-LRB-

this

is

the

same

as

in

protocol

Async

-RRB-

The

number

of

nodes

in

F

are

therefore

included

in

updating

the

level

number

of

G.

-LRB-

-RRB-

Site

j

has

sent

the

finish

message

and

li

lj

log

lj

In

this

case

since

j

has

already

sent

the

finish

message

the

nodes

in

F

will

not

be

included

in

updating

the

level

number

of

G.

Therefore

we

require

that

i

counts

the

number

of

nodes

in

F

and

reports

that

count

to

j

before

the

connect

message

is

processed

by

j.

To

do

this

site

j

sends

a

message

to

site

i

instructing

it

to

count

the

number

of

nodes

and

temporarily

refrains

from

sending

a

report

message

to

its

parent

in

G

if

it

has

not

already

sent

it

-LRB-

the

reason

for

this

is

that

as

we

shall

see

later

site

j

may

want

to

include

information

regarding

the

best

edge

from

F

in

its

report

message

-RRB-

On

receiving

this

message

site

i

updates

its

fragment

identity

to

i

and

then

initiates

First-Phase

to

count

the

number

of

nodes

Let

C

denote

the

fragment

rooted

at

i

after

the

completion

of

First-Phase

-LRB-

it

may

include

nodes

from

fragments

which

are

absorbed

by

F

during

the

first

phase

-RRB-

and

count

be

the

number

of

nodes

in

C

which

is

reported

to

i

when

First-Phase

completes

ffl

If

blog

countc

lj

then

site

i

decides

to

keep

C

distinct

from

G

It

notifies

j

of

this

fact

so

that

j

can

resume

execution

of

the

second

phase

in

G

In

addition

site

i

updates

its

level

number

to

blog

countc

and

initiates

Update

to

update

the

level

number

of

the

nodes

in

C.

ffl

If

blog

countc

lj

then

G

absorbs

C

In

this

case

i

notifies

j

of

its

decision

to

get

absorbed

and

then

updates

its

fragment

identity

to

G

and

level

number

to

lj

Further

it

initiates

Update

to

update

the

level

number

and

fragment

identity

of

nodes

in

its

subtree

If

j

has

not

already

sent

the

report

message

then

nodes

in

C

participate

in

the

second

phase

of

the

current

iteration

of

G

When

j

receives

-LRB-

or

if

it

has

already

received

it

-RRB-

it

propagates

it

to

oe

CG

k

p

j

i

Figure

G

absorbs

C

after

finishing

first

phase

i

and

waits

for

a

report

message

from

i

before

sending

its

report

message

To

see

that

the

outgoing

edges

will

be

correctly

identified

if

C

is

absorbed

in

G

consider

the

fragments

shown

in

Figure

Suppose

that

a

site

p

in

C

receives

a

test

message

from

a

node

k

in

G

If

p

has

received

the

update

message

then

the

fragment

identity

of

p

will

be

the

same

as

that

of

k

and

therefore

it

will

send

a

reject

message

If

p

has

not

received

update

then

its

level

number

-LRB-

li

-RRB-

will

be

less

than

lj

log

lj

-LRB-

lj

will

be

the

level

number

received

in

the

test

message

-RRB-

Therefore

the

response

to

the

test

message

will

be

delayed

until

the

level

number

of

p

increases

which

will

happen

only

after

it

receives

update

Hence

outgoing

edges

will

be

correctly

identified

-LRB-

-RRB-

Site

j

has

sent

the

finish

message

and

lj

li

lj

log

lj

In

this

case

nodes

in

F

can

not

participate

in

the

current

iteration

of

G

As

in

the

previous

case

site

i

updates

its

fragment

identity

to

i

and

initiates

First-Phase

However

site

j

does

not

refrain

from

sending

messages

to

its

parent

while

the

counting

is

in

progress

After

the

first

phase

is

over

site

i

updates

its

level

number

to

max

-LRB-

lj

blog

countc

-RRB-

where

count

is

the

number

of

nodes

reported

to

i

when

the

first

phase

completes

Site

i

then

initiates

Update

update

the

level

number

of

nodes

in

its

fragment

Lemma

The

message

complexity

of

CompMST

is

O

-LRB-

E

N

-LRB-

logN

-RRB-

log

log

N

-RRB-

Proof

Let

G

be

a

fragment

at

level

l

We

will

determine

the

maximum

number

of

messages

a

node

in

G

has

to

send

to

increase

its

level

number

Let

the

best

edge

of

G

lead

to

a

node

in

F

which

is

at

level

Consider

the

case

in

which

l

If

F

and

G

have

the

same

best

edge

then

they

will

merge

to

form

a

new

fragment

and

the

level

number

will

increase

by

at

least

in

the

next

iteration

If

the

best

edge

of

F

is

different

from

that

of

G

then

the

level

number

of

nodes

in

G

will

get

updated

to

at

least

using

update

messages

If

l

then

the

level

number

of

nodes

in

G

will

increase

If

l

then

in

the

next

iteration

the

number

of

nodes

counted

will

be

at

least

and

the

level

number

will

increase

to

at

least

l

Since

a

node

sends

a

constant

number

of

messages

in

an

iteration

a

node

in

G

will

send

a

constant

number

of

messages

in

both

cases

Now

consider

the

case

where

l

It

must

be

the

case

that

l

log

l

If

the

best

edge

of

F

is

not

the

same

as

that

of

G

then

a

response

to

the

connect

message

from

G

will

be

delayed

until

the

level

number

of

F

becomes

at

least

l

In

the

next

iteration

nodes

in

G

will

acquire

a

level

number

greater

than

l

-LRB-

since

nodes

in

G

and

F

will

be

included

in

updating

the

level

number

and

F

now

has

at

least

nodes

-RRB-

In

this

case

each

node

in

G

will

send

a

constant

number

of

messages

to

increase

its

level

number

If

F

and

G

have

the

same

best

edge

then

they

will

merge

to

form

a

new

fragment

However

since

l

merging

these

fragments

might

not

result

in

an

increase

in

the

level

number

of

G.

Hence

G

may

have

to

execute

several

iterations

to

increase

its

level

number

Let

G

merge

with

fragments

Fk

of

sizes

nk

respectively

where

nk

l

in

the

order

given

before

G

increases

its

level

number

Since

the

number

of

nodes

in

the

combined

fragment

does

not

exceed

in

each

of

the

k

iterations

executing

each

iteration

will

take

O

-LRB-

-RRB-

messages

if

we

disregard

the

test

update

and

the

reject

messages

-LRB-

the

analysis

is

similar

to

the

one

in

Lemma

-RRB-

Executing

the

first

phase

following

the

kth

iteration

will

again

take

O

-LRB-

-RRB-

messages

Therefore

O

-LRB-

k

-RRB-

messages

will

be

required

to

increase

the

level

number

of

nodes

in

G

We

will

now

count

the

total

increase

in

the

level

number

of

nodes

in

G

Fk

-LRB-

i

e

the

summation

of

the

change

in

level

number

for

each

node

in

these

fragments

-RRB-

Nodes

in

G

increase

their

level

by

-LRB-

which

results

in

a

total

increase

of

O

-LRB-

-RRB-

-RRB-

The

total

increase

in

level

number

of

nodes

in

fragment

Fi

is

at

least

L

O

-LRB-

ni

-LRB-

l

log

ni

-RRB-

-RRB-

O

-LRB-

ni

log

ni

-RRB-

Let

ai

ni

Then

L

O

-LRB-

log

ai

ai

-RRB-

Since

ni

l

ai

l.

Furthermore

log

ai

ai

log

l

l

Then

L

is

lower

bounded

by

O

-LRB-

log

l

l

-RRB-

Thus

the

total

level

increase

of

nodes

in

Fk

is

lower

bounded

by

O

-LRB-

log

l

l

-RRB-

Hence

the

number

of

messages

sent

per

level

increase

will

be

O

-LRB-

k

-LRB-

k

log

l

l

-RRB-

-RRB-

O

-LRB-

l

log

l

-RRB-

Since

l

log

l

is

an

increasing

function

of

l

the

maximum

number

of

messages

sent

per

level

increase

will

be

O

-LRB-

log

N

log

log

N

-RRB-

Since

the

sum

of

the

total

level

increase

during

the

execution

of

the

protocol

can

be

O

-LRB-

N

log

N

-RRB-

-LRB-

since

the

maximum

level

of

a

node

can

be

log

N

-RRB-

the

protocol

will

require

O

-LRB-

N

log

N

log

N

log

log

N

-RRB-

messages

There

can

be

at

most

one

update

message

received

by

a

node

for

each

level

number

Hence

these

messages

can

add

up

to

at

most

O

-LRB-

N

log

N

-RRB-

Further

at

most

two

reject

messages

are

sent

over

each

edge

These

messages

will

contribute

a

sum

of

O

-LRB-

E

-RRB-

Each

test

message

is

responded

to

by

either

a

reject

or

an

accept

message

Since

there

are

at

most

O

-LRB-

E

-RRB-

reject

messages

and

at

most

O

-LRB-

N

log

N

log

N

log

log

N

-RRB-

accept

messages

there

can

be

at

most

O

-LRB-

E

N

log

N

log

N

log

log

N

-RRB-

test

messages

The

message

complexity

of

the

protocol

is

therefore

O

-LRB-

E

N

log

N

log

N

log

log

N

-RRB-

We

evaluate

the

time

complexity

by

dividing

the

computation

into

two

stages

The

first

stage

involves

the

computation

up

to

the

point

at

which

all

fragments

have

size

at

least

N

log

N

We

show

that

the

execution

of

both

stages

takes

at

most

O

-LRB-

N

-RRB-

time

units

In

this

stage

let

tl

be

the

time

in

an

execution

at

which

the

node

with

the

smallest

level

number

changes

its

level

number

to

at

least

l

We

will

compute

an

upper

bound

on

tl

tl

Lemma

Let

F

be

a

fragment

whose

root

is

at

level

l

at

time

tl

If

the

level

number

of

the

root

of

F

remains

l

at

the

end

of

the

first

phase

then

the

execution

of

the

second

phase

of

F

will

take

at

most

O

-LRB-

jF

j

-RRB-

time

units

Proof

Let

F

be

a

fragment

whose

root

is

at

level

l

at

time

tl

Since

all

nodes

have

level

number

at

least

l

no

fragments

will

be

absorbed

during

the

second

phase

Thus

a

node

in

F

can

send

at

most

jF

j

test

messages

Therefore

it

will

take

at

most

j

time

units

to

find

the

local

best

edge

-LRB-

since

no

fragment

has

a

smaller

level

number

the

response

to

its

test

messages

will

not

be

delayed

-RRB-

The

propagation

of

report

and

change-root

messages

will

take

at

most

j

time

units

Lemma

The

execution

of

CompMST

takes

at

most

O

-LRB-

N

-RRB-

time

units

Proof

Let

F

be

a

fragment

whose

root

is

at

level

l

at

time

tl

If

F

has

not

already

sent

a

connect

message

then

in

the

worst

case

it

will

start

the

execution

of

the

first

phase

at

time

tl

We

have

the

following

cases

to

consider

-LRB-

-RRB-

The

level

number

of

the

root

of

F

remains

l

at

the

end

of

the

first

phase

In

this

case

it

will

take

at

most

O

-LRB-

jF

j

-RRB-

time

units

to

find

the

best

edge

-LRB-

Lemma

-RRB-

Now

we

have

to

consider

the

time

F

has

to

wait

until

its

request

to

merge

-LRB-

i

e

the

connect

message

sent

by

F

-RRB-

results

in

a

level

increase

As

observed

in

Lemma

the

worst

case

involves

a

sequence

Fm

of

fragments

all

at

level

l

where

F

and

the

connect

message

of

Fi

arrives

at

a

node

in

Fi

for

i

m.

For

a

given

level

l

there

may

be

several

such

sequences

in

an

execution

Consider

the

one

with

the

maximum

number

of

nodes

Let

Cl

denote

this

sequence

and

let

Sl

-LRB-

Pmk

jFk

j

-RRB-

We

have

the

following

subcases

to

consider

-LRB-

-RRB-

The

best

edge

of

Fm

leads

to

Fm

Fm

and

Fm

will

combine

to

form

a

new

fragment

F

at

level

number

l

and

start

the

first

phase

of

a

new

iteration

Each

of

the

fragments

Fi

i

m

will

be

absorbed

in

F

Hence

nodes

in

F

will

update

their

level

number

to

l

within

O

-LRB-

Sl

-RRB-

time

units

after

tl

Let

x

be

the

root

of

F

The

number

of

nodes

in

F

will

increase

to

at

least

Sl

and

will

be

known

to

x

at

the

end

of

the

first

phase

The

new

level

number

which

will

be

at

least

blog

Slc

will

reach

all

nodes

in

F

in

the

second

phase

-LRB-

-RRB-

The

best

edge

of

Fm

leads

to

a

node

j

which

is

in

fragment

G

with

a

higher

level

number

lj

We

have

the

following

subcases

ffl

If

j

has

not

sent

the

finish

message

then

it

will

propagate

the

message

with

level

number

lj

to

nodes

in

Fm

In

this

case

all

fragments

Fi

in

Cl

will

be

absorbed

in

G.

Hence

all

nodes

in

Cl

will

increase

their

level

number

within

O

-LRB-

Sl

-RRB-

time

units

If

blog

Slc

lj

then

nodes

in

Cl

will

increase

their

level

number

to

lj

with

O

-LRB-

Sl

-RRB-

time

units

If

blog

Slc

lj

then

all

nodes

in

Cl

will

receive

level

number

at

least

blog

Slc

in

the

second

phase

ffl

Now

consider

the

case

when

j

has

sent

the

finish

message

and

l

lj

log

lj

The

number

of

nodes

that

are

waiting

to

be

absorbed

in

G

-LRB-

which

are

the

nodes

in

Cl

-RRB-

are

counted

by

the

root

y

of

fragment

Fm

If

Sl

is

greater

than

or

equal

to

then

y

decides

to

keep

its

fragment

distinct

from

G

and

the

new

level

number

blog

Slc

is

propagated

to

all

nodes

in

fragment

via

update

messages

within

Sl

time

units

If

Sl

is

less

than

then

Fm

is

absorbed

in

G

In

this

case

y

updates

its

level

number

to

lj

and

initiates

Update

The

level

number

lj

-LRB-

blog

Slc

-RRB-

will

again

reach

all

nodes

in

O

-LRB-

Sl

-RRB-

time

units

ffl

If

j

has

sent

the

finish

message

and

lj

l

lj

log

lj

then

again

the

number

of

nodes

waiting

to

get

absorbed

in

G

are

counted

by

y

After

the

counting

is

over

y

updates

its

level

number

to

max

-LRB-

lj

blog

Slc

-RRB-

and

initiates

update

Thus

all

nodes

in

Cl

will

reach

level

at

least

blog

Slc

within

O

-LRB-

Sl

-RRB-

time

units

Hence

nodes

in

Cl

will

increase

their

level

number

to

at

least

l

within

O

-LRB-

Sl

-RRB-

time

units

after

time

tl

-LRB-

-RRB-

The

level

number

of

the

root

of

F

at

the

end

of

the

first

phase

is

greater

than

l

In

the

first

phase

F

can

only

absorb

fragments

at

level

l

-LRB-

since

all

fragments

are

at

level

at

least

l

-RRB-

In

the

worst

case

there

could

be

a

sequence

of

fragments

Fm

all

at

level

l

such

that

F

Fm

and

a

connect

message

from

Fi

arrives

at

Fi

where

i

m

In

this

case

all

fragments

Fi

i

m

will

get

absorbed

during

the

first

phase

of

Fm

The

first

phase

will

complete

in

O

-LRB-

Sl

-RRB-

time

and

the

level

number

of

nodes

will

increase

to

blog

Slc

within

O

-LRB-

Sl

-RRB-

time

units

after

time

tl

Hence

tl

tl

O

-LRB-

Sl

-RRB-

The

time

taken

by

the

first

stage

is

given

by

PlogN?log

log

N

l

-LRB-

tl

tl

-RRB-

Let

fl

l

log

-LRB-

N

log

N

-RRB-

and

Sl

N

log

Ng

and

fl

l

log

-LRB-

N

log

N

-RRB-

and

Sl

N

log

Ng

Then

PlogN?log

log

N

l

-LRB-

tl

tl

-RRB-

can

be

written

as

P

-LRB-

tl

tl

-RRB-

P

-LRB-

tl

tl

-RRB-

Since

tl

tl

O

-LRB-

Sl

-RRB-

we

have

that

P

-LRB-

tl

tl

-RRB-

P

O

-LRB-

Sl

-RRB-

PlogN?log

log

N

l

O

-LRB-

N

log

N

-RRB-

-LRB-

since

Sl

N

log

N

for

l

-RRB-

O

-LRB-

N

-RRB-

Let

l

Let

Cl

be

formed

from

the

sequence

Fm

of

fragments

all

at

level

l

If

the

best

edge

of

Fm

leads

to

Fm

then

a

new

fragment

is

formed

whose

nodes

are

counted

and

updated

to

at

least

blog

Slc

-LRB-

log

-LRB-

N

log

N

-RRB-

-RRB-

Otherwise

let

the

best

edge

of

Fm

lead

to

a

node

j

in

fragment

G

will

level

l

If

j

has

already

sent

the

finish

message

then

the

number

of

nodes

in

Cl

is

counted

and

the

level

number

is

updated

to

at

least

blog

Slc

If

j

has

not

sent

the

finish

message

then

Cl

is

absorbed

in

G

during

the

first

phase

of

the

current

iteration

of

G

At

the

end

of

this

first

phase

the

level

number

is

updated

to

at

least

blog

Slc

Hence

a

node

in

Cl

can

not

be

part

of

the

second

phase

of

a

fragment

with

level

log

-LRB-

N

log

N

-RRB-

Thus

before

the

level

number

of

a

node

in

Cl

exceeds

log

-LRB-

N

log

N

-RRB-

it

may

be

part

of

Cl

and

also

part

of

the

first

phase

of

an

iteration

of

another

fragment

with

level

where

l.

Hence

each

node

can

contribute

towards

at

most

two

level

numbers

in

Therefore

P

-LRB-

tl

tl

-RRB-

P

O

-LRB-

Sl

-RRB-

O

-LRB-

N

-RRB-

The

first

stage

will

therefore

take

at

most

O

-LRB-

N

-RRB-

time

units

The

second

stage

involves

the

execution

from

the

point

at

which

all

fragments

have

size

at

least

N

log

N

Consider

a

fragment

F

with

M

nodes

where

M

N

log

N

-LRB-

its

level

number

will

be

blog

Mc

-RRB-

The

response

to

a

test

message

sent

by

a

node

in

F

will

not

be

delayed

by

any

node

with

level

number

at

least

blog

M

log

log

Mc

-LRB-

blog

-LRB-

M

log

M

-RRB-

c

-RRB-

Since

log

N?log

log

N

log

M?log

log

M

-LRB-

log

X

log

log

X

is

an

increasing

function

of

X

for

X

-RRB-

the

response

to

a

test

message

sent

by

a

node

in

F

will

not

be

delayed

by

a

node

j

in

any

fragment

of

size

at

least

N

log

N

-LRB-

since

level

number

will

be

at

least

blog

-LRB-

N

log

N

-RRB-

c

which

is

greater

than

blog

-LRB-

M

log

M

-RRB-

c

-RRB-

Thus

in

the

second

stage

the

response

to

a

test

message

is

not

delayed

on

the

basis

of

level

numbers

Consider

the

case

when

node

j

at

level

lj

receives

a

connect

message

from

node

i

in

a

lower

level

fragment

at

level

li

Since

li

lj

log

lj

j

may

ask

i

to

count

the

number

of

nodes

in

its

fragment

however

it

will

not

delay

sending

messages

to

its

parent

Hence

the

execution

is

similar

to

that

of

Async

Therefore

this

phase

will

require

at

most

O

-LRB-

N

-RRB-

time

Lemma

The

time

complexity

of

CompMST

is

O

-LRB-

min

-LRB-

N

-LRB-

D

d

-RRB-

log

N

-RRB-

-RRB-

Proof

Consider

the

following

modification

of

the

proof

of

Lemma

A

fragment

at

level

l

at

time

tl

will

send

a

connect

message

within

O

-LRB-

D

d

-RRB-

time

units

after

time

tl

Further

the

depth

of

Cl

for

any

l

can

not

be

greater

than

d.

Hence

a

node

at

level

l

will

increase

its

level

number

within

O

-LRB-

D

d

-RRB-

time

after

tl

Therefore

tl

tl

O

-LRB-

D

d

-RRB-

Observe

that

this

is

true

for

all

level

numbers

l

l

log

N

Therefore

the

protocol

can

take

at

most

O

-LRB-

-LRB-

D

d

-RRB-

log

N

-RRB-

time

units

since

the

level

number

can

not

exceed

log

N

Hence

the

time

complexity

of

our

protocol

is

O

-LRB-

min

-LRB-

N

-LRB-

D

d

-RRB-

log

N

-RRB-

-RRB-

Discussion

The

time

and

message

complexities

of

the

protocols

in

-LSB-

-RSB-

-LSB-

-RSB-

are

O

-LRB-

min

-LRB-

N

log?N

-LRB-

D

d

-RRB-

log

N

-RRB-

and

O

-LRB-

E

N

log

N

-RRB-

respectively

Thus

for

dense

networks

-LRB-

whenever

E

N

log

N

log

log

N

-RRB-

the

performance

of

CompMST

is

better

However

for

sparse

networks

CompMST

improves

the

time

complexity

by

a

factor

of

log?N

at

the

expense

of

increasing

the

message

complexity

by

a

factor

of

log

N

log

log

N

In

the

following

we

give

a

modification

of

our

protocol

to

reduce

this

factor

We

modify

CompMST

as

follows

In

CompMST

the

response

to

a

test

message

with

level

number

l

is

delayed

by

a

node

if

its

level

number

is

less

than

l

log

l

We

change

this

rule

as

follows

A

response

to

a

test

message

with

level

number

l

is

delayed

by

a

node

if

its

level

number

is

less

than

l

log

log

l.

Furthermore

in

the

response

to

a

connect

message

the

conditions

for

cases

-LRB-

-RRB-

and

-LRB-

-RRB-

are

changed

to

li

lj?log

log

lj

-LRB-

for

case

-RRB-

and

lj

li

lj?log

log

lj

-LRB-

for

case

-RRB-

respectively

This

change

makes

the

protocol

more

synchronous

-LRB-

since

the

difference

in

level

numbers

of

combining

fragments

is

reduced

-RRB-

and

this

results

in

a

reduction

in

the

message

complexity

The

message

complexity

of

the

resulting

protocol

is

O

-LRB-

E+N

log

N

log

log

N

log

log

log

N

-RRB-

The

analysis

is

similar

to

that

in

Lemma

-LRB-

the

term

L

will

now

be

lower

bounded

by

O

-LRB-

log

log

l

log

l

-RRB-

-RRB-

The

time

complexity

of

the

protocol

is

O

-LRB-

min

-LRB-

N

-LRB-

D

d

-RRB-

log

N

-RRB-

-RRB-

The

analysis

involves

dividing

the

execution

of

the

protocol

into

three

stages

The

first

stage

is

the

computation

up

to

the

point

at

which

all

fragments

have

size

at

least

N

log

N

The

second

stage

begins

after

the

first

stage

and

continues

until

all

fragments

have

size

at

least

N

log

log

N

The

third

stage

involves

the

rest

of

the

execution

The

analysis

of

the

first

and

the

second

stage

is

similar

to

the

anlaysis

of

the

first

stage

in

Lemma

Each

of

these

stages

require

O

-LRB-

N

-RRB-

time

In

the

third

stage

the

algorithm

behaves

exactly

as

Async

and

has

time

complexity

of

O

-LRB-

N

-RRB-

From

an

analysis

similar

to

that

of

Lemma

the

time

complexity

of

the

protocol

is

O

-LRB-

min

-LRB-

N

-LRB-

D

d

-RRB-

log

N

-RRB-

-RRB-

Conclusion

In

this

paper

we

have

presented

a

protocol

for

constructing

a

minimum-weight

spanning

tree

in

a

general

network

In

-LSB-

-RSB-

a

protocol

for

this

problem

was

given

and

its

time

complexity

was

shown

to

be

O

-LRB-

N

log

N

-RRB-

-LSB-

-RSB-

proposed

a

protocol

which

requires

O

-LRB-

N

-RRB-

time

We

showed

that

the

time

complexity

of

the

protocol

in

-LSB-

-RSB-

can

also

be

expressed

as

O

-LRB-

-LRB-

D

d

-RRB-

log

N

-RRB-

This

enabled

us

to

conclude

that

the

protocol

in

-LSB-

-RSB-

will

perform

better

than

the

protocol

in

-LSB-

-RSB-

whenever

D

d

is

less

than

N

log

N

Hence

the

protocol

in

-LSB-

-RSB-

is

not

optimal

for

a

large

class

of

networks

We

first

presented

a

fully

asynchronous

protocol

Async

which

reqiures

O

-LRB-

-RRB-

messages

and

O

-LRB-

min

-LRB-

N

-LRB-

D

d

-RRB-

log

N

-RRB-

-RRB-

time

We

then

combined

the

features

of

Async

and

the

protocol

in

-LSB-

-RSB-

-LSB-

-RSB-

to

obtain

a

protocol

CompMST

which

requires

O

-LRB-

min

-LRB-

N

-LRB-

D

d

-RRB-

log

N

-RRB-

-RRB-

time

The

time

complexity

of

CompMST

is

equal

to

the

protocol

of

-LSB-

-RSB-

for

networks

in

which

D

d

is

less

than

N

log

N

and

to

the

protocol

of

-LSB-

-RSB-

for

networks

in

which

D

d

is

greater

than

N

log

N

The

message

complexity

of

CompMST

is

O

-LRB-

E

N

log

N

log

N

log

log

N

-RRB-

which

is

optimal

for

networks

in

which

E

N

log

N

log

N

log

log

N

References

-LSB-

-RSB-

Awerbuch

B.

Optimal

distributed

algorithms

for

minimal

weight

spanning

tree

counting

leader

election

and

related

problems

In

Proceedings

of

the

ACM

Sym

on

Theory

of

Computing

-LSB-

-RSB-

Chin

F.

and

Ting

H.F.

An

almost

linear

time

and

o

-LRB-

nlogn

e

-RRB-

messages

distributed

algorithm

for

minimum-weight

spanning

trees

In

Proc

of

the

IEEE

Sym

on

FOCS

-LSB-

-RSB-

Frederickson

G.

and

Lynch

N

The

impact

of

synchronous

communication

on

the

problem

of

electing

a

leader

in

a

ring

In

Proceedings

of

ACM

Sym

on

Theory

of

Computing

-LSB-

-RSB-

Gafni

E.

Improvement

in

the

time

complexities

of

two

message

optimal

protocols

In

Proceedings

of

the

ACM

Symp

on

Principles

of

Distributed

Computing

-LSB-

-RSB-

Gallager

R.G.

Humblet

P.A.

and

Spira

P.M.

A

distributed

algorithm

for

minimal

spanning

tree

ACM

Transaction

on

Programming

Languages

and

Systems

-LRB-

-RRB-

Dec.

Figure

Example

illustrating

the

merge

of

F

and

G.

Figure

Fragments

Fm

are

absorbed

in

G.

Figure

G

absorbs

C

after

finishing

first

phase

distributed algorithms
minimum spanning tree
synchronization
time complexity


Learning Object-Oriented Software Development with the Demeter Method Karl J. Lieberherr Director , Center for Software Sciences Northeastern University , College of Computer Science Cullinane Hall , 360 Huntington Ave. , Boston MA 02115 lieber@corwin.CCS.northeastern.EDU phone : -LRB- 617 -RRB- 437 20 77 FAX : -LRB- 617 -RRB- 437 51 21 September 21 , 1992 Texed at 10:09 September 21 , 1992 Copyright c 1991 Karl Lieberherr , all rights reserved . Abstract We describe how we teach the Demeter Method for object-oriented software development to undergraduate and graduate students . This paper presents a refinement of the teaching approach outlined in -LSB- LR89 -RSB- . 1 Introduction The Center for Software Sciences has been actively involved in several industrial , research and teaching projects using object-oriented technology . In this process , the Demeter System for object-oriented analysis , design and programming was developed . The Demeter System consists of the Demeter Method and the Demeter Tools . The Method is programming-language independent ; the Tools support the Method on the UNIX operating system . The Demeter System/C + + applies the Method to C++ software development and the Demeter Tools/C + + allow the checking of high-level programs at several levels of abstraction and they provide C++ software for manipulating objects defined by the high-level programs . The research and the development of the Demeter System/C + + has progressed for six years . At this stage it presents an integrated and polished approach to object-oriented C++ software development which is valuable for numerous industrial software projects which use C++ technology . By using novel abstractions such as class dictionaries and propagation patterns , the C++ software development time is significantly reduced . Furthermore , the Demeter System is ideal for learning of object-oriented technology since it breaks the material into easy to learn behavioral objectives and by providing tools which help you master those objectives . The Demeter Method was developed with the objective to significantly improve the productiveness of software engineers with minimal training costs . We have tested the adequacy of our system in numerous academic and industrial courses and projects and found that we can effectively teach our method in about five weeks with three hours of lectures per week and hands-on exercises . In the remaining five weeks , the students do a project of significant size which would be impossible to complete without the Demeter System in the available time . We use the same method in both a junior level undergraduate and a graduate course but with more emphasis on the theory in the graduate course . A small project version of the system and several papers on the system are available by ftp -LSB- LBH +91 -RSB- . A survey of the system is in -LSB- HSX91 -RSB- which is also available by ftp . 2 Expanded Syllabus The syllabus is outlined by the five homeworks which the students write : ffl Writing a simple C++ program without using virtual functions . ffl Writing a simple C++ program with virtual functions . Learning classes from objects . ffl Spending a few hours in writing a part of a larger C++ program . Writing and debugging class dictionaries . ffl Implementing the C++ program from the previous week with propagation patterns . ffl Writing C++ programs with propagation patterns and testing them with growth plans . The rationale behind this assignment sequence is to give the students the confidence that they can write simple C++ programs . After they have learned important high-level concepts such as class dictionaries -LSB- Lie88 , LBSL91 -RSB- and propagation patterns -LSB- LXSL91 , LHSLX92 , Lie92 -RSB- , they can then suddenly , by using the Demeter Tools/C + + , write much larger C++ programs -LRB- containing thousands of lines of code -RRB- . First we teach the basic concepts of object-oriented programming : classes with part-of and kind-of relationships , methods , inheritance , and delayed binding and we show how they are expressed in C++ . We teach only a small subset of C++ which is available in similar form in many other object-oriented languages , such as Smalltalk-80 and CLOS . The introduction of C++ is building on knowledge of C and/or Pascal . In homework one the students complete a simple C++ program without inheritance and without virtual functions , such as a program to compute the size of a tree . They only write the class definitions and they get the C++ code for constructing an object and the member function implementations . In homework two , the students complete a more complex C++ program with virtual functions , such as a simple pocket calculator . Inheritance is only used to define the virtual functions but not to express common functionality . In the second part of the homework , students write object graphs for several domains and they learn class dictionary graphs from them -LSB- LBSL91 , BL91 -RSB- . Domains include : C++ programs , binary trees , linked lists and a domain of their choice -LRB- an orchestra , golf course , chess board etc. -RRB- . In homeworks one and two the students have seen how tedious it is to describe objects in C++ . We take this experience to motivate class dictionaries . A class dictionary is a class dictionary graph with concrete syntax added to define an application specific language for describing objects in declarative form . The language consists of a set of sentences which can be automatically parsed into objects . In connection with class dictionaries we discuss printing and parsing and ambiguity of class dictionaries . We also cover learning of class dictionaries from object-graphs with syntax . We clarify now the informal syntax definition for class dictionaries and object graphs by showing them a class dictionary for class dictionaries and object graphs . In homework three , the students work on a C++ program with over a dozen classes . They are set a time limit and are not expected to complete the program in the given time frame . A good example is to compute the total salary in a conglomerate of companies . In addition , the students learn to dubug class dictionaries by writing sentences in an application specific language and by checking whether the corresponding objects can be represented by the class dictionary . The class dictionary graph from homework two is enhanced to a class dictionary and the students write sentences for the resulting class dictionary . In homework four the students complete the task which they could not complete in homework three by using a new programming technique , called propagation patterns . They encourage students to thinking in groups of collaborating classes with the same interface . With the new technique , the programming task from the last homework is easily solved . We introduce propagation patterns by showing first the traverse function for some class dictionary graph . The traverse function traverses an object in preorder and its code is a simple translation of the class dictionary graph . Propagation patterns use the traverse function idea to generate the default bodies for the classes in a propagation graph . Next we show how to specify propagation graphs with propagation directives of the simple * from * A * to * B form . This requires the introduction of inheritance edges which are reversed alternation edges . And we show how the generated default bodies of the propagated interfaces can be overriden with primary , before and after code fragments . To debug propagation pattern code , we introduce top-down growth plans . A top-down growth plan consists of a sequence of larger and larger partial class dictionary graphs all anchored at the same class . A partial class dictionary graph anchored at some class v contains enough classes to build at least one object of class v. Equiped with propagation patterns , students solve several small tasks in homework five . Good examples are , e.g. , 1 . writing a simple compiler for postfix expressions by generating code for a stack machine , 2 . computing the size of postfix expressions , 3 . computing the size of a class dictionary graph by using a class dictionary graph which describes class dictionary graphs . After homework five , students select a project from my list or they create one themselves which is related to their COOP and/or work experience . While they work on the projects , I give lectures on a variety of object-oriented design topics which help them doing their projects . ffl Finding the first prototype : simplifying the data -LRB- with growth plans -RRB- and additionally simplifying the functionality , if needed . ffl Parameterized classes , repetition classes and optional parts . ffl Class dictionary transformations : Object-equivalence , optimization of class dictionaries -LRB- common normal form , consolidation of alternatives , tree property -RRB- , flattening , weak extension , extension -LSB- LBSL91 , BL91 , Ber91 -RSB- . ffl The Law of Demeter for functions -LRB- object/class and weak/strong form -RRB- -LSB- LHR88 , LH89 -RSB- and its relationship to propagation patterns . ffl The Law of Demeter for classes -LSB- LX93 -RSB- . ffl Propagation pattern transformations : equivalence of propagation directives , adding * bypassing * , * through * and * to-stop * . ffl Propagation graph programs , introducing derived edges . ffl Testing of object-oriented programs , minimally adequate test sets and their relationship to class dictionary learning . ffl Propagation graph programs and their evolution and reuse , splitting a project into subprojects , relationship to growth plans . ffl Case studies : program evolution and modeling the design process . 3 Miscelleanous As text book we use any good C++ book such as -LSB- Lip89 -RSB- . In addition , the manuscript of a textbook on the Demeter Method is used , as well as selected papers from the literature . The material has been divided into about 80 behavioral objectives , each covering a simple learning unit . For example , the legal object objective asks students to determine whether a given object graph is legal with respect to a class dictionary graph . These objectives are tested in a midterm and final exam . Many of the objectives are handled by the Demeter Tools/C + + which support the Demeter Method on UNIX platforms with C++ . Therefore , the tools are also an effective learning aid , besides facilitating the programming process . The course relies on the Demeter Tools/C + + and their documentation . Each tool has a man page and many tools are explained by a gentle introduction which shows how to use the tool in typical situations . We also use an overall gentle introduction to the Demeter Tools which guides the student through a typical scenario of tool usage . To help the students with tool usage , we offer three hands-on sessions . 4 Conclusions We have outlined how we teach a novel way of developing object-oriented software which treats C++ merely as an assembly language . A lot of the work is done at a higher level of abstraction with class dictionaries and propagation graphs . This higher level of abstraction leads to easier and safer software development which is straightforward to teach and which can be used effectively by both freshman and Ph.D. students . The Demeter System , consisting of the Method and the Tools , was developed to be a software development system which is easy to learn and which is useful quickly for a variety of object-oriented languages . Acknowledgements : I would like to thank my Ph.D. students for actively developing the theory behind our system and for constantly improving the implementation . The theory is the foundation which makes our system elegant and easy to use . Linda Seiter suggested that the students should first hand-code simple C++ programs to experience the benefits of the tools . This work is supported in part by IBM Yorktown and IBM Mid-Hudson Valley , Mettler-Toledo and the National Science Foundation under grants CCR-9102578 -LRB- Software Engineering -RRB- and CDA-9015692 -LRB- Research Instrumentation -RRB- . References -LSB- Ber91 -RSB- Paul Bergstein . Object-preserving class transformations . In Object-Oriented Programming Systems , Languages and Applications Conference , in Special Issue of SIGPLAN Notices , pages 299 -LCB- 313 , Phoenix , Arizona , 1991 . ACM Press . SIGPLAN Notices , Vol . 26 , 11 -LRB- November -RRB- . -LSB- BL91 -RSB- Paul Bergstein and Karl Lieberherr . Incremental class dictionary learning and optimization . In European Conference on Object-Oriented Programming , pages 377 -LCB- 396 , Geneva , Switzerland , 1991 . Springer Verlag . -LSB- HSX91 -RSB- Walter L. H?ursch , Linda M. Seiter , and Cun Xiao . In any CASE : Demeter . The American Programmer , 4 -LRB- 10 -RRB- :46 -LCB- 56 , October 1991 . -LSB- LBH +91 -RSB- Karl Lieberherr , Paul Bergstein , Ian Holland , Walter H?ursch , Ignacio Silva-Lepe , Linda Seiter , and Cun Xiao . Demeter papers and license agreement . In FTP distribution from ftp.ccs.northeastern.edu or 129.10.10.51 in pub/demeter . Northeastern University , 1991 . -LSB- LBSL91 -RSB- Karl J. Lieberherr , Paul Bergstein , and Ignacio Silva-Lepe . From objects to classes : Algorithms for object-oriented design . Journal of Software Engineering , 6 -LRB- 4 -RRB- :205 -LCB- 228 , July 1991 . -LSB- LH89 -RSB- Karl J. Lieberherr and Ian Holland . Assuring good style for object-oriented programs . IEEE Software , pages 38 -LCB- 48 , September 1989 . -LSB- LHR88 -RSB- Karl J. Lieberherr , Ian Holland , and Arthur J. Riel . Object-oriented programming : An objective sense of style . In Object-Oriented Programming Systems , Languages and Applications Conference , in Special Issue of SIGPLAN Notices , number 11 , pages 323 -LCB- 334 , San Diego , CA. , September 1988 . A short version of this paper appears in IEEE Computer , June 88 , Open Channel section , pages 78-79 . -LSB- LHSLX92 -RSB- Karl J. Lieberherr , Walter H?ursch , Ignacio Silva-Lepe , and Cun Xiao . Experience with a graphbased propagation pattern programming tool . In International Workshop on CASE , pages 114 -LCB- 119 , Montr?eal , Canada , 1992 . IEEE Computer Society . -LSB- Lie88 -RSB- Karl J. Lieberherr . Object-oriented programming with class dictionaries . Journal on Lisp and Symbolic Computation , 1 -LRB- 2 -RRB- :185 -LCB- 212 , 1988 . -LSB- Lie92 -RSB- Karl J. Lieberherr . Component enhancement : An adaptive reusability mechanism for groups of collaborating classes . In J. van Leeuwen , editor , Information Processing ' 92 , 12th World Computer Congress , pages 179 -LCB- 185 , Madrid , Spain , 1992 . Elsevier . -LSB- Lip89 -RSB- S.B. Lippman . C++ Primer . Addison Wesley , 1989 . second edition . -LSB- LR89 -RSB- Karl J. Lieberherr and Arthur J. Riel . Contributions to teaching object-oriented design and programming . In Object-Oriented Programming Systems , Languages and Applications Conference , in Special Issue of SIGPLAN Notices , pages 11 -LCB- 22 , October 1989 . -LSB- LX93 -RSB- Karl J. Lieberherr and Cun Xiao . Formal Foundations for Object-Oriented Data Modeling . IEEE Transactions on Knowledge and Data Engineering , June 1993 . accepted for publication May 1991 . -LSB- LXSL91 -RSB- Karl Lieberherr , Cun Xiao , and Ignacio Silva-Lepe . Propagation patterns : Graph-based specifications of cooperative behavior . Technical Report NU-CCS-91-14 , Northeastern University , September 1991 . Contents 1 Introduction 1 2 Expanded Syllabus 2 3 Miscelleanous 4 4 Conclusions 4

O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O