Minimum Spanning Tree Parallel | Thread (Computing) | Graph Theory

December 13, 2017 | Author: Anonymous | Category: Virtualization
Share Embed


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 sanning tree of an undire!ted undire!ted grah using 1" Se#uent Se#uential ial model model $" Shared Shared %emory %emory model &'(')* &'(')* +(+), +(+),

Algorithms: Se#uential Algorithm: Assumtion: •

- . &/* ', is used to reresent a grah - hose erte2 set is / and edge set is '" A matri2 reresentation !an be used for !omuter storage and maniulation of a grah" et - be a grah hose erte2 set is / . 4 1* $* " " "*  n," This grah !an be uni#uely reresented by an n 2 n ad5a!en!y matri2 A hose entries ai5* 0 . i* 5  n* are dened as follos: ai5 . .

1* if i is !onne!ted to  5 0* otherise

 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 ede (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 oerations" 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 stes $"1 and $"$ !onsist !onsi st of n 7 9 7 1 and n 7 9 !omarisons* rese!tiely" rese!tiely"  Thus ste $* and hen!e the algorithm* re#uire re#uire time roortional to n71 9.1 &n 7 9,* hi!h is ;&n$,"



Parallel Algorithms:

1" Shared %emory %odel: Assumtions:  The model used is a '(') &'2!lusie (ead '2!lusie )rite, shared memory model folloing S8%D &Single 8nstru!tion Stream %ultile 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 9ees 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

Copyright © 2017 DATENPDF Inc.