Free-text

Answer

Analysis

on

the

Web

B.

Ibrahim

Stephen

D.

Franklin

B.

Levrat

Free-Text

Answer

Analysis

on

the

Web

Bertrand

Ibrahim

Ph.D.

Computer

Science

University

of

rue

du

G?n?ral

Dufour

Geneva

Switzerland

E-mail

Bertrand.Ibrahim@cui.unige.ch

URL

Stephen

D.

Franklin

Ph.D.

Office

of

Academic

University

of

California

Irvine

California

E-mail

franklin@uci.edu

URL

Bernard

Levrat

Ph.D.

Computer

Science

Department

University

of

Geneva

rue

du

G?n?ral

Dufour

Geneva

Switzerland

E-mail

Bernard.Levrat@cui.unige.ch

Abstract

The

World-Wide

Web

is

now

widely

used

for

educational

purposes

Such

use

is

conditioned

by

technical

educational

and

social

factors

that

include

the

expectations

and

understanding

of

educators

While

many

authors

of

educational

materials

are

content

to

exploit

only

the

Web

's

basic

remote

document

delivery

capabilities

others

feel

that

education

involves

greater

interaction

and

are

eager

to

create

and

present

interactive

materials

on

the

Web

Along

with

tools

which

greatly

simplify

the

preparation

of

such

materials

one

needs

to

develop

an

educationally-centered

view

of

the

Web

's

technical

capabilities

This

paper

first

introduces

the

techniques

that

are

currently

used

for

learner

assessment

then

presents

a

method

that

allows

educators

to

easily

integrate

free-text

answer

analysis

to

their

Web

documents

Various

implementation

choices

are

also

discussed

R?sum

Le

World-Wide

Web

est

d?j

largement

utilis

des

fins

ducatives

Cette

utilisation

est

influenc?e

par

des

facteurs

techniques

ducatifs

et

sociaux

y

compris

les

attentes

et

les

connaissances

des

ducateurs

Alors

que

beaucoup

d?auteurs

de

mat?riel

ducatif

se

contentent

d?utiliser

les

possibilit?s

de

transfert

distance

du

Web

d?autres

consid?rent

que

l

ducation

Free-text

Answer

Analysis

on

the

Web

B.

Ibrahim

Stephen

D.

Franklin

B.

Levrat

n?cessite

plus

d?interaction

et

d?sirent

cr?er

et

pr?senter

du

mat?riel

interactif

sur

le

Web

En

plus

des

outils

pour

simplifier

autant

que

possible

la

pr?paration

de

ce

genre

de

mat?riel

il

est

n?cessaire

de

d?velopper

une

vision

des

possibilit?s

techniques

du

Web

qui

se

concentre

sur

les

aspects

ducatifs

Cet

article

num?re

d?abord

les

techniques

actuellement

utilis?es

pour

l

valuation

de

l?apprenant

puis

pr?sente

une

m?thode

qui

permet

aux

ducateurs

de

facilement

int

grer

de

l?analyse

de

r?ponse

en

texte

libre

dans

leurs

documents

WWW

Diverses

possibilit?s

d?implantations

sont

ensuite

discut?es

Mots-cl

s

ducation

WWW

World-Wide

Web

documents

interactifs

analyse

de

r?ponse

contr?le

de

connaissances

Introduction

The

content

of

the

World-Wide

Web

is

growing

at

a

more

rapid

rate

than

any

previous

information

dissemination

mechanism

and

the

tools

and

techniques

available

for

providing

and

accessing

such

content

appear

to

be

growing

at

only

a

slightly

slower

rate

The

Web

is

now

widely

appreciated

and

deployed

within

the

educational

community

as

a

multimedia

document

delivery

mechanism

There

is

also

growing

awareness

of

its

very

substantial

capabilities

for

interactive

use

coupling

the

computational

and

information

processing

capabilities

of

local

personal

computers

with

those

of

larger

shared-use

systems

It

has

long

been

recognized

within

the

computer-based

learning

community

that

the

quality

of

computer-based

educational

material

was

highly

dependent

on

the

quality

of

the

assessment

of

the

learner

Indeed

good

educational

material

needs

to

adapt

to

learners

misconceptions

One

should

thus

develop

and

deliver

interactive

courses

which

go

beyond

multimedia

course

materials

to

incorporate

assessment

of

student

progress

Overview

of

current

assessment

techniques

used

on

the

Web

As

Ulrik

stated

in

his

HyperScript

innovative

educational

use

of

WWW

position

paper

at

the

Teaching

and

Training

of

the

Third

International

World-Wide

Web

educators

are

interested

in

using

the

Web

for

the

following

reasons

one

can

build

search

and

retrieval

functions

to

search

through

the

text

of

the

educational

material

one

can

provide

cross-referencing

within

the

material

to

connect

semantically

related

sections

one

can

provide

different

levels

of

details

to

let

the

learners

focus

on

those

parts

they

are

most

interested

in

one

can

integrate

multimedia

material

one

can

include

within

documents

information

gathered

in

real

time

one

can

integrate

the

material

with

other

campus-wide

information

the

learner

can

interact

via

forms

and

server-side

programs

the

educational

material

can

use

the

wealth

of

information

resources

available

worldwide

Free-text

Answer

Analysis

on

the

Web

B.

Ibrahim

Stephen

D.

Franklin

B.

Levrat

A

key

point

in

this

list

is

learner

interaction

and

educational

material

that

is

available

on

the

Web

is

often

weak

on

that

aspect

As

Schroeder

points

out

good

educational

material

should

provide

for

active

task-driven

and

goal-oriented

learning

and

encourage

active

student

participation

We

would

add

to

this

that

the

material

should

provide

for

adequate

help

and

individualized

interaction

based

on

an

extensive

assessment

of

the

learner

's

abilities

Many

educators

even

those

who

have

produced

their

own

Web

documents

do

not

see

construction

of

such

interactive

materials

on

the

Web

as

a

realistic

possibility

for

themselves

Part

of

the

reason

is

that

they

view

the

Web

as

a

document

delivery

mechanism

and

thus

participate

only

as

authors

of

particular

documents

One

can

move

beyond

this

both

by

improving

understanding

of

the

mechanisms

of

interactive

documents

and

by

using

tools

which

help

to

create

such

materials

We

turn

first

to

the

latter

approach

The

first

step

beyond

simple

document

delivery

on

the

Web

is

the

use

of

interactive

and

there

are

an

impressive

number

of

very

good

of

this

capability

Most

of

these

explanations

however

fall

short

of

educators

expectations

in

two

respects

First

they

presume

that

the

creation

of

a

program

to

handle

the

form

input

is

a

task

the

reader

can

reasonably

undertake

Second

educationally

effective

feedback

to

the

learner

often

must

be

based

on

input

other

than

the

learner

's

most

recent

response

In

both

these

cases

though

providing

tools

and

explanations

of

those

tools

oriented

to

the

needs

and

understanding

of

educators

can

overcome

these

obstacles

One

way

educators

can

incorporate

interaction

with

the

learner

in

the

documents

they

author

is

through

the

use

of

special

tools

that

allow

for

the

automatic

handling

of

answers

to

questions

within

Web

documents

For

instance

David

A.

Wheeler

's

downloadable

tool

lets

one

add

multiple

choice

questions

at

the

end

of

a

document

with

a

different

link

attached

to

each

possible

answer

While

the

merit

of

multiple-choice

test

is

debatable

it

is

certainly

true

that

these

tools

lower

the

technological

threshold

for

producing

Web-based

materials

by

those

instructors

who

value

such

testing

and

that

these

tools

open

the

door

to

other

uses

of

the

Web

as

well

A

more

educationally

ambitious

and

effective

collection

of

interactive

techniques

is

facilitated

by

Neal

M.

Holtz

's

Tutorial

which

lets

one

include

questions

involving

multiple

choice

true/false

single

numeric

and

single

algebraic

expression

answers

Numeric

and

algebraic

answers

require

form

support

in

the

WWW

browser

and

the

answer

analysis

involves

a

gateway

program

that

will

return

an

appropriate

URL

based

on

the

answer

It

is

however

a

common

misconception

that

going

beyond

these

answer

handling

techniques

is

much

too

difficult

to

be

worth

integrating

in

small

scale

educational

material

Indeed

in

spite

of

the

fact

that

many

educators

recognize

that

certain

objectives

can

only

be

reached

by

using

open

questions

and

free

text

answers

most

people

who

tackle

the

problem

of

handling

learner

answers

to

questions

consider

that

free

text

answer

analysis

is

too

complex

a

task

to

be

manage

Free-text

Answer

Analysis

on

the

Web

B.

Ibrahim

Stephen

D.

Franklin

B.

Levrat

able

with

current

software

technology

usually

referring

to

artificial

intelligence

techniques

to

do

lexical

syntactic

and

semantic

analysis

of

the

user

input

We

will

demonstrate

further

in

this

paper

that

reasonably

simple

techniques

can

achieve

assessments

protocols

that

do

not

allow

the

learner

to

guess

likely

answers

from

the

questions

that

are

formulated

thus

ensuring

a

more

reliable

assessment

of

the

learner

's

knowledge

The

AnswerAnalysis

module

People

tend

to

forget

that

rather

simple

pattern-matching

techniques

can

be

used

to

achieve

freetext

answer

analysis

with

very

reasonable

effectiveness

For

instance

the

research

group

on

computer

assisted

at

the

Computer

Science

department

of

the

University

of

Geneva

has

developed

and

used

in

stand-alone

CBL

programs

pattern

matching

tools

-LRB-

Franklin

et

al.

-RRB-

that

make

it

rather

easy

to

specify

in

a

symbolic

formalism

criteria

for

various

anticipated

answer

categories

The

rules

used

to

specify

answer

analysis

are

stored

separately

from

the

actual

educational

material

to

ease

translation

and

maintenance

This

answer

analysis

uses

simple

string

comparison

to

determine

if

the

user

input

-LRB-

representing

the

student

's

response

to

a

question

-RRB-

matches

an

expected

response

category

as

specified

in

the

rules

written

by

the

designers

of

the

material

These

rules

follow

a

syntax

that

can

be

easily

mastered

by

teachers

participating

in

the

original

design

or

by

those

who

may

have

to

modify

the

rules

to

handle

situations

overlooked

in

the

original

design

The

approach

is

easy

enough

to

use

to

allow

the

educators

to

remain

in

control

of

all

the

various

aspects

that

decide

of

the

pedagogical

value

of

the

educational

material

Basically

the

rule

formalism

allows

the

designers

to

specify

combination

of

words

that

should

or

should

not

be

found

in

the

learner

's

answer

Lists

of

synonyms

as

well

as

partial

words

can

also

be

provided

A

detailed

description

is

available

in

the

on-line

We

will

therefore

only

examine

here

a

simple

example

that

is

used

to

check

if

a

learner

answered

something

equivalent

to

yes

YES

YEP

OK

RIGHT

FINE

YEA

OF

COURSE

SURE

and

not

NO

NOT

N'T

In

this

notation

all

the

words

that

should

be

matched

against

the

learner

's

answer

are

in

upper

case

the

underline

character

stands

for

any

character

that

is

not

a

letter

or

a

number

the

vertical

bar

separates

alternatives

-LRB-

equivalent

to

an

or

operator

-RRB-

and

and

not

is

an

operator

indicating

that

of

the

alternatives

that

follow

should

be

found

Adaptation

to

the

Web

In

spite

of

its

simplicity

this

approach

gives

astonishingly

good

results

with

carefully

chosen

questions

and

well

thought

rules

for

expected

answers

Its

integration

to

WWW-based

material

can

be

done

in

various

ways

The

tools

based

on

this

mechanism

are

meant

to

be

used

by

document

authors

who

want

to

include

in

their

documents

input

fields

that

the

document

reader

-LRB-

the

learner

-RRB-

can

fill

in

and

that

will

lead

to

different

other

documents

based

on

the

-LRB-

free

text

-RRB-

input

that

the

learner

has

given

Free-text

Answer

Analysis

on

the

Web

B.

Ibrahim

Stephen

D.

Franklin

B.

Levrat

We

have

currently

implemented

two

approaches

involving

server-side

computing

Both

approaches

assume

the

use

of

a

simple

form

with

a

text

input

widget

for

the

learner

input

The

form

contains

the

various

analysis

criteria

and

corresponding

URLs

in

hidden

fields

This

information

will

be

used

by

a

cgi-bin

script

on

an

HTTP

server

to

do

the

pattern

matching

and

select

the

appropriate

URL

to

send

back

a

Location

reply

to

the

WWW

client

that

will

in

turn

display

the

corresponding

document

Authors

do

not

need

to

know

how

to

put

forms

in

their

documents

as

our

tools

will

do

it

automatically

for

them

The

author

can

specify

the

criteria

that

will

be

matched

against

the

user

input

to

classify

this

input

in

different

categories

All

the

possible

input

that

match

a

given

category

will

trigger

the

same

behavior

i.e.

will

lead

to

the

same

document

In

this

model

we

are

making

the

assumption

that

a

document

will

usually

contain

only

one

such

text

input

form

or

if

the

document

contains

more

than

one

form

only

one

will

be

used

at

a

time

leading

to

one

of

many

possible

successor

documents

based

on

the

category

of

the

user

input

The

two

approaches

we

have

implemented

involve

on-line

form-based

tools

to

automatically

create

such

a

user

input

form

and

embed

it

in

an

HTML

document

An

initial

assumed

that

all

the

information

necessary

to

create

the

answer

form

-LRB-

with

hidden

fields

containing

the

criteria

and

the

corresponding

URLs

-RRB-

would

be

entered

via

an

on-line

This

was

easy

to

put

in

place

but

was

not

very

convenient

for

maintenance

as

the

content

of

the

various

fields

of

the

form

can

not

be

saved

by

the

designers

for

later

modification

and

thus

have

to

be

re-entered

every

time

the

designers

decide

to

change

the

analysis

criteria

unless

the

filled

form

is

still

available

within

the

history

cache

of

the

Web

browser

The

second

assumes

that

the

criteria

are

prepared

in

a

www-accessible

and

that

a

is

mainly

used

to

give

the

URL

of

the

original

document

-LRB-

in

which

an

answer

form

must

be

embedded

-RRB-

and

the

URL

of

the

criteria

file

This

makes

it

easier

to

update

and

maintain

the

criteria

for

a

whole

set

of

documents

with

embedded

answer

forms

When

an

educator

uses

this

second

prototype

providing

the

two

URLs

and

the

symbol

used

as

a

placeholder

the

server

fetches

both

the

original

document

and

the

criteria

file

finds

the

analysis

patterns

in

the

latter

replaces

in

the

original

document

the

placeholder

with

the

form

that

the

learner

will

see

and

that

contains

all

the

pattern

matching

information

in

hidden

fields

The

resulting

document

is

then

returned

to

the

educator

's

browser

ready

to

be

saved

locally

-LRB-

e.g.

using

the

File/Save

As

browser

menu

item

-RRB-

and

integrated

into

a

set

of

educational

documents

When

a

learner

uses

the

resulting

document

and

fills

in

the

form

the

same

pattern

matching

program

is

activated

as

with

the

first

prototype

Client-side

processing

As

powerful

an

educational

tool

as

server-side

computing

can

be

it

is

not

without

its

limitations

Network

bandwidth

and

cumulative

system

load

on

a

server

required

to

meet

non-trivial

computational

demands

from

multiple

simultaneous

requests

can

easily

turn

interactive

into

slow

Free-text

Answer

Analysis

on

the

Web

B.

Ibrahim

Stephen

D.

Franklin

B.

Levrat

batch

processing

The

situation

is

aggravated

by

the

comparison

with

the

speed

of

local

processing

and

by

the

importance

of

predictable-time-to-respond

in

an

important

and

extensive

range

of

educational

applications

Educators

can

always

install

the

pattern

matching

software

on

their

local

WWW

server

to

be

less

dependent

on

some

remote

machine

over

which

they

have

no

control

but

this

raises

portability

issues

that

are

not

necessarily

obvious

to

solve

An

alternative

to

the

server-side

pattern-matching

approach

described

above

is

to

use

client-side

computing

to

do

all

the

pattern

matching

directly

on

the

learner

's

machine

Similarly

to

the

server-side

approach

the

pattern

matching

information

would

be

embedded

in

the

document

displayed

to

the

learner

but

this

time

as

parameters

to

an

applet

that

will

handle

both

the

learner

's

input

and

the

pattern

matching

This

solution

would

still

require

access

to

a

remote

server

the

first

time

the

applet

is

loaded

but

hopefully

not

the

following

times

assuming

that

the

appletcapable

browser

caches

it

locally

and

reuses

it

whenever

this

same

applet

is

used

within

other

documents

Implementing

this

client-side

approach

mostly

consists

in

translating

the

pattern

matching

code

to

whichever

programming

language

appears

to

be

supported

by

the

widest

range

of

Web

browsers

We

are

currently

working

on

an

implementation

based

on

the

Ada

to

Java

bytecode

from

Intermetrics

that

will

be

compatible

with

browsers

The

cgi-bin

script

that

currently

substitutes

a

placeholder

with

an

answer

input

form

in

a

document

will

simply

be

updated

to

embed

an

applet

tag

instead

The

educators

will

not

need

to

see

any

change

in

the

way

they

prepare

their

documents

compared

to

the

existing

prototypes

mentioned

earlier

Comparison

of

the

two

approaches

Even

though

in

most

cases

it

will

be

more

expedient

to

do

the

pattern

matching

on

the

learner

's

system

there

can

be

cases

where

analyzing

the

answers

on

a

server

may

make

more

sense

A

centralized

approach

makes

it

indeed

easier

to

collect

statistics

and

keep

a

database

of

user

profiles

-LRB-

assuming

that

the

learners

enter

their

name

before

they

can

start

using

the

educational

material

-RRB-

On

the

other

hand

the

client-side

approach

makes

it

easier

to

keep

the

profile

information

directly

in

the

learners

disk

space

allowing

the

learners

to

remain

anonymous

if

they

wish

so

Another

major

difference

between

the

two

approaches

is

the

ability

to

time

user

input

With

the

server-side

approach

a

mechanism

could

be

put

in

place

to

evaluate

the

time

elapsed

between

the

moment

the

document

with

the

answer

input

form

was

sent

to

the

learner

and

the

time

at

which

the

answer

is

sent

back

by

the

learner

but

it

would

be

difficult

using

the

standard

HTTP

to

modify

the

document

seen

by

the

learner

without

any

learner

intervention

-LRB-

the

authors

are

of

course

aware

of

the

Netscape

server-push

but

it

is

not

a

standard

use

of

the

HTTP

protocol

and

it

is

not

available

with

public-domain

WWW

server

software

-RRB-

On

the

other

hand

it

would

be

fairly

easy

with

the

client-side

approach

to

implement

in

the

user

input

applet

a

specific

behavior

based

on

the

time

elapsed

since

the

applet

started

The

respective

advantages

and

disadvantages

of

both

approaches

can

be

summarized

as

follows

Free-text

Answer

Analysis

on

the

Web

B.

Ibrahim

Stephen

D.

Franklin

B.

Levrat

There

is

no

need

to

choose

between

the

two

approaches

Indeed

it

may

be

that

one

reverts

to

a

server-based

analysis

if

a

client-side

one

is

not

possible

Or

it

may

be

that

one

falls

back

on

client-side

processing

when

server

response

is

unacceptable

However

based

on

the

above

table

one

can

see

that

the

two

approaches

are

not

completely

equivalent

and

the

choice

an

educator

will

make

will

depend

on

individual

factors

and

the

relative

importance

of

the

various

advantages

and

disadvantages

that

we

have

listed

Conclusion

We

have

described

in

this

paper

a

method

and

various

implementations

that

allow

educators

to

embed

free-text

answer

analysis

within

Web

documents

This

method

allows

for

better

assessment

of

the

knowledge

acquisition

process

since

there

need

not

be

any

element

of

answer

within

the

questions

that

are

asked

to

the

learners

This

method

has

successfully

been

used

in

the

past

within

stand-alone

computer

based

learning

material

and

we

have

shown

that

this

method

was

applicable

to

today

's

standard

Web

technology

-LRB-

forms

-RRB-

as

well

as

to

more

experimental

technology

-LRB-

applets

-RRB-

Moreover

we

have

shown

that

the

interface

to

the

developers

could

be

the

same

regardless

of

the

technological

choice

Balancing

technical

capabilities

and

educational

realities

has

never

been

an

easy

task

The

World

Wide

Web

has

opened

a

range

of

educational

opportunities

unprecedented

in

their

scale

and

scope

Appreciable

progress

has

already

been

made

and

looking

ahead

to

new

possibilities

we

see

the

importance

of

integrating

Web

technology

-LRB-

and

limitations

-RRB-

with

the

educationallycentered

perspective

that

is

created

through

a

focus

on

specific

curricular

challenges

References

Franklin

-LRB-

Stephen

D.

-RRB-

Levrat

-LRB-

Bernard

-RRB-

Portability

of

Computer

Based

Learning

Materials

across

machines

and

across

natural

languages

Computers

In

Education

K.

Duncan

and

D.

Harris

-LRB-

eds

-RRB-

Elsevier

Science

Publishers

B.V.

-LRB-

North-Holland

-RRB-

IFIP

pp.

advantages

disadvantages

server-side

pattern

matching

easy

to

put

in

place

easier

to

maintain

a

database

of

learner

profiles

usable

with

any

browser

supporting

forms

more

network

traffic

slower

response

time

no

learner

profile

if

anonymity

has

to

be

preserved

individualization

limited

to

varying

the

documents

that

are

shown

to

the

learner

timing

can

not

be

used

flexibly

client-side

pattern

matching

less

network

traffic

instant

response

time

anonymity

can

be

preserved

while

maintaining

a

local

learner

profile

individualization

can

consist

in

more

than

just

varying

the

documents

that

are

shown

to

the

learner

timing

can

be

used

easily

to

vary

the

learning

experience

more

difficult

to

maintain

a

database

of

learner

profiles

more

complex

to

put

in

place

requires

a

browser

supporting

applets

may

require

to

lower

security

protection

for

applets

unless

all

educators

install

a

copy

of

the

applet

on

the

same

server

as

the

educational

material

O B I O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O B O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O

answer analysis
assessment
education
interactive documents
www


Minimum-Length

Fundamental-Cycle

Set

Problem

A

New

Heuristic

and

an

SIMD

Implementation

Narsingh

Deo

Nishit

Kumar

James

Parsons

Tech

Rep.

Department

of

Computer

Science

University

of

Central

Florida

Orlando

FL

Research

partially

supported

by

NSF

grant

Abstract

Cycle

basis

is

a

useful

tool

for

graph

analysis

and

algorithms

One

well-known

method

to

obtain

cycle

basis

of

a

-LRB-

connected

-RRB-

graph

is

to

generate

the

set

of

all

fundamental

cycles

with

respect

to

some

spanning

tree

For

a

given

graph

finding

the

spanning

tree

for

which

the

sum

of

the

lengths

of

all

the

fundamental

cycles

is

the

smallest

is

called

the

Minimum-Length

Fundamental-Cycle

Set

problem

-LRB-

MFS

-RRB-

It

is

known

to

be

NP-complete

Suboptimal

solution

to

the

MFS

problem

has

been

applied

to

speed

up

the

algorithm

for

generating

minimal

perfect

hash

function

In

this

paper

we

propose

a

new

heuristic

for

the

MFS

problem

We

also

implemented

the

new

heuristic

and

the

best

published

heuristic

on

a

massively

parallel

SIMD

machine

-LRB-

MasPar

-RRB-

Programming

on

the

MasPar

machine

involved

a

careful

implementation

of

PRAM-type

algorithms

by

exploiting

the

built-in

routines

We

compare

the

two

heuristics

on

graphs

of

varying

orders

and

densities

the

largest

of

them

has

nodes

and

about

million

edges

The

runtime

and

the

scalability

issues

of

our

parallel

implementations

are

also

addressed

Introduction

A

set

of

cycles

which

forms

the

basis

of

the

cycle

subspace

of

a

given

graph

is

called

its

cycle

basis

-LSB-

-RSB-

It

is

used

in

analyzing

the

cyclic

structure

of

a

graph

and

other

related

properties

Depending

on

the

application

cycle

bases

of

various

kinds

are

used

-LRB-

see

Horton

-LSB-

-RSB-

for

examples

-RRB-

They

have

been

used

in

solving

electric

networks

since

the

time

of

Kirchoff

More

recent

applications

include

the

graph-isomorphism

problem

-LSB-

-RSB-

the

frequency

analysis

of

computer

programs

-LSB-

-RSB-

coding

ring

compounds

in

organic

chemistry

-LSB-

-RSB-

and

looking

for

blunders

in

survey

data

-LSB-

-RSB-

One

well-known

method

to

obtain

a

cycle

basis

is

to

generate

a

set

of

fundamental

cycles

For

a

given

undirected

unweighted

connected

graph

a

set

of

fundamental

cycles

with

respect

to

a

spanning

tree

is

the

set

of

those

simple

cycles

that

contain

exactly

one

nontree

edge

each

Here

the

nullity

of

the

graph

with

n

nodes

and

m

edges

is

equal

to

m

n

A

number

of

sequential

algorithms

for

generating

a

set

of

fundamental

cycles

have

been

proposed

and

some

implemented

-LSB-

-RSB-

Parallel

algorithms

for

the

problem

have

also

been

discussed

in

the

literature

-LSB-

-RSB-

Finding

the

spanning

tree

for

which

the

sum

of

the

lengths

of

all

fundamental

cycles

is

the

smallest

is

the

Minimum-Length

Fundamental-Cycle

Set

problem

-LRB-

MFS

-RRB-

Johnson

-LSB-

-RSB-

in

his

NP-completeness

Column

refers

to

it

as

the

Minimum

Cycle-Basis

Spanning

Tree

problem

The

MFS

problem

was

first

posed

by

Hubicka

and

Syslo

-LSB-

-RSB-

It

was

later

conjectured

to

be

a

NP-hard

problem

-LSB-

-RSB-

Deo

Prabhu

and

Krishnamoorthy

finally

established

its

NP-completeness

by

transforming

the

Shortest

Total

Path-Length

Spanning

Tree

problem

to

MFS

-LSB-

-RSB-

They

also

proposed

a

number

of

polynomial-time

heuristics

and

made

a

conjecture

that

the

total-length

of

the

shortest

fundamental-cycle

set

was

no

more

than

-LRB-

Interestingly

a

polynomial-time

algorithm

is

known

for

determining

a

cycle

basis

with

the

minimum

total

length

-LSB-

-RSB-

It

is

also

shown

in

-LSB-

-RSB-

that

the

length

of

a

shortest

cycle

basis

of

a

graph

is

no

more

than

-LRB-

n

-RRB-

-LRB-

n

-RRB-

Note

that

a

cycle

basis

is

not

always

a

fundamental-cycle

set

since

it

may

not

correspond

to

a

spanning

tree

-RRB-

Czech

et

al.

encountered

the

MFS

problem

in

generating

minimal

perfect

hash

functions

-LSB-

-RSB-

By

using

suboptimal

solutions

to

the

MFS

problem

they

reported

to

have

achieved

an

orders-of-magnitude

improvement

over

Sager

's

mincycle

algorithm

which

had

the

best

time-complexity

for

generating

minimal

perfect

hash

functions

at

that

time

-LSB-

-RSB-

All

existing

approximate

solutions

to

the

MFS

problem

use

variations

of

the

breadth-first

search

the

variation

being

in

the

criteria

to

select

a

new

node

to

explore

from

-LRB-

the

partial

tree

-RRB-

which

is

some

function

of

the

degrees

-LRB-

of

nodes

-RRB-

The

attempt

is

to

build

the

bushiest

-LRB-

i.e.

internal

nodes

in

the

tree

having

large

degree

-RRB-

and/or

the

shortest

spanning

tree

The

best

out

of

the

four

MFS

heuristics

proposed

in

-LSB-

-RSB-

namely

UE

-LRB-

Unexplored

Edges

-RRB-

was

further

improved

to

yield

a

heuristic

called

UV

-LRB-

Unexplored

Vertices

-RRB-

in

-LSB-

-RSB-

In

this

paper

we

develop

a

totally

new

heuristic

NT

abbreviating

NonTree

edges

At

any

stage

of

the

tree-building

process

heuristic

NT

explores

from

the

node

which

induces

the

largest

number

of

new

nontree

edges

-LRB-

or

fundamental

cycles

-RRB-

in

order

to

let

more

cycles

be

formed

early

when

they

are

likely

to

be

shorter

We

have

implemented

both

heuristics

UV

and

NT

on

a

massively

parallel

SIMD

machine

-LRB-

MasPar

-RRB-

The

organization

of

the

rest

of

this

paper

is

as

follows

Section

gives

a

brief

description

of

our

implementational

platform

MasPar

In

Section

we

describe

the

heuristics

and

their

parallel

implementations

which

cleverly

exploit

library

functions

in

the

MasPar

Section

deals

with

the

experimental

results

and

Section

the

application

of

the

MFS

problem

to

the

generation

of

minimal

perfect

hash

functions

Finally

Section

gives

the

conclusions

Implementation

Environment

The

heuristics

were

implemented

on

an

massively

parallel

SIMD

machine

MasPar

in

our

Center

for

Parallel

Computation

MasPar

is

a

fine-grained

mesh-connected

computer

-LSB-

-RSB-

It

has

a

front-end

processor

running

on

a

Unix-like

operating

system

-LRB-

Ultrix

-RRB-

and

a

Data

Parallel

Unit

-LRB-

DPU

-RRB-

for

the

execution

of

parallel

programs

The

front-end

machine

is

a

micro-VAX

workstation

The

DPU

consists

of

an

Array

Control

Unit

-LRB-

ACU

-RRB-

and

Processor

Elements

-LRB-

PEs

-RRB-

organized

as

a

two-dimensional

array

with

columns

and

rows

-LRB-

The

number

of

PEs

may

vary

from

installation

to

installation

-RRB-

The

ACU

is

a

special-purpose

processor

for

controlling

the

execution

of

all

the

PEs

A

program

is

stored

in

a

special

local

memory

bank

of

the

ACU

from

where

it

is

broadcast

to

the

PEs

simultaneously

Each

PE

consists

of

a

processor

and

a

bank

of

-LRB-

Kbytes

-RRB-

local

memory

Each

PE

is

connected

to

its

neighbors

-LRB-

wrapped

around

-RRB-

in

a

connection

scheme

called

xnet

-LRB-

i.e.

a

PE

is

connected

directly

to

its

East

West

North

South

North-East

North-West

South-East

and

South-West

neighbors

-RRB-

The

PEs

are

also

connected

through

a

global

router

Local

data

in

each

PE

can

be

exchanged

through

the

global

router

as

well

as

the

local

xnet

however

the

xnet

configuration

is

faster

but

requires

all

PEs

getting

their

data

from

the

same

direction

and

distance

at

a

given

time

MasPar

also

provides

a

global

broadcast

network

and

an

OR-reduction

network

to

allow

efficient

communication

between

the

ACU

and

the

array

of

PEs

We

used

the

MasPar

Parallel

Language

-LRB-

MPL

-RRB-

-LSB-

-RSB-

to

implement

the

algorithms

The

MPL

is

an

extension

of

the

C

language

and

has

a

primary

feature

of

adding

the

keyword

plural

to

a

C

data-declaration

statement

A

plural

variable

is

allocated

on

each

PE

and

any

expression

that

involves

a

plural

variable

is

computed

simultaneously

on

the

PEs

Statements

under

a

plural-if

statement

-LRB-

the

statement

if

-LRB-

cond

-RRB-

where

cond

is

a

plural

expression

-RRB-

is

executed

only

by

those

processors

which

evaluate

cond

to

true

In

an

MPL

program

this

statement

can

be

used

to

selectively

activate

or

deactivate

processors

Heuristics

and

Implementation

Definitions

A

graph

is

denoted

by

G

-LRB-

V

E

-RRB-

where

V

and

E

are

the

set

of

nodes

and

edges

respectively

with

jV

j

n

and

jEj

m

The

minimum

degree

of

all

nodes

of

a

graph

is

denoted

by

the

symbol

ffi

and

the

maximum

degree

by

Trees

considered

in

rest

of

the

paper

are

rooted

The

height

of

a

rooted

tree

is

the

length

of

the

longest

path

from

the

root

-LRB-

to

the

farthest

leaf

-RRB-

and

will

be

denoted

by

h

A

regular

graph

of

degree

r

is

one

in

which

ffi

r

A

torus

is

a

regular

graph

of

degree

in

which

every

node

-LRB-

i

j

-RRB-

i

j

pn

is

adjacent

to

four

nodes

given

by

-LRB-

i

mod

pn

j

-RRB-

and

-LRB-

i

j

mod

pn

-RRB-

It

is

defined

only

for

those

values

of

n

which

are

perfect

squares

of

integers

A

hypercube

is

a

regular

graph

of

degree

log

n

and

every

node

u

represented

by

a

log

n-bit

binary

string

is

adjacent

to

nodes

that

differ

from

u

in

exactly

a

single

bit

position

It

is

defined

for

only

those

values

of

n

which

are

powers

of

A

graph

generated

randomly

by

letting

every

pair

fu

vg

of

nodes

to

have

an

edge

with

probability

t

is

denoted

by

Gn

t

for

a

given

value

of

n

and

t

Heuristics

UV

and

NT

The

heuristics

have

two

phases

they

are

-LRB-

i

-RRB-

Tree-Construction

and

-LRB-

ii

-RRB-

Cycle-Calculation

The

first

phase

takes

an

input

graph

and

produces

its

spanning

tree

The

Cycle-Calculation

phase

computes

the

total

length

of

the

fundamental

cycles

for

the

spanning

tree

-LRB-

generated

in

the

first

phase

-RRB-

In

the

Tree-Construction

phase

both

the

heuristics

start

with

a

highest-degree

node

as

the

root

and

include

all

incident

edges

in

the

partial

tree

Subsequently

the

partial

tree

is

grown

by

including

all

new

edges

incident

to

the

node

with

the

highest

priority

The

heuristics

differ

in

determining

the

priority

of

a

node

For

heuristic

UV

priority

of

a

node

u

is

defined

as

p

-LSB-

u

-RSB-

dg

-LSB-

u

-RSB-

n

-LRB-

n

dist

-LSB-

u

-RSB-

-RRB-

where

dg

-LSB-

u

-RSB-

is

the

number

of

nodes

adjacent

to

u

and

not

yet

in

the

partial

tree

and

dist

-LSB-

u

-RSB-

is

the

distance

from

u

to

the

root

of

the

spanning

tree

Priority

of

a

node

is

a

two-digit

number

written

in

radix-n

positional

notation

as

-LRB-

-RRB-

where

dg

-LSB-

u

-RSB-

and

n

dist

-LSB-

u

-RSB-

The

highest-priority

node

adds

the

largest

number

of

new

nodes

in

the

partial

tree

If

this

number

is

identical

for

more

than

one

node

the

node

which

is

nearest

to

the

root

is

chosen

Further

ties

can

be

broken

by

using

the

node

labels

Such

a

strategy

tends

to

produce

a

bushy

and

short

spanning

tree

which

is

expected

to

yield

shorter

fundamental

cycles

Heuristic

NT

defines

the

priority

of

a

node

u

as

p

-LSB-

u

-RSB-

nt

-LSB-

u

-RSB-

m

-LRB-

n

dist

-LSB-

u

-RSB-

-RRB-

Here

nt

-LSB-

u

-RSB-

is

the

number

of

new

nontree

edges

-LRB-

or

fundamental

cycles

-RRB-

induced

by

exploring

from

node

u

and

can

be

computed

as

nt

-LSB-

u

-RSB-

X

v

-LRB-

d

-LSB-

v

-RSB-

dg

-LSB-

v

-RSB-

-RRB-

The

summation

is

over

all

nodes

that

are

adjacent

to

u

and

not

yet

in

the

partial

tree

and

d

-LSB-

v

-RSB-

is

the

degree

of

node

v.

Note

that

in

the

definition

of

p

-LSB-

u

-RSB-

-LRB-

unlike

for

heuristic

UV

-RRB-

we

use

a

radix-m

notation

since

the

value

of

nt

-LSB-

u

-RSB-

may

exceed

n

At

any

stage

the

highestpriority

node

induces

the

largest

number

of

fundamental

cycles

Such

a

strategy

relies

on

the

observation

that

the

cycles

which

are

formed

earlier

have

a

greater

chance

of

being

short

As

an

example

consider

the

graph

shown

in

Figure

-LRB-

a

-RRB-

Both

the

heuristics

start

with

node

as

the

root

and

include

the

four

incident

edges

in

the

partial

tree

In

the

second

step

heuristic

UV

explores

from

node

-LRB-

with

dg

-LSB-

-RSB-

-RRB-

whereas

heuristic

NT

explores

from

node

-LRB-

with

nt

-LSB-

-RSB-

-RRB-

Node

induces

the

two

nontree

edges

-LRB-

-RRB-

and

-LRB-

-RRB-

-LRB-

Note

that

there

are

three

nodes

namely

and

which

have

the

same

priority

but

the

tie

is

broken

by

selecting

the

node

with

the

smallest

label

-RRB-

Carrying

out

the

example

further

the

total

cycle-lengths

obtained

by

heuristics

UV

and

NT

are

and

respectively

as

sohwn

in

Figure

-LRB-

b

-RRB-

and

Figure

-LRB-

c

-RRB-

b

-RRB-

c

-RRB-

a

-RRB-

nontree

edge

Figure

An

example

a

-RRB-

Input

graph

b

-RRB-

Spanning

tree

for

UV

c

-RRB-

Spanning

tree

for

NT

Parallel

Implementation

Traditionally

massively

parallel

SIMD

machines

like

the

MasPar

have

been

found

suitable

for

implementing

algorithms

which

have

well-structured

computation-graphs

such

as

the

ones

for

sorting

image-processing

raster

graphics

and

dense-matrix

computations

Most

of

these

algorithms

are

systolic

-LRB-

or

can

be

converted

to

one

-RRB-

and

are

therefore

obvious

SIMD

candidates

On

the

other

hand

graph

problems

-LRB-

even

when

they

have

fast

PRAM

algorithms

-RRB-

do

not

usually

lend

themselves

to

conversion

into

neat

systolic

algorithms

The

approach

used

in

our

parallel

implementation

is

to

first

design

a

suitable

PRAM

algorithm

and

then

directly

implement

it

on

the

MasPar

machine

Typical

PRAM

operations

such

as

the

concurrent-read

or

concurrent-write

are

replaced

by

suitable

routines

available

in

the

MasPar

library

Such

an

approach

disregards

-LRB-

and

does

not

exploit

-RRB-

the

underlying

-LRB-

interconnection

-RRB-

architecture

of

the

machine

but

retains

the

spirit

elegance

and

the

efficiency

of

the

underlying

PRAM

algorithm

It

is

similar

to

the

approach

used

by

Hsu

Ramachandran

and

Dean

who

have

implemented

several

elementary

graph

algorithms

on

the

MasPar

-LSB-

-RSB-

Given

an

n-node

graph

n

we

use

the

first

n

processors

Pi

-LRB-

i

n

-RRB-

of

the

MasPar

mesh

the

processors

being

numbered

in

a

row-major

order

The

i-th

node

and

all

its

incident

edges

are

stored

in

the

local

memory

of

the

i-th

processor

Associated

with

every

node

u

are

the

six

variables

d

-LRB-

degree

of

node

u

-RRB-

dg

-LRB-

number

of

nodes

adjacent

to

u

and

but

not

included

in

the

partial

tree

-RRB-

dist

-LRB-

the

distance

of

u

from

the

root-node

-RRB-

incl

-LRB-

stores

if

u

is

in

the

partial

tree

or

otherwise

-RRB-

expl

-LRB-

stores

if

u

has

already

been

explored

otherwise

-RRB-

and

pred

-LRB-

parent

of

node

u

in

the

spanning

tree

-RRB-

In

an

MPL

program

these

six

variables

are

declared

as

plural

Figure

shows

the

outline

for

the

parallel

algorithm

used

in

the

first

phase

of

both

the

heuristics

After

initializing

the

data

structures

-LRB-

in

Statement

-RRB-

the

root

of

the

spanning

tree

is

determined

-LRB-

Statement

-RRB-

by

a

max-finding

step

which

is

implemented

using

the

MasPar

library

routine

reduceMax

-LRB-

-RRB-

-LRB-

on

the

plural

variable

d

-RRB-

Subsequently

in

Statements

through

the

partial

tree

is

grown

by

exploring

from

the

node

x

in

every

iteration

In

order

to

find

a

spanning

tree

the

algorithm

makes

ne

iterations

of

the

loop

-LRB-

Statements

through

-RRB-

where

ne

denotes

the

number

of

nodes

explored

The

termination

condition

-LRB-

Statement

-RRB-

is

implemented

by

using

reduceAnd

-LRB-

-RRB-

on

the

plural

variable

incl

Whenever

the

highest-priority

node

-LRB-

i.e.

x

-RRB-

is

found

it

is

marked

explored

-LRB-

Statement

-RRB-

and

all

its

adjacent

nodes

not

yet

in

the

partial

tree

are

marked

included

-LRB-

Statement

-RRB-

Furthermore

for

all

the

newly

included

nodes

the

parent

and

the

distance

from

the

root

are

initialized

-LRB-

Statement

-RRB-

Statement

which

is

the

dominant

step

updates

the

dg-values

It

involves

concurrent-write

operations

-LRB-

i.e.

multiple

processors

Pu

decrement

the

same

dg

-LSB-

v

-RSB-

-RRB-

and

is

implemented

by

using

the

router-construct

together

with

the

routine

connected

-LRB-

-RRB-

The

routine

connected

-LRB-

-RRB-

resolves

the

multiple-write

collisions

by

serializing

them

in

an

arbitrary

-LRB-

but

a

deterministic

-RRB-

fashion

It

must

also

be

pointed

out

that

in

determining

the

highestpriority

node

-LRB-

Statement

-RRB-

heuristic

NT

requires

an

extra

expensive

summation

which

is

implemented

by

using

the

routine

sendwith

-LRB-

-RRB-

An

outline

of

the

parallel

algorithm

for

the

-LRB-

common

-RRB-

second

phase

is

shown

in

Figure

The

spanning

tree

T

-LRB-

generated

by

the

first

phase

-RRB-

is

stored

implicitly

by

letting

every

Processor

Pu

u

n

except

Proot

store

the

edge

-LRB-

u

pred

-LSB-

u

-RSB-

-RRB-

Every

processor

Pu

first

builds

the

ancestry-list

of

node

u

i.e.

the

list

pred

-LSB-

u

-RSB-

pred

-LSB-

pred

-LSB-

u

-RSB-

-RSB-

root

This

involves

external

references

-LRB-

concurrent-read

operation

-RRB-

to

the

pred-values

and

is

implemented

by

using

the

router-construct

In

Statement

every

processor

-LRB-

in

parallel

-RRB-

computes

the

fundamental-cycle

lengths

for

those

nontree

edges

that

it

is

responsible

for

Since

every

edge

-LRB-

u

v

-RRB-

is

incident

to

two

nodes

the

condition

u

v

resolves

which

one

of

the

two

processors

-LRB-

i.e.

Pu

or

Pv

-RRB-

will

compute

the

associated

cycle-length

Local

values

of

the

ALGORITHM

Tree-Construction

-LRB-

G

-RRB-

Processors

Pu

-LRB-

u

n

-RRB-

DOPAR

dg

-LSB-

u

-RSB-

d

-LSB-

u

-RSB-

dist

-LSB-

u

-RSB-

incl

-LSB-

u

-RSB-

expl

-LSB-

u

-RSB-

root

HighestDegreeNode

-LRB-

-RRB-

incl

-LSB-

root

-RSB-

expl

-LSB-

root

-RSB-

dg

-LSB-

root

-RSB-

Processors

Pu

-LRB-

Edge

-LRB-

u

root

-RRB-

E

-RRB-

DOPAR

dg

-LSB-

u

-RSB-

dg

-LSB-

u

-RSB-

incl

-LSB-

u

-RSB-

LOOP

x

HighestPriorityNode

-LRB-

-RRB-

expl

-LSB-

x

-RSB-

Processors

Pu

-LRB-

Edge

-LRB-

u

x

-RRB-

E

and

incl

-LSB-

u

-RSB-

-RRB-

DOPAR

FOR

all

v

-LRB-

Edge

-LRB-

u

v

-RRB-

E

-RRB-

DO

dg

-LSB-

v

-RSB-

dg

-LSB-

v

-RSB-

Pu

decrements

dg-value

of

node

v

Processors

Pu

-LRB-

Edge

-LRB-

u

x

-RRB-

E

and

incl

-LSB-

u

-RSB-

-RRB-

DOPAR

incl

-LSB-

u

-RSB-

pred

-LSB-

u

-RSB-

x

dist

-LSB-

u

-RSB-

dist

-LSB-

x

-RSB-

UNTIL

-LRB-

incl

-LSB-

u

-RSB-

-RRB-

Figure

Parallel

Algorithm

for

Tree-Construction

cycle-lengths

cl

-LSB-

u

-RSB-

are

finally

summed

up

-LRB-

in

Statement

-RRB-

by

using

reduceAdd

-LRB-

-RRB-

to

get

the

total

cycle-length

L

for

the

entire

graph

Experimental

Results

We

used

two

classes

of

graphs

to

study

the

performance

of

the

heuristics

and

their

parallel

implementations

they

are

-LRB-

i

-RRB-

two

well-known

families

of

regular

graphs

-LCB-

the

torus

and

the

hypercube

and

-LRB-

ii

-RRB-

random

graphs

Gn

t

with

extra

edges

added

-LRB-

whenever

necessary

-RRB-

to

ensure

that

there

are

no

degree-one

nodes

since

they

have

no

effect

on

the

solution

The

random

graphs

used

were

grouped

into

six

classes

depending

on

their

densities

They

have

the

number

of

edges

m

approximately

equal

to

n

n

n

n

log

n

npn

and

ALGORITHM

Cycle-Calculation

-LRB-

G

T

-RRB-

Processors

Pu

-LRB-

u

n

-RRB-

DOPAR

initialize

ancestry-list

for

u

Processors

Pu

-LRB-

u

n

-RRB-

DOPAR

cl

-LSB-

u

-RSB-

FOR

all

nontree

edges

-LRB-

u

v

-RRB-

such

that

u

v

DO

cl

-LSB-

u

-RSB-

cl

-LSB-

u

-RSB-

length

of

the

cycle

induced

by

-LRB-

u

v

-RRB-

L

u

n

cl

-LSB-

u

-RSB-

Figure

Parallel

Algorithm

for

Cycle-Calculation

respectively

The

first

three

classes

were

obtained

from

Gn

t

setting

t

equal

to

and

respectively

-LRB-

or

an

average

degree

of

and

-RRB-

and

adding

edges

-LRB-

randomly

-RRB-

to

ensure

that

there

were

no

degree-one

nodes

Regular

Graphs

Table

compares

the

total

cycle-lengths

as

well

as

heights

of

spanning

trees

for

the

two

heuristics

on

tori

and

hypercubes

of

different

orders

For

the

sake

of

brevity

we

have

tabulated

only

a

small

sample

-LRB-

representative

of

the

full

set

-RRB-

of

our

results

We

ran

the

two

heuristics

on

all

possible

orders

up

to

Our

new

heuristic

produces

overwhelmingly

better

solutions

-LRB-

i.e.

cycle-lengths

-RRB-

than

heuristic

UV

The

superior

quality

of

solution

-LRB-

of

heuristic

NT

-RRB-

is

also

reflected

in

the

height

of

the

tree

which

are

considerably

shorter

We

expect

the

superiority

of

heuristic

NT

-LRB-

over

UV

-RRB-

to

carry

over

to

other

regular

graphs

and

nearly

regular

graphs

Since

heuristic

UV

chooses

the

next

vertex

to

explore

from

on

the

basis

of

the

degree

regular

graphs

-LRB-

quoted

as

bad

classes

of

graphs

in

-LSB-

-RSB-

-RRB-

prevent

it

from

exploiting

the

degree

distribution

Random

Graphs

Tables

and

Figures

show

the

performance

on

random

graphs

For

a

fixed

order

and

density

the

data

presented

are

averages

over

graphs

-LRB-

ensuring

small

standard

deviations

-RRB-

Table

shows

the

mean

values

of

the

three

graph-parameters

namely

the

number

of

edges

-LRB-

m

-RRB-

the

minimum

degree

-LRB-

ffi

-RRB-

and

the

maximum

degree

-LRB-

-RRB-

of

the

random

graphs

used

In

Table

we

present

-LRB-

for

both

the

heuristics

-RRB-

the

three

significant

parameters

of

the

spanning

tree

namely

the

number

of

nodes

explored

or

the

number

of

non-leaf

nodes

-LRB-

ne

-RRB-

height

of

the

spanning

tree

-LRB-

h

-RRB-

and

the

average

cycle-length

-LRB-

l

L

m?n

-RRB-

Here

L

denotes

the

total

cycle-length

The

order

of

the

graphs

varies

from

to

in

powers

of

Quality

of

Solutions

Figure

shows

the

percentage

of

inputs

for

which

heuristic

NT

found

a

shorter

cycle-length

than

heuristic

UV

We

call

it

the

merit

of

heuristic

NT

In

those

cases

when

the

two

tie

equal

merit

is

assigned

to

each

Heuristic

NT

-LRB-

as

in

Figure

-RRB-

outperforms

UV

on

extremely

sparse

graphs

When

m

is

around

heuristic

NT

can

almost

always

be

expected

to

find

a

better

solution

asymptotically

for

large

n

This

is

apparent

from

the

top

three

curves

-LRB-

in

Figure

-RRB-

which

converge

to

a

merit

of

at

n

On

extremely

sparse

graphs

the

number

of

nontree

edges

-LRB-

or

fundamental

cycles

-RRB-

are

few

and

hence

play

a

crucial

role

while

constructing

the

spanning

tree

Since

heuristic

NT

builds

the

spanning

tree

by

examining

nontree

edges

-LRB-

unlike

heuristic

UV

-RRB-

it

is

expected

to

produce

better

solutions

Figure

also

shows

that

for

graphs

with

m

n

log

n

heuristic

UV

found

a

better

solution

at

a

steady

rate

of

to

The

difference

in

the

performance

however

narrows

down

for

denser

graphs

This

is

also

evidenced

by

the

l-values

in

Table

The

cycle-lengths

for

heuristic

UV

are

shorter

than

that

for

heuristic

NT

approximately

by

to

for

graphs

with

m

n

log

n

and

only

to

for

m

npn

For

graphs

with

m

the

average

cycle-lengths

are

equal

up

to

the

first

decimal

place

With

the

increase

in

density

the

spanning

trees

produced

by

both

heuristics

tend

to

get

shorter

as

evidenced

by

the

h-values

in

Table

Furthermore

the

average

cycle-length

-LRB-

l

-RRB-

approaches

the

lower

bound

of

as

expected

Also

note

that

for

graphs

for

all

densities

heuristic

UV

never

explored

more

nodes

than

heuristic

UV

-LRB-

see

ne-values

in

Table

-RRB-

which

is

consistent

with

its

attempt

to

produce

bushy

trees

Runtimes

The

MasPar

runtimes

for

the

two

phases

of

the

heuristics

are

shown

in

Figures

and

Heuristic

UV

is

faster

during

the

Tree-Construction

phase

-LRB-

as

in

Figure

-RRB-

because

of

the

extra

computation

required

by

heuristic

NT

in

determining

the

priorities

of

nodes

The

parallel

time

of

Algorithm

Tree-Construction

is

predominantly

governed

by

the

number

of

iterations

of

Statements

through

-LRB-

which

is

ne

-RRB-

and

-LRB-

some

function

of

-RRB-

the

average

degree

of

nodes

which

approximates

the

time

required

by

Statement

We

observe

that

for

heuristic

UV

the

Tree-Construction

time

per

iteration

is

nearly

constant

for

graphs

with

m

O

-LRB-

n

-RRB-

and

grows

slightly

slower

than

the

functions

log

n

pn

and

n

for

graphs

with

O

-LRB-

n

log

n

-RRB-

O

-LRB-

npn

-RRB-

and

O

-LRB-

-RRB-

edges

respectively

On

the

other

hand

for

heuristic

NT

the

time

per

iteration

grows

slightly

faster

than

the

constant-function

for

the

first

three

families

For

the

latter

three

it

grows

slightly

faster

than

the

logarithmic

square-root

and

linear

functions

respectively

Even

though

the

heuristics

have

a

common

second

phase

Figure

reveals

distinct

runtime

differences

betwen

the

two

The

parallel

time

of

Algorithm

Cycle-Construction

is

closely

related

to

the

total

cycle-length

which

explains

why

Heuristic

NT

took

less

time

on

extremely

sparse

graphs

-LRB-

i.e.

graphs

with

O

-LRB-

n

-RRB-

edges

-RRB-

The

runtimes

for

other

densities

also

continue

to

follow

an

expected

trend

-LCB-

the

better

the

quality

of

solution

the

shorter

is

the

runtime

Also

note

that

for

graphs

with

O

-LRB-

n

-RRB-

and

O

-LRB-

n

log

n

-RRB-

edges

the

runtimes

for

the

second

phase

are

small

compared

to

those

for

the

first

However

as

expected

for

dense

graphs

both

the

phases

contribute

significantly

to

the

total

runtime

An

Application

A

perfect

hash

function

is

an

injection

F

W

I

where

W

is

a

set

of

M

words

and

I

is

an

interval

of

integers

-LSB-

N

-RSB-

N

M

If

N

M

then

we

say

that

F

is

a

minimal

perfect

hash

function

MPHF

Minimal

perfect

hash

functions

are

used

for

memory

efficient

storage

and

fast

retreival

of

sets

of

predetermined

-LRB-

static

-RRB-

items

such

as

reserved

words

in

programming

languages

command

names

in

operating

systems

commonly

used

words

in

natural

language

etc.

In

this

section

we

will

describe

how

the

MFS

problem

arises

in

the

MPHF

problem

For

details

the

readers

are

referred

to

-LSB-

-RSB-

In

Sager

gave

an

O

-LRB-

-RRB-

time

algorithm

to

the

MPHF

problem

-LSB-

-RSB-

All

the

previously

published

algorithms

had

an

expected

execution-time

exponential

in

M

Sager

's

mincycle

algorithm

-LRB-

-LSB-

-RSB-

-RRB-

has

three

parts

to

it

In

Part

certain

parameters

are

chosen

and

two

disjoint

finite

sets

of

elements

-LRB-

let

R

-RRB-

W

-LSB-

N

-RSB-

W

and

W

The

functions

and

are

three

quickly

computable

pseudorandom

functions

After

determining

the

parameters

a

function

g

R

-LSB-

N

-RSB-

is

desired

which

makes

F

W

-LSB-

N

-RSB-

a

perfect

hash

function

where

F

-LRB-

w

-RRB-

-LRB-

-LRB-

w

-RRB-

g

-LRB-

-LRB-

w

-RRB-

-RRB-

g

-LRB-

-LRB-

w

-RRB-

-RRB-

-RRB-

mod

N

Part

of

the

algorithm

involves

the

construction

of

a

monotonic

tower

of

subsets

of

W

OE

ae

ae

ae

Wk

ae

Wk

W

In

Part

at

each

step

for

some

i

-LRB-

i

k

-RRB-

the

desired

function

F

is

extended

from

the

domain

Wi

to

the

domain

Wi

In

order

to

minimize

the

work

necessary

to

extend

F

in

all

steps

the

aim

is

to

make

Wi

's

as

large

as

possible

In

Sager

's

work

Part

which

is

the

dominant

step

was

implemented

by

using

an

expensive

search

requiring

O

-LRB-

-RRB-

steps

-LSB-

-RSB-

Czech

et

al.

instead

formulated

it

as

the

MFS

problem

and

used

suboptimal

heuristics

to

reduce

the

complexity

of

the

overall

MPHF

algorithm

to

O

-LRB-

-RRB-

The

underlying

graphs

on

which

the

MFS

problem

were

solved

had

multiple

edges

They

correspond

to

the

biconnected

components

of

the

graph

G

-LRB-

R

-RRB-

where

-LRB-

-LRB-

w

-RRB-

-LRB-

w

-RRB-

-RRB-

for

w

W

After

solving

the

MFS

problem

what

is

important

to

the

MPHF

algorithm

is

a

digital

key

indicating

the

lengths

and

number

of

fundamental

cycles

a

tree-edge

e

lies

on

Note

that

every

edge

e

corresponds

to

some

word

w

W

In

the

implementation

of

-LSB-

-RSB-

the

digital

key

is

a

number

represented

by

the

positional

notation

in

base

b

i.e.

digkey

-LSB-

e

-RSB-

bmax

bmax

nmax

where

max

is

the

length

of

the

longest

fundamental

cycle

and

b

is

one

more

than

the

maximum

number

of

fundamental

cycles

of

a

particular

length

The

digital

key

digkey

-LSB-

e

-RSB-

indicates

that

edge

e

lies

on

cycles

of

length

cycles

of

length

and

so

on

While

building

the

tower

an

edge

e

with

the

highest

key

is

included

in

the

tower

All

cycles

containing

e

are

deleted

and

the

keys

for

each

-LRB-

tree

-RRB-

edge

is

re-computed

In

order

that

the

runtime

of

the

algorithm

be

minimized

it

is

important

that

the

digital

keys

are

as

small

as

possible

which

as

one

can

expect

is

attained

by

solving

the

MFS

problem

Conclusion

In

this

paper

we

developed

a

new

heuristic

-LRB-

NT

-RRB-

for

the

MFS

problem

We

implemented

our

new

heuristic

and

the

heuristic

UV

-LRB-

known

to

be

the

best

-RRB-

on

a

massively

parallel

SIMD

machine

MasPar

Our

choice

of

the

implementational

platform

was

motivated

not

only

by

the

desire

to

solve

the

problem

for

large

graphs

but

also

to

develop

general

techniques

of

solving

graph

optimization

problems

on

an

SIMD

machine

Our

parallel

implementation

involved

first

designing

a

simple

and

efficient

PRAM-type

algorithm

and

then

implementing

it

by

using

the

in-built

MasPar

routines

Such

an

approach

-LRB-

unlike

traditional

approaches

of

first

obtaining

systolic

algorithms

-RRB-

can

be

used

effectively

to

implement

a

large

number

of

other

graph

algorithms

as

well

which

may

not

appear

suitable

for

SIMD

implementations

otherwise

We

have

included

details

of

our

implementation

with

the

hope

that

they

would

aid

readers

in

implementing

other

graph

algorithms

on

the

MasPar

machine

The

new

heuristic

-LRB-

NT

-RRB-

found

overwhelmingly

better

solutions

than

heuristic

UV

on

regular

-LRB-

and

nearly

regular

-RRB-

graphs

as

well

as

on

graphs

that

are

extremely

sparse

The

MasPar

runtimes

of

our

implementations

were

found

to

conform

to

the

theoretical

analysis

of

the

underlying

parallel

algorithms

All

heuristics

for

the

MFS

problem

-LRB-

including

ours

-RRB-

are

variations

of

the

breadth-first

technique

it

may

be

interesting

to

consider

alternate

approaches

The

effect

of

node

relabeling

on

the

performance

of

various

heuristics

also

need

further

investigation

References

-LSB-

-RSB-

P.

Chaudhari

Distributed

processing

of

graphs

Fundamental

Cycles

Algorithm

Information

Sciences

-LCB-

-LSB-

-RSB-

D.

B.

Corneil

and

R.

C.

Read

The

Graph

Isomorphism

Disease

Journal

of

Graph

Theory

-LCB-

-LSB-

-RSB-

D.

W.

Cribb

R.

D.

Ringeisen

and

D.

R.

Shier

On

cycle

bases

of

a

graph

Cong

Numer.

-LCB-

-LSB-

-RSB-

Z.

Czech

M.

Konopka

and

B.

Majewski

Parallel

algorithms

for

finding

a

sub-optimal

fundamental

cycle

set

in

a

graph

Parallel

Computing

-LCB-

-LSB-

-RSB-

Z.

Czech

and

B.

Majewski

Generating

a

minimal

perfect

hash

function

in

O

-LRB-

-RRB-

time

Archiwum

Informatyki

Teoretycznej

I

Stosowanej

-LCB-

-LSB-

-RSB-

DECmpp

Programming

Language

User

's

Guide

-LSB-

-RSB-

DECmpp

System

Overview

Manual

-LSB-

-RSB-

DECmpp

Programming

Language

Reference

Manual

-LSB-

-RSB-

N.

Deo

Graph

theory

with

applications

to

engineering

and

computer

science

PrenticeHall

Englewood

Cliffs

N.

J.

Chap

-LSB-

-RSB-

N.

Deo

Minimum

length

fundamental

cycle

set

IEEE

Trans

Circ

Sys.

-LCB-

-LSB-

-RSB-

N.

Deo

G.

Prabhu

and

M.

Krishnamoorthy

Algorithms

for

generating

fundamental

cycles

in

a

graph

ACM

Transactions

on

Mathematical

Software

-LRB-

-RRB-

-LCB-

-LSB-

-RSB-

C.

J.

Egyhazy

An

algorithm

for

generating

the

minimum

length

fundamental

cycles

in

a

graph

Cong

Numer.

-LCB-

-LSB-

-RSB-

N.

W.

Gibbs

Algorithm

Basic

cycle

generation

Comm

ACM

-LCB-

-LSB-

-RSB-

C.

C.

Gotlieb

and

D.

G.

Corneil

Algorithms

for

finding

a

fundamental

set

of

cycles

for

an

undirected

linear

graph

Comm

ACM

-LCB-

-LSB-

-RSB-

J.

D.

Horton

A

polynomial-time

algorithm

to

find

the

shortest

cycle

basis

of

a

graph

SIAM

J.

Comput.

-LCB-

-LSB-

-RSB-

T.

S.

Hsu

V.

Ramachandran

and

N.

Dean

Implementation

of

parallel

graph

algorithms

on

MasPar

In

DIMACS

Series

in

Discrete

Mathematics

and

Theoretical

Computer

Science

volume

pages

-LCB-

-LSB-

-RSB-

E.

Hubicka

and

M.

M.

Syslo

Minimal

bases

of

cycles

of

a

graph

In

Recent

Advances

in

Graph

Theory

pages

-LCB-

Academia

Praha

Prague

-LSB-

-RSB-

D.

S.

Johnson

The

NP-completeness

Column

An

ongoing

guide

J.

Algorithms

-LCB-

-LSB-

-RSB-

A.

D.

Jovanovich

Note

on

the

modification

of

the

fundamental

cycle

finding

algorithm

Info

Proc

Lett.

-LSB-

-RSB-

D.

Knuth

The

Art

of

Computer

Programming

volume

Addison-Wesley

Reading

Mass.

pages

-LSB-

-RSB-

E.

Kolasinska

On

a

minimal

cycle

basis

of

a

graph

Zastosow

Matem

-LCB-

-LSB-

-RSB-

J.

Lederberg

Topology

of

Molecules

Mathematical

Sciences

M.I.T.

Press

Cambridge

Mass

pages

-LSB-

-RSB-

K.

Paton

An

algorithm

for

finding

a

fundamental

set

of

cycles

of

a

graph

Comm

ACM

-LCB-

-LSB-

-RSB-

E.

M.

Reingold

J.

Nievergelt

and

N.

Deo

Combinatorial

Algorithms

Theory

and

Practice

Prentice-Hall

Englewood

Cliffs

N.

J.

chap

-LSB-

-RSB-

T.

J.

Sager

A

polynomial

time

generator

for

minimal

perfect

hash

functions

Comm

ACM

pages

-LCB-

-LSB-

-RSB-

C.

Savage

and

J.

J?aJ?a

Fast

efficient

parallel

algorithms

for

some

graph

problems

SIAM

J.

Comput.

-LCB-

-LSB-

-RSB-

P.

Steeves

Numerical

Processing

of

horizontal

control

data-economization

by

automation

PhD

thesis

University

of

New

Brunswick

-LSB-

-RSB-

E.

Sussenguth

Jr.

A

graph-theoretical

algorithm

for

matching

chemical

structures

J.

Chem

Doc.

-LRB-

-RRB-

-LCB-

-LSB-

-RSB-

M.

M.

Syslo

Fundamental

set

of

cycles

of

a

graph

Zastosow

Matem.

-LCB-

-LSB-

-RSB-

M.

M.

Syslo

Minimum-length

cycle

bases

of

a

graph

-LRB-

Extended

Abstract

-RRB-

Methods

Oper

Res.

-LCB-

-LSB-

-RSB-

Y.

Tsin

and

F.

Chin

Efficient

parallel

algorithms

for

a

class

of

graph

theoretic

problems

SIAM

J.

Comput.

-LCB-

-LSB-

-RSB-

J.

T.

Welch

Jr.

A

mechanical

analysis

of

the

cyclic

structure

of

undirected

linear

graphs

J.

ACM

-LCB-

T

O

R

O

I

D

S

H

Y

P

E

R

C

U

B

E

S

Cycle-Lengths

Tree-Heights

Cycle-Lengths

Tree-Heights

n

UV

NT

UV

NT

n

UV

NT

UV

NT

256 3582 2758

38 18 256 8744

62 29 512 25818

32 16 1024 28888

33 17 2025 81736

150 63 2048 20733

4096 239374

226 90 4096 74271

110 30 8100 67555

330 128 8192 25332

30 1180808

Table

Quality

of

solutions

on

regular

graphs

Graph

n

Parameters

256 512 1024 2048

m

-LRB-

n

-RRB-

367 734 1463 2906

ffi

m

-LRB-

n

-RRB-

882 1748 3486 6938

ffi

m

-LRB-

n

-RRB-

548 1094 2164 4319

ffi

m

-LRB-

log

n

-RRB-

1042 2368 5185 11328

ffi

m

-LRB-

-RRB-

2063 5841 16514

ffi

m

-LRB-

-RRB-

ffi

Table

Graph

parameters

for

random

graphs

used

Density

n

Class

256 512 1024 2048

UV

NT

UV

NT

UV

NT

UV

NT

UV

NT

UV

NT

ne

118 142 239 287

477 579 970 1181

1937 2354 3875 4715

m

n

h

l

ne

94 109 189 219

383 446 770 896

1548 1806 3103 3628

m

n

h

l

ne

78 86 154 171

316 351 634 705

m

n

h

l

ne

82 86 153 161

290 305 540 569

m

n

log

n

h

l

ne

144 218 220

m

npn

h

l

ne

m

h

l

Table

Quality

of

solutions

on

random

graphs

n

n

m

n

m

n

m

n

log

n

m

n

m

n

m

n

256 512 1024 2048

merit

-LRB-

heuristic

NT

-RRB-

Figure

Winning

merit

of

heuristic

NT

over

heuristic

UV

Time

-LRB-

in

sec

-RRB-

Time

-LRB-

in

sec

-RRB-

log

n

Time

-LRB-

in

sec

-RRB-

Time

-LRB-

in

sec

-RRB-

Time

-LRB-

in

sec

-RRB-

Time

-LRB-

in

sec

-RRB-

log

n

log

nlog

n

m

n

m

n

m

n

m

n

log

n

m

n

n

UV

NT

log

n

log

n

m

n

log

is

to

the

base

Figure

Tree-Construction

time

for

random

graphs

log

n

log

n

log

nlog

n

m

n

m

n

m

n

m

n

log

n

m

n

n

UV

Time

-LRB-

in

sec

-RRB-

Time

-LRB-

in

sec

-RRB-

Time

-LRB-

in

sec

-RRB-

Time

-LRB-

in

sec

-RRB-

Time

-LRB-

in

sec

-RRB-

Time

-LRB-

in

sec

-RRB-

log

n

m

n

NT

log

n

log

is

to

the

base

Figure

Cycle-Calculation

time

for

random

graphs

Appendix

This

program

finds

the

approximate

solutions

to

the

minimum-length

fundamental-cycles

set

problem

It

uses

two

heuristics

-LRB-

namely

UV

and

NT

-RRB-

to

solve

the

problem

At

the

end

related

statistics

are

written

in

an

output

file

The

program

has

a

random

graph

generator

which

generates

graphs

G

-LRB-

n

p

-RRB-

for

given

seed

values

The

usage

of

this

program

is

one

of

the

following

<n>

<ad>

<seed>

<output-file>

or

<name>

<n>

<output-file>

where

<n>

order

of

the

random

graph

<ad>

approximate

average-degree

of

the

graph

-LRB-

Note

p

ad

-LRB-

-RRB-

-RRB-

<seed>

seed

for

the

random

graph

generator

<name>

one

of

the

names

for

regular

graphs

i.e.

Toroid

-LRB-

-RRB-

Toroid

-LRB-

-RRB-

Toroid

-LRB-

-RRB-

HC

Hypercube

For

a

given

value

of

n

where

n

n

processors

are

employed

Each

processor

is

responsible

for

a

node

and

all

edges

that

are

incident

#include

<mpl.h>

#include

<stdio.h>

#include

<stdlib.h>

#include

<string.h>

#include

<errno.h>

#include

sys/time

h

#include

maspar/mp

libc.h

#include

#include

<math.h>

#define

#define

microsec

Global

Plural

Variables

plural

short

Pred

Predecessor

of

a

node

plural

short

Dist

Distance

of

a

node

from

the

root-node

plural

short

Degree

Degree

of

nodes

in

the

graph

plural

short

Unexplored

Reset

if

a

Tree

Node

has

been

explored

plural

short

Active

All

processors

with

iproc

n

plural

short

The

degree

of

nodes

in

the

tree

plural

short

E

-LSB-

-RSB-

Edge

list

for

every

node

Global

-LRB-

Singular

-RRB-

Variables

int

root

The

root-node

number

int

Total

fundamental-cycle

set

length

int

n

Order

of

the

graph

float

p

Parameter

p

for

generating

G

-LRB-

n

p

-RRB-

float

ad

Average

Degree

of

the

graph

int

seed

Seed

to

generate

random

graph

G

-LRB-

n

p

-RRB-

long

m

Number

of

edges

in

the

graph

float

density

Precise

density

of

the

-LRB-

input

-RRB-

graph

int

Maximum-degree

of

the

-LRB-

input

-RRB-

graph

int

Minimum-degree

of

the

-LRB-

input

-RRB-

graph

int

height

Height

of

the

tree

int

Degree

of

the

tree

int

Number

of

nodes

which

were

explored

FILE

outptr

Output

file

-LRB-

pointer

-RRB-

for

STATISTICS

void

GenerateRandomGraph

-LRB-

-RRB-

Generates

a

random

graph

G

-LRB-

n

p

-RRB-

double

-LRB-

void

-RRB-

Generates

a

tree

by

one

of

the

heuristics

double

-LRB-

void

-RRB-

Generates

a

tree

by

one

of

the

heuristics

double

CalculateCycles

-LRB-

void

-RRB-

Calculates

total

length

of

the

fundamentalcycles

given

a

graph

and

its

spanning

tree

void

PrintGraph

-LRB-

void

-RRB-

Prints

the

input

graph

void

PrintTree

-LRB-

void

-RRB-

Prints

the

spanning

tree

void

-LRB-

-RRB-

Generates

a

Torid

void

-LRB-

-RRB-

Generates

a

Torid

void

-LRB-

-RRB-

Generates

a

Torid

void

Hypercube

-LRB-

-RRB-

Generates

a

Hypercube

main

-LRB-

argc

argv

-RRB-

int

argc

char

argv

-LSB-

-RSB-

-LCB-

int

i

j

H

float

treeTimeSTATS

-LSB-

-RSB-

cycleTimeSTATS

-LSB-

-RSB-

totalTimeSTATS

-LSB-

-RSB-

long

cycleLengthSTATS

-LSB-

-RSB-

int

treeHeightSTATS

-LSB-

-RSB-

int

minTreeSTATS

-LSB-

-RSB-

maxTreeSTATS

-LSB-

-RSB-

int

-LSB-

-RSB-

switch

-LRB-

argc

-RRB-

-LCB-

case

n

atoi

-LRB-

argv

-LSB-

-RSB-

-RRB-

ad

atof

-LRB-

argv

-LSB-

-RSB-

-RRB-

p

ad

-LRB-

-RRB-

seed

atoi

-LRB-

argv

-LSB-

-RSB-

-RRB-

outptr

-LRB-

FILE

-RRB-

fopen

-LRB-

argv

-LSB-

-RSB-

a

-RRB-

GenerateRandomGraph

-LRB-

n

p

seed

-RRB-

break

case

n

atoi

-LRB-

argv

-LSB-

-RSB-

-RRB-

outptr

-LRB-

FILE

-RRB-

fopen

-LRB-

argv

-LSB-

-RSB-

a

-RRB-

if

-LRB-

strcmp

-LRB-

argv

-LSB-

-RSB-

-RRB-

-RRB-

-LRB-

n

-RRB-

else

if

-LRB-

strcmp

-LRB-

argv

-LSB-

-RSB-

-RRB-

-RRB-

-LRB-

n

-RRB-

ii

else

if

-LRB-

strcmp

-LRB-

argv

-LSB-

-RSB-

-RRB-

-RRB-

-LRB-

n

-RRB-

else

if

-LRB-

strcmp

-LRB-

argv

-LSB-

-RSB-

HC

-RRB-

-RRB-

Hypercube

-LRB-

n

-RRB-

else

-LCB-

printf

-LRB-

Error

First

Argument

is

or

HC

n

-RRB-

exit

-LRB-

-RRB-

-RCB-

break

default

printf

-LRB-

Error

Usage

is

<n>

<p>

<seed>

<outfile>

n

-RRB-

printf

-LRB-

or

<name>

<n>

<outfile>

n

-RRB-

exit

-LRB-

-RRB-

break

-RCB-

PrintGraph

-LRB-

-RRB-

Running

Heuristic

UV

treeTimeSTATS

-LSB-

-RSB-

-LRB-

-RRB-

cycleTimeSTATS

-LSB-

-RSB-

CalculateCycles

-LRB-

-RRB-

totalTimeSTATS

-LSB-

-RSB-

treeTimeSTATS

-LSB-

-RSB-

cycleTimeSTATS

-LSB-

-RSB-

treeHeightSTATS

-LSB-

-RSB-

height

maxTreeSTATS

-LSB-

-RSB-

cycleLengthSTATS

-LSB-

-RSB-

-LSB-

-RSB-

PrintTree

-LRB-

-RRB-

Running

Heuristic

NT

treeTimeSTATS

-LSB-

-RSB-

-LRB-

-RRB-

cycleTimeSTATS

-LSB-

-RSB-

CalculateCycles

-LRB-

-RRB-

totalTimeSTATS

-LSB-

-RSB-

treeTimeSTATS

-LSB-

-RSB-

cycleTimeSTATS

-LSB-

-RSB-

treeHeightSTATS

-LSB-

-RSB-

height

maxTreeSTATS

-LSB-

-RSB-

cycleLengthSTATS

-LSB-

-RSB-

-LSB-

-RSB-

PrintTree

-LRB-

-RRB-

Writing

Statistics

fprintf

-LRB-

outptr

TreeHeight

-RRB-

for

-LRB-

H

H

H

-RRB-

fprintf

-LRB-

outptr

d

treeHeightSTATS

-LSB-

H

-RSB-

-RRB-

fprintf

-LRB-

outptr

nMaxTree

-RRB-

for

-LRB-

H

H

H

-RRB-

fprintf

-LRB-

outptr

d

maxTreeSTATS

-LSB-

H

-RSB-

-RRB-

fprintf

-LRB-

outptr

nCycleLength

-RRB-

for

-LRB-

H

H

H

-RRB-

fprintf

-LRB-

outptr

d

cycleLengthSTATS

-LSB-

H

-RSB-

-RRB-

fprintf

-LRB-

outptr

nTreeTime

-RRB-

for

-LRB-

H

H

H

-RRB-

fprintf

-LRB-

outptr

f

treeTimeSTATS

-LSB-

H

-RSB-

-RRB-

fprintf

-LRB-

outptr

nCycleTime

-RRB-

for

-LRB-

H

H

H

-RRB-

fprintf

-LRB-

outptr

f

cycleTimeSTATS

-LSB-

H

-RSB-

-RRB-

fprintf

-LRB-

outptr

nTotalTime

-RRB-

for

-LRB-

H

H

H

-RRB-

fprintf

-LRB-

outptr

f

totalTimeSTATS

-LSB-

H

-RSB-

-RRB-

fprintf

-LRB-

outptr

nNumExplored

-RRB-

for

-LRB-

H

H

H

-RRB-

fprintf

-LRB-

outptr

d

-LSB-

H

-RSB-

-RRB-

fclose

-LRB-

outptr

-RRB-

-RCB-

iii

double

-LRB-

void

-RRB-

-LCB-

short

tsize

Number

of

nodes

in

the

tree

so

far

short

new

New

node

added

to

the

tree

int

i

j

temp

Counter

temporraries

struct

Structures

for

measuring

time

double

time

Returned

by

this

routine

plural

short

Non-tree

neighbors

of

the

new

node

plural

int

ii

jj

kk

Plural

counters

temporaries

plural

short

Deg

Degree

of

nodes

-LRB-

changes

in

the

algorithm

-RRB-

plural

short

Vt

Set

if

a

node

has

been

included

in

the

tree

plural

short

nontree

The

number

of

new

non-tree

edges

induced

Initialization

Pred

-LRB-

-RRB-

Dist

Vt

Deg

Degree

root

if

-LRB-

iproc

n

-RRB-

Unexplored

Active

else

Unexplored

Active

mpGetRUsage

-LRB-

-RRB-

Choosing

the

node

with

highest

degree

as

the

root

node

if

-LRB-

Active

-RRB-

if

-LRB-

Degree

-LRB-

Degree

-RRB-

-RRB-

new

root

selectFirst

-LRB-

-RRB-

tsize

proc

-LSB-

root

-RSB-

Vt

proc

-LSB-

root

-RSB-

Pred

For

the

root

of

the

tree

proc

-LSB-

root

-RSB-

Dist

Pred

and

Dist

are

for

-LRB-

i

i

proc

-LSB-

root

-RSB-

Degree

i

-RRB-

proc

-LSB-

proc

-LSB-

root

-RSB-

E

-LSB-

i

-RSB-

-RSB-

Deg

while

-LRB-

tsize

n

-RRB-

-LCB-

Selecting

the

next

node

to

explore

if

-LRB-

tsize

-RRB-

-LCB-

if

-LRB-

Vt

Deg

-RRB-

if

-LRB-

nontree

-LRB-

nontree

-RRB-

-RRB-

if

-LRB-

Dist

-LRB-

Dist

-RRB-

-RRB-

new

selectFirst

-LRB-

-RRB-

proc

-LSB-

new

-RSB-

Vt

This

sets

the

tree-flag

for

new

-RCB-

End

if

proc

-LSB-

new

-RSB-

Deg

proc

-LSB-

new

-RSB-

Unexplored

for

-LRB-

i

-LRB-

temp

proc

-LSB-

new

-RSB-

E

-LSB-

i

-RSB-

-RRB-

-LRB-

-RRB-

i

-RRB-

if

-LRB-

proc

-LSB-

temp

-RSB-

Vt

-RRB-

proc

-LSB-

temp

-RSB-

if

-LRB-

-LRB-

-RRB-

-RRB-

-LCB-

fprintf

-LRB-

outptr

Error

Graph

is

disconnected

-LRB-

Aborting

-RRB-

n

-RRB-

exit

-LRB-

-RRB-

-RCB-

tsize

-LRB-

-RRB-

iv

if

-LRB-

-RRB-

-LCB-

Vt

Pred

new

Dist

proc

-LSB-

new

-RSB-

Dist

-RCB-

Updating

Deg

if

-LRB-

-RRB-

for

-LRB-

ii

ii

Degree

ii

-RRB-

if

-LRB-

router

-LSB-

E

-LSB-

ii

-RSB-

-RSB-

Unexplored

-RRB-

while

-LRB-

-LRB-

plural

-RRB-

-RRB-

if

-LRB-

connected

-LRB-

E

-LSB-

ii

-RSB-

-RRB-

-RRB-

-LCB-

router

-LSB-

E

-LSB-

ii

-RSB-

-RSB-

Deg

break

-RCB-

Calculating

non-tree

edges

nontree

if

-LRB-

-LRB-

Vt

-RRB-

-LRB-

Unexplored

-RRB-

-LRB-

Deg

-RRB-

-RRB-

for

-LRB-

ii

ii

Degree

ii

-RRB-

if

-LRB-

-LRB-

router

-LSB-

E

-LSB-

ii

-RSB-

-RSB-

Vt

-RRB-

-RRB-

nontree

-LRB-

router

-LSB-

E

-LSB-

ii

-RSB-

-RSB-

Degree

router

-LSB-

E

-LSB-

ii

-RSB-

-RSB-

Deg

-RRB-

-RCB-

End

while

mpGetRUsage

-LRB-

-RRB-

time

-LRB-

double

-RRB-

-LRB-

dputime.tv

sec

dputime.tv

sec

-RRB-

-LRB-

dputime.tv

usec

dputime.tv

usec

-RRB-

microsec

if

-LRB-

Active

-RRB-

-LCB-

height

-LRB-

Dist

-RRB-

Calculating

Degree

of

every

node

-LRB-

-LRB-

plural

int

-RRB-

Pred

-RRB-

All

-LRB-

p

-LRB-

v

-RRB-

v

-RRB-

This

corresponds

to

-LRB-

v

p

-LRB-

v

-RRB-

-RRB-

proc

-LSB-

-RSB-

proc

-LSB-

root

-RSB-

-LRB-

-RRB-

-LRB-

-LRB-

-LRB-

Unexplored

-RRB-

-RRB-

-RRB-

-RCB-

return

time

-RCB-

double

-LRB-

void

-RRB-

-LCB-

short

tsize

Number

of

nodes

in

the

tree

so

far

short

new

New

node

added

to

the

tree

int

i

j

temp

Counter

temporraries

struct

Structures

for

measuring

time

double

time

Returned

by

this

routine

plural

short

Non-tree

neighbors

of

the

new

node

plural

int

ii

jj

kk

Plural

counters

temporaries

plural

short

Deg

Degree

of

nodes

-LRB-

changes

in

the

algorithm

-RRB-

plural

short

Vt

Set

if

a

node

has

been

included

in

the

tree

Initialization

Pred

-LRB-

-RRB-

Dist

Vt

v

Deg

Degree

root

if

-LRB-

iproc

n

-RRB-

Unexplored

Active

else

Unexplored

Active

mpGetRUsage

-LRB-

-RRB-

Choosing

the

node

with

highest

degree

as

the

root

node

if

-LRB-

Active

-RRB-

if

-LRB-

Degree

-LRB-

Degree

-RRB-

-RRB-

new

root

selectFirst

-LRB-

-RRB-

tsize

proc

-LSB-

root

-RSB-

Vt

proc

-LSB-

root

-RSB-

Pred

For

the

root

of

the

tree

proc

-LSB-

root

-RSB-

Dist

Pred

and

Dist

are

for

-LRB-

i

i

proc

-LSB-

root

-RSB-

Degree

i

-RRB-

proc

-LSB-

proc

-LSB-

root

-RSB-

E

-LSB-

i

-RSB-

-RSB-

Deg

while

-LRB-

tsize

n

-RRB-

-LCB-

Selecting

the

next

node

to

explore

if

-LRB-

tsize

-RRB-

-LCB-

if

-LRB-

Vt

Deg

-RRB-

if

-LRB-

Deg

-LRB-

Deg

-RRB-

-RRB-

if

-LRB-

Dist

-LRB-

Dist

-RRB-

-RRB-

new

selectFirst

-LRB-

-RRB-

proc

-LSB-

new

-RSB-

Vt

This

sets

the

tree-flag

for

new

-RCB-

End

if

proc

-LSB-

new

-RSB-

Deg

proc

-LSB-

new

-RSB-

Unexplored

for

-LRB-

i

-LRB-

temp

proc

-LSB-

new

-RSB-

E

-LSB-

i

-RSB-

-RRB-

-LRB-

-RRB-

i

-RRB-

if

-LRB-

proc

-LSB-

temp

-RSB-

Vt

-RRB-

proc

-LSB-

temp

-RSB-

if

-LRB-

-LRB-

-RRB-

-RRB-

-LCB-

fprintf

-LRB-

outptr

Error

Graph

is

disconnected

-LRB-

Aborting

-RRB-

n

-RRB-

exit

-LRB-

-RRB-

-RCB-

tsize

-LRB-

-RRB-

if

-LRB-

-RRB-

-LCB-

Vt

Pred

new

Dist

proc

-LSB-

new

-RSB-

Dist

-RCB-

Updating

Deg

if

-LRB-

-RRB-

for

-LRB-

ii

ii

Degree

ii

-RRB-

if

-LRB-

router

-LSB-

E

-LSB-

ii

-RSB-

-RSB-

Unexplored

-RRB-

while

-LRB-

-LRB-

plural

-RRB-

-RRB-

if

-LRB-

connected

-LRB-

E

-LSB-

ii

-RSB-

-RRB-

-RRB-

-LCB-

router

-LSB-

E

-LSB-

ii

-RSB-

-RSB-

Deg

break

-RCB-

-RCB-

End

while

vi

mpGetRUsage

-LRB-

-RRB-

time

-LRB-

double

-RRB-

-LRB-

dputime.tv

sec

dputime.tv

sec

-RRB-

-LRB-

dputime.tv

usec

dputime.tv

usec

-RRB-

microsec

if

-LRB-

Active

-RRB-

-LCB-

height

-LRB-

Dist

-RRB-

Calculating

Degree

of

every

node

-LRB-

-LRB-

plural

int

-RRB-

Pred

-RRB-

All

-LRB-

p

-LRB-

v

-RRB-

v

-RRB-

This

corresponds

to

-LRB-

v

p

-LRB-

v

-RRB-

-RRB-

proc

-LSB-

-RSB-

proc

-LSB-

root

-RSB-

-LRB-

-RRB-

-LRB-

-LRB-

-LRB-

Unexplored

-RRB-

-RRB-

-RRB-

-RCB-

return

time

-RCB-

void

GenerateRandomGraph

-LRB-

n

p

seed

-RRB-

int

n

seed

float

p

-LCB-

int

i

j

k

plural

short

flag

plural

short

ii

jj

kk

temp

#define

Largest

for

-LRB-

i

i

i

-RRB-

E

-LSB-

i

-RSB-

=-LRB-

-RRB-

Degree

Active

Unexplored

-LRB-

seed

iproc

-RRB-

if

-LRB-

iproc

n

-RRB-

-LCB-

for

-LRB-

i

i

n

i

-RRB-

-LCB-

flag

if

-LRB-

iproc

i

-RRB-

if

-LRB-

-LRB-

-RRB-

Largest

p

-RRB-

-LCB-

E

-LSB-

Degree

-RSB-

i

flag

-RCB-

if

-LRB-

flag

-RRB-

while

-LRB-

-LRB-

plural

-RRB-

-RRB-

if

-LRB-

connected

-LRB-

-LRB-

plural

-RRB-

i

-RRB-

-RRB-

-LCB-

router

-LSB-

-LRB-

plural

-RRB-

i

-RSB-

E

-LSB-

-LRB-

proc

-LSB-

i

-RSB-

Degree

-RRB-

-RSB-

iproc

break

-RCB-

End

if

-RCB-

End

for

-RCB-

End

if

Adding

more

edges

to

and

vertices

for

-LRB-

i

i

n

i

-RRB-

-LCB-

switch

-LRB-

proc

-LSB-

i

-RSB-

Degree

-RRB-

-LCB-

case

-LRB-

-RRB-

do

-LCB-

j

-LRB-

random

-LRB-

-RRB-

Largest

-RRB-

n

-RCB-

while

-LRB-

j

i

-RRB-

proc

-LSB-

i

-RSB-

E

-LSB-

Degree

-RSB-

j

proc

-LSB-

j

-RSB-

E

-LSB-

Degree

-RSB-

i

do

-LCB-

j

-LRB-

random

-LRB-

-RRB-

Largest

-RRB-

n

-RCB-

while

-LRB-

-LRB-

j

i

-RRB-

-LRB-

j

proc

-LSB-

i

-RSB-

E

-LSB-

-RSB-

-RRB-

-RRB-

vii

proc

-LSB-

i

-RSB-

E

-LSB-

Degree

-RSB-

j

proc

-LSB-

j

-RSB-

E

-LSB-

Degree

-RSB-

i

break

case

-LRB-

-RRB-

do

-LCB-

j

-LRB-

random

-LRB-

-RRB-

Largest

-RRB-

n

-RCB-

while

-LRB-

-LRB-

j

i

-RRB-

-LRB-

j

proc

-LSB-

i

-RSB-

E

-LSB-

-RSB-

-RRB-

-RRB-

proc

-LSB-

i

-RSB-

E

-LSB-

Degree

-RSB-

j

proc

-LSB-

j

-RSB-

E

-LSB-

Degree

-RSB-

i

break

default

break

-RCB-

-RCB-

if

-LRB-

iproc

n

-RRB-

-LCB-

for

-LRB-

ii

ii

Degree

ii

-RRB-

-LCB-

jj

=p

random

-LRB-

-RRB-

Degree

kk

=p

random

-LRB-

-RRB-

Degree

temp

E

-LSB-

jj

-RSB-

E

-LSB-

jj

-RSB-

E

-LSB-

kk

-RSB-

E

-LSB-

kk

-RSB-

temp

-RCB-

End

for

-RCB-

End

if

if

-LRB-

iproc

n

-RRB-

-LCB-

m

-LRB-

Degree

-RRB-

-LRB-

Degree

-RRB-

-LRB-

Degree

-RRB-

Unexplored

Active

-RCB-

fprintf

-LRB-

outptr

n

n

Random

Graph

G

-LRB-

d

f

d

-RRB-

m

d

av

deg

f

maxd

d

mind

d

n

n

ad

seed

m

m/n

-RRB-

-RCB-

double

CalculateCycles

-LRB-

void

-RRB-

-LCB-

plural

short

ancestry

-LSB-

-RSB-

plural

int

i

plural

int

j

plural

plural

int

plural

int

plural

int

temp

plural

int

plural

int

struct

double

time

int

k

FILE

p

mpGetRUsage

-LRB-

-RRB-

if

-LRB-

Active

-RRB-

-LCB-

First

init

local

ancestry

array

to

-LRB-

-RRB-

Then

fill

it

with

ancestry

i

Pred

while

-LRB-

root

-RRB-

viii

-LCB-

ancestry

-LSB-

i

-RSB-

router

-LSB-

-RSB-

Pred

-RCB-

ancestry

-LSB-

i

-RSB-

ancestry

-LSB-

i

-RSB-

-LRB-

-RRB-

i

At

this

point

Each

proc

has

its

own

ancestry

stored

Now

set

up

array

walk

looking

for

non-tree

edges

for

-LRB-

i

-LRB-

temp

E

-LSB-

i

-RSB-

-RRB-

=-LRB-

-RRB-

i

-RRB-

-LCB-

if

-LRB-

-LRB-

temp

Pred

-RRB-

-LRB-

router

-LSB-

temp

-RSB-

Pred

iproc

-RRB-

-LRB-

temp

iproc

-RRB-

-RRB-

-LCB-

router

-LSB-

temp

-RSB-

Pred

while

-LRB-

root

-RRB-

-LCB-

j

while

-LRB-

ancestry

-LSB-

j

-RSB-

-LRB-

-RRB-

-RRB-

-LCB-

if

-LRB-

ancestry

-LSB-

j

-RSB-

-RRB-

-LCB-

break

-RCB-

else

j

-RCB-

End

ancestry

check

while

loop

if

-LRB-

-RRB-

This

means

we

found

lca

early

break

else

router

-LSB-

-RSB-

Pred

-RCB-

End

while

root

router

-LSB-

-RSB-

Dist

-LRB-

-LRB-

Dist

router

-LSB-

E

-LSB-

i

-RSB-

-RSB-

Dist

-RRB-

-LRB-

-RRB-

-RRB-

-RCB-

End

if

-RCB-

end

for

-RCB-

end

if

Active

-LRB-

-RRB-

mpGetRUsage

-LRB-

-RRB-

time

-LRB-

double

-RRB-

-LRB-

dputime.tv

sec

dputime.tv

sec

-RRB-

-LRB-

dputime.tv

usec

dputime.tv

usec

-RRB-

microsec

return

time

-RCB-

void

PrintGraph

-LRB-

void

-RRB-

-LCB-

int

i

j

printf

-LRB-

d

n

n

-RRB-

for

-LRB-

i

i

n

i

-RRB-

-LCB-

printf

-LRB-

d

i

-RRB-

for

-LRB-

j

j

proc

-LSB-

i

-RSB-

Degree

j

-RRB-

printf

-LRB-

d

proc

-LSB-

i

-RSB-

E

-LSB-

j

-RSB-

-RRB-

ix

printf

-LRB-

n

-RRB-

-RCB-

-RCB-

void

PrintTree

-LRB-

void

-RRB-

-LCB-

int

i

for

-LRB-

i

i

n

i

-RRB-

if

-LRB-

root

i

-RRB-

printf

-LRB-

-LRB-

d

d

-RRB-

i

proc

-LSB-

i

-RSB-

Pred

-RRB-

printf

-LRB-

n

-RRB-

-RCB-

void

-LRB-

n

-RRB-

int

n

-LCB-

int

r

int

i

plural

short

ii

jj

double

sqrt

-LRB-

-RRB-

#define

-LRB-

ii

jj

-RRB-

-LRB-

-LRB-

-LRB-

ii

r

-RRB-

r

-RRB-

r

-LRB-

-LRB-

jj

r

-RRB-

r

-RRB-

-RRB-

r

sqrt

-LRB-

-LRB-

double

-RRB-

n

-RRB-

for

-LRB-

i

i

i

-RRB-

E

-LSB-

i

-RSB-

=-LRB-

-RRB-

Degree

Active

Unexplored

if

-LRB-

iproc

n

-RRB-

Active

ii

iproc/r

jj

iproc

r

if

-LRB-

Active

-RRB-

-LCB-

E

-LSB-

-RSB-

-LRB-

jj

-RRB-

E

-LSB-

-RSB-

-LRB-

ii

jj

-RRB-

E

-LSB-

-RSB-

-LRB-

-RRB-

E

-LSB-

-RSB-

-LRB-

ii

jj

-RRB-

-RCB-

fprintf

-LRB-

outptr

n

n

Toroid

-LRB-

-RRB-

-LRB-

d

-RRB-

m

d

av

deg

f

maxd

mind

d

n

n

m

n

ad

m/n

-RRB-

-RCB-

void

-LRB-

n

-RRB-

int

n

-LCB-

int

r

int

i

plural

short

ii

jj

kk

#define

-LRB-

i

j

k

-RRB-

-LRB-

-LRB-

-LRB-

i

r

-RRB-

r

-RRB-

r

r

-LRB-

-LRB-

j

r

-RRB-

r

-RRB-

r

-LRB-

-LRB-

k

r

-RRB-

r

-RRB-

-RRB-

for

-LRB-

r

r

r

r

n

r

-RRB-

for

-LRB-

i

i

i

-RRB-

E

-LSB-

i

-RSB-

=-LRB-

-RRB-

Degree

Active

Unexplored

x

if

-LRB-

iproc

n

-RRB-

Active

ii

iproc

-LRB-

r

r

-RRB-

jj

-LRB-

iproc

-LRB-

r

r

-RRB-

-RRB-

r

kk

-LRB-

iproc

-LRB-

r

r

-RRB-

-RRB-

r

if

-LRB-

Active

-RRB-

-LCB-

E

-LSB-

-RSB-

-LRB-

jj

kk

-RRB-

E

-LSB-

-RSB-

-LRB-

ii

jj

kk

-RRB-

E

-LSB-

-RSB-

-LRB-

kk

-RRB-

E

-LSB-

-RSB-

-LRB-

ii

jj

kk

-RRB-

E

-LSB-

-RSB-

-LRB-

-RRB-

E

-LSB-

-RSB-

-LRB-

ii

jj

kk

-RRB-

-RCB-

fprintf

-LRB-

outptr

n

n

Toroid

-LRB-

-RRB-

-LRB-

d

-RRB-

m

d

av

deg

f

maxd

mind

d

n

n

m

n

ad

m/n

-RRB-

-RCB-

void

-LRB-

n

-RRB-

int

n

-LCB-

int

r

int

i

plural

short

ii

jj

kk

ll

double

sqrt

-LRB-

-RRB-

#define

-LRB-

i

j

k

l

-RRB-

-LRB-

-LRB-

-LRB-

i

r

-RRB-

r

-RRB-

r

r

r

-LRB-

-LRB-

j

r

-RRB-

r

-RRB-

r

r

-LRB-

-LRB-

k

r

-RRB-

r

-RRB-

r

-LRB-

-LRB-

l

r

-RRB-

r

-RRB-

-RRB-

r

sqrt

-LRB-

sqrt

-LRB-

-LRB-

double

-RRB-

n

-RRB-

-RRB-

for

-LRB-

i

i

i

-RRB-

E

-LSB-

i

-RSB-

=-LRB-

-RRB-

Degree

Active

Unexplored

if

-LRB-

iproc

n

-RRB-

Active

ii

iproc

-LRB-

r

r

r

-RRB-

jj

-LRB-

iproc

-LRB-

r

r

r

-RRB-

-RRB-

-LRB-

r

r

-RRB-

kk

-LRB-

-LRB-

iproc

-LRB-

r

r

r

-RRB-

-RRB-

-LRB-

r

r

-RRB-

-RRB-

r

ll

-LRB-

-LRB-

iproc

-LRB-

r

r

r

-RRB-

-RRB-

-LRB-

r

r

-RRB-

-RRB-

r

if

-LRB-

Active

-RRB-

-LCB-

E

-LSB-

-RSB-

-LRB-

jj

kk

ll

-RRB-

E

-LSB-

-RSB-

-LRB-

ii

jj

kk

ll

-RRB-

E

-LSB-

-RSB-

-LRB-

kk

ll

-RRB-

E

-LSB-

-RSB-

-LRB-

ii

jj

kk

ll

-RRB-

E

-LSB-

-RSB-

-LRB-

ll

-RRB-

E

-LSB-

-RSB-

-LRB-

ii

jj

kk

ll

-RRB-

E

-LSB-

-RSB-

-LRB-

-RRB-

E

-LSB-

-RSB-

-LRB-

ii

jj

kk

ll

-RRB-

-RCB-

fprintf

-LRB-

outptr

n

n

Toroid

-LRB-

-RRB-

-LRB-

d

-RRB-

m

d

av

deg

f

maxd

mind

d

n

n

m

n

ad

m/n

-RRB-

-RCB-

void

Hypercube

-LRB-

n

-RRB-

xi

int

n

-LCB-

int

r

x

i

j

for

-LRB-

r

x

x

n

x

x

r

-RRB-

for

-LRB-

i

i

i

-RRB-

E

-LSB-

i

-RSB-

=-LRB-

-RRB-

Degree

r

Active

Unexplored

if

-LRB-

iproc

n

-RRB-

Active

for

-LRB-

i

j

i

n

i

i

j

-RRB-

E

-LSB-

j

-RSB-

iproc

i

fprintf

-LRB-

outptr

n

n

Hypercube

HC

-LRB-

d

-RRB-

m

d

av

deg

f

maxd

mind

d

n

n

m

r

ad

m/n

r

-RRB-

-RCB-

xii

fundamental cycles
parallel graph algorithms
parallel implementation
simd implementation
spanning tree