1

A Cycle Detection Based Efficient Approach for ConstructingSpanning Trees Directly from Non-regular Graphic Sequences

Prantik Biswas

1,*

,Shahin Shabnam

2

, Abhisek Paul

1

, Paritosh Bhattacharya

1

1

Department of Computer Science and n!ineerin!, "ational #nstitute of $echnolo!y, A!artala, #ndia

2

Department of Computer ScienceAssam %ni&ersity, Silchar, #ndia

Shahin.shbnm@gmail.com

Abstract

'eali(ation of !raphic se)uences and findin! the spannin! tree of a!raph are two popular problems of combinatorial optimi(ation A simple !raphthat reali(es a !i&en non+ne!ati&e inte!er se)uence is often termed as areali(ation of the !i&en se)uence #n this paper we ha&e proposed a method for obtainin! a spannin! tree directly from a de!ree se)uence by applyin! cycledetection al!orithm, pro&ided the de!ree se)uence is !raphic and non+re!ular$he proposed method is a two step process irst we apply an al!orithm to check whether the input se)uence is reali(able throu!h the construction of the ad-acencymatri. correspondin! to the de!ree se)uence $hen we apply the cycle detectional!orithm separately to !enerate the spannin! tree from it

!ey"ords#

Spannin! $ree, /raph, Al!orithms, Cycle detection,

/raphicreali(ation, De!ree se)uence, Ad-acency matri.

$ %ntroduction

Spannin! trees problems forms the core of a numerous set of problems in !raphtheory #t has a wide ran!e of application in &arious fields of science and technolo!yran!in! from computer and communication networks, wirin! connections, 0S#circuits desi!n to tra&ellin! salesman problem, multi+terminal flow problem, etc'ecently problems in biolo!y and medicine such as cancer detection, medicalima!in!, and proteomics, and national security and bioterrorism such as detectin! thespread of to.ins throu!h populations in the case of biolo!icalchemical warfare areanaly(ed with the aid of spannin! treesA spannin! tree of a connected undirected !raph / 3 40, 5, is defined as a tree $consistin! of all the &ertices of the !raph / #f the !raph / is disconnected then e&eryconnected component will ha&e a spannin! tree

T

i

, the collection of which formsthe spannin! forest of the !raph / A !raph may ha&e many spannin! treesAlthou!h a lar!e &ariety of al!orithms e.ists, that can compute the spannin! treefrom a !i&en !raph, determinin! it from a !i&en de!ree se)uence has not yet beentried Popular al!orithms were proposed by 6ruskal 7189 and Prim 71:9 that cansuccessfully compute the minimal spannin! tree of a !i&en !raph #n this paper weha&e applied a &ariant of Prim;s 71:9 al!orithm to determine the spannin! treedirectly from a !i&en de!ree se)uence of non+re!ular simple !raphs

2* "oacademictitlesordescriptionsofacademicpositionsshouldbeincludedintheaddresses$heaffiliationsshouldconsistoftheauthor;sinstitution,town,andcountryA finite se)uence d<

d

1

, d

2

, d

3

, . . . . , d

n

of nonne!ati&e inte!ers is said to be !raphicalif there e.ists some finite simple !raph /, ha&in! &erte. set 03=

v

1

, v

2

, v

3

, …. , v

n

>such that each

v

i

has de!ree

d

i

41 ? i ?n5 Althou!h it is )uite easy to determine thede!ree se)uence of a !i&en !raph, the con&erse procedure is potentially difficult $his problem is closely linked with the other branches of combinatorial analysis such asthreshold lo!ic, inte!er matrices, enumeration theory, etc $he problem also has awide ran!e of application in communication networks, structural reliability,stereochemistry, etc$wo necessary conditions for a se)uence to be !raphical are< 415 d

i

@ n for each i, and425

∑

i

=

1

n

d

i

is e&en owe&er none of these are sufficient condition for these)uence to be !raphic $he first known solutions were proposed independently bya&el 719 and akimi 729 in the mid 2

th

century Althou!h they pro&ided separate proofs yet their work is -ointly known as the a&el+akimi theoremith the ad&ent of time, well known necessary and sufficient conditions were published rds and /allai 79, 'yser 7E9, Ber!e 7F9, ulkerson, ofman and

ὅ

GcAndrew 7H9, BollobIs 7:9, /rnbaum 789 and Jsselbarth 7K9 independently

ὔ

proposed the sufficient condition for a de!ree se)uence to be !raphic Sierksma andoo!e&een 719 listed the se&en well known characteri(ations of a de!ree se)uenceand their e)ui&alence $he works of a&el+akimi were further e.tended by6leitman and an! 71E9, and that of rds and /allai by !!leton 71H9 and $ripathi

ὅ

and 0i-ay 7119 Dahl and latber! 7129 proposed a direct way of obtainin! $ripathyand 0i-ay;s result from a simple !eometrical obser&ation in&ol&in! weak ma-ori(ation $ripathy and $ya!i 719 pro&ided two ele!ant proofs of a&el+akimiand rds and /allai

ὅ

Lur proposed al!orithm is based on cycle detection al!orithm 0arious ele!ant cycledetection al!orithm of almost linear order can be easily found 71K, 29 A ma-or ad&anta!e of usin! cycle detection for breakin! a cycle is that remo&al of a sin!leed!e may result in breakin! of multiple cycles thereby reducin! the e.ecution time of the al!orithm#n this paper we ha&e taken the problem of determinin! a spannin! tree from a !i&ende!ree se)uence pro&ided the de!ree se)uence is !raphic and non+re!ular ere theterm non+re!ular implies that the !i&en se)uence is !raphic and its reali(ation !i&es anon+re!ular !raph e first check whether the input se)uence satisfies the basiccriteria for ha&in! a reali(ation "e.t we desi!n a sufficient condition by constructin!the ad-acency matri. correspondin! to the input se)uence inally we apply cycledetection al!orithm on the matri. to obtain a spannin! tree#n section 2 we ha&e !i&en a brief definition of the problem Section describes our proposed approach while section E illustrates the workin! of the proposed methodSection F discusses the results obtained e draw a concise conclusion in section H

& 'roblem Definition(

$he proposed problem can be di&ided into two sub+problems $he first part is todetermine whether the de!ree se)uence is !raphic and non+re!ular and to constructthe correspondin! ad-acency matri. if the !i&en de!ree se)uence is !raphic and non+re!ular $he second part is to construct the spannin! tree from the resultant ad-acencymatri.

o

Determination of graphic sequences

et /340, 5 be a finite simple !raph with &erte. set 0 and order n et each &erte.

v

i

has a de!ree

d

i

where 1 ? i ? n $hen the finite se)uence d<

d

1

, d

2

, d

3

, . . . . , d

n

of nonne!ati&e inte!ers is called a de!ree se)uence of the !raph / $he problemstatement can be formally stated as follows

Given a finite degree sequence d: d

1

, d

2

, d

3

, . . . . , d

n

of non negative integers,whether there exists a graph G of order n with vertex set V such that each vertex v

i

has a degree d

i

where 1 i n.

o

!onstruction of spanning tree

et /340,5 be !i&en !raph on order

n

and si(e

m

A spannin! tree $ of / is definedas a connected !raph spannin! all the &ertices of the &erte. set 0 with e.actly

n"1

ed!es belon!in! to the ed!e set $he construction of spannin! tree re)uires us toeliminate

m"n#1

ed!es from the !i&en !raph / in order to obtain a sub+!raph $ of /such that it has order

n

and si(e

n"1

) 'roposed Approach

#n this section we demonstrate our proposed approach to sol&e the problem #n the first part, we present an al!orithm that determines whether a !i&en de!ree se)uence is!raphic by applyin! some basic criteria and constructin! the ad-acency matri.correspondin! to the input se)uence #n ne.t part, we present how the BS and DSal!orithm can be applied to obtain the spannin! tree from the ad-acency matri.obtained in the earlier part

o

Determination graphic sequence through the construction of ad$acenc% matrix

ere we propose an al!orithm that determines whether the !i&en de!ree se)uence is!raphical by constructin! the ad-acency matri. correspondin! to the !i&en de!reese)uence $he de!ree se)uence is stored in a &ector

degree&n'

of len!th

n

$he &ector

())ocated&n'

of len!th

n

helps us to determine whether a !i&en position in thead-acency matri. can be allocated 1, based on checkin! the number of positionsallocated in the

$

th

column of the

i

th

row with respect to the de!ree of &erte.

$

$he

n

.

n

&ector

(d$&n'&n'

is the ad-acency matri. that we construct usin! the al!orithm Lncethe entire matri. is constructed, the al!orithm then checks whether the resulted matri.is symmetric $he input to the al!orithm is the !i&en de!ree se)uence in a non+increasin! order and its output is the decision 4ie !raphic or non+!raphic5 #f the

Edecision of the al!orithm is !raphic, then we return the ad-acency matri.

(d$&n'&n'

thus constructed for further operationsA/L'#$G+ADM+CL"S$4

d: d

1

, d

2

, d

3

, . . , d

n

5

for

i N 1

to

n Allocated7i9 N O de!ree7i9 N

d

i

O r N de!ree79O sum N , fla! N , rfla! N O

for

i N 1

to

n

if

de!ree7i9 n

return

"on+/raphicO

if

de!ree7i9 Q r rfla! N rfla! R 1O sum N sum R de!ree7i9O

if

sum

mod

2 Q

return

"on+/raphicO

if

sum

mod

2 3

and

rfla! 3

return

/raphic and re!ularO

for

i N 1

to

n k N de!ree7i9O

for

- N 1

to

n

if

k

if

i 3 - Ad-7i97-9 N

else

if

Allocated7-9 @ de!ree7-9 Ad-7i97-9 N 1O Allocated7-9 N Allocated7-9 R 1O k N k T 1O

else

Ad-7i97-9 N O

else

Ad-7i97-9 N O

if

k

return

"on+/raphicO

for

i N 1

to

n

for

- N 1

to

n

if

Ad-7i97-9 Q Ad-7-97i9 fla! N fla! R 1O

if

fla!

return

"on+/raphicO

else

return

/raphic and Ad-7n97n9O

o

!onstruction of the spanning tree from the ad$acenc% matrix

#n this part we show how to apply cycle detection al!orithm to obtain the spannin!tree from the ad-acency matri.

(d$&n'&n'

obtained in the pre&ious section $heal!orithm takes the ad-acency matri. as input and processes it to obtain the spannin!treee randomly select a &erte.

u

from the set of unmarked &erte. 40+S5, where S is theset of marked &ertices e then check if the chosen &erte. is a member of a cycleknot

F#f it is so, we then identify any ed!e

e

x

and delete it from the cycle as well as fromthe list of ed!es e repeat this process with the selected &erte.

u

until the &erte. becomes free of all the cycles it is in&ol&ed with hene&er a node becomes free of allthe cycles it was associated with, we add it to the set of marked &ertices S e theselect another &erte. and continue the process $he al!orithm terminates when thenumber of ed!es UU becomes e)ual to U0U+1, since a tree with U0U &ertices contains U0U+1 ed!es $he al!orithm is !i&en below

%N'*T#

A wei!hted undirected !raph /3 40, 5

+*T'*T#

A GS$ $ of /

,STAlgo

4/, 0, , $5= $3/O

"hile

4UU U0U+15 =

SE.ECT

u

40+S5

ϵ

"hile

4$'%5 =

if

4

u

is a member of a cycleknot in $5 =

/emo0e

any ed!e

e

x

from the cycleknot containin! the &erte.

u

from $

*

3 +

e

x

O >

else

= S 3 S

u

O

brea1

O > > >

return

$O >

2 %llustration

#n this section we illustrate how the al!orithm !enerates the spannin! tree Supposethat we enter the de!ree se)uence<

+,3,3,3,3,2,2,2,1

#n the first part, the al!orithm !enerates the ad-acency matri. shown in fi!ure 1