Minimum Spanning Tree Parallel | Thread (Computing) | Graph Theory
Short Description
Design and Analysis of ParallelAlgorithms Harsh Kumar 106113033 Problem Statement: To find the minimum spanning tree of ...
Description
Design and Analysis Analysis of Parallel Algorithms Harsh Kumar 106113033
Problem Problem Statement: Statement : To To nd the minimum sanning tree of an undire!ted undire!ted grah using 1" Se#uent Se#uential ial model model $" Shared Shared %emory %emory model &'(')* &'(')* +(+), +(+),
Algorithms: Se#uential Algorithm: Assumtion: •
- . &/* ', is used to reresent a grah - hose erte2 set is / and edge set is '" A matri2 reresentation !an be used for !omuter storage and maniulation of a grah" et - be a grah hose erte2 set is / . 4 1* $* " " "* n," This grah !an be uni#uely reresented by an n 2 n ad5a!en!y matri2 A hose entries ai5* 0 . i* 5 n* are dened as follos: ai5 . .
1* if i is !onne!ted to 5 0* otherise
procedure Sequential MST ( A )
Step 1: Include vertex v, in the MST and let c(v ) i = v o for i = 1, 2, . . ., n 1. Step 2: This step is repeated as lon as there are vertices not !et in the MST: (2.1) Include in the tree the closest vertex not !et in the tree" that is, for all vi not in the MST #nd the ede (v i, c(v )) for $hich dist (v i, c(v )) is i i s%allest and add it to the tree. (2.2) &or all u i not in the MST, update c(v )" that is, assu%in that v' $as i the %ost recentl! added vertex to the tree, then c(v ) i can e updated ! deter%inin the s%aller of dist (v i,i, c(v )) and dist (v i, v ). i '
Analysis: Ste 1 re#uires n !onstant time oerations" Ste $ is e2e!uted on!e for ea!h of n 7 1 erti!es" 8f there are already 9 erti!es in the tree* then stes $"1 and $"$ !onsist !onsi st of n 7 9 7 1 and n 7 9 !omarisons* rese!tiely" rese!tiely" Thus ste $* and hen!e the algorithm* re#uire re#uire time roortional to n71 9.1 &n 7 9,* hi!h is ;&n$,"
•
Parallel Algorithms:
1" Shared %emory %odel: Assumtions: The model used is a '(') &'2!lusie (ead '2!lusie )rite, shared memory model folloing S8%D &Single 8nstru!tion Stream %ultile Data 'lements, model of e2e!ution" in !harge> of the erti!es in / i" ?ote that Pi needs only to store the indi!es of the rst and last erti!es in /i" During the ro!ess of !onstru!ting the %ST and for ea!h erte2 in /i" that is not yet in the tree* Pi also 9ees tra!9 of the !losest erte2 in the tree* denoted !&," The eight matri2 ) of - is stored in shared memory* here i5 . dist &i* 5, for i* 5 . 0* 1* " " "* n 71" procedure EREW MST ( W ,TREE ) Step 1:
&1"1, Vertex vi ∈ Vo islabelled asa vertex already∈ thetree &1"$, fori =0 ¿ N −1 do ∈¿ for each vertex vj ∈ Vido
c ( vj )
View more...
Comments