rected27eee.com

27eee.com  时间:2021-03-24  阅读:()
ProgrammingG.
K.
ManacherTechniquesEditorComputingConnectedComponentsonParallelComputersD.
S.
HirschbergRiceUniversityA.
K.
ChandraIBMThomasJ.
WatsonResearchCenterD.
V.
SarwateUniversityofIllinoismotivatedinpartbypracticalconsiderations.
Amongthemanyareastreatedintherecentliteraturearesorting[2,3,7,12,15],theevaluationofarithmeticexpressions,linearrecurrencesandpolynomials[4,8,10],matrixalgorithms[5,6,13],andgraphtheory[9,14,15].
InthispaperwepresentaparallelalgorithmCONNECTwhichdeterminestheconnectedcomponentsofanundirectedgraphwithnverticesintimeO(log2n)usingn2processors.
Next,wemodifythealgorithmtodemonstrateanobser-vationduetoF.
P.
PreparataandR.
L.
Probert,viz.
,n[n/lgn]processors1sufficetoachieveatimeboundofO(log2n).
Finally,weshowthatCONNECTcanbemodifiedtocomputethetransitiveclosureofannxnsymmetricBooleanmatrixintimeO(log2n)usingn[n/lgn]processors.
Weusethesingleinstructionstream-multipledatastream(SIMD)modelofparallelprocessors.
Itisassumedthattheprocessorshaveaccesstoacommonmemory,andthatsimultaneousaccesstothesamelocationispermittedforfetchinstructionsbutnotforstoreinstructions.
TheAlgorithmConnectWepresentaparallelalgorithmwhichusesn2processorstofindtheconnectedcomponentsofanundirectedgraphwithnverticesintimeO(log2n).
AnO0og2n)timeboundalsocanbeachievedusingonlyn[n/[log2n]]processors.
ThealgorithmcanheusedtofindthetransitiveclosureofasymmetricBooleanmatrix.
Weassumethattheprocessorshaveaccesstoacommonmemory.
Simultaneousaccesstothesamelocationispermittedforfetchinstructionsbutnotforstoreinstructions.
KeyWordsandPhrases:graphtheory,parallelprocessing,algorithms,transitiveclosure,connectedcomponentCRCategories:5.
25,5.
32,6.
22IntroductionParallelalgorithmsforsolvingvariouscomputationalproblemshavereceivedsubstantialattentionrecently,Permissiontocopywithoutfeeallorpartofthismaterialisgrantedprovidedthatthecopiesarenotmadeordistributedfordirectcommercialadvantage,theACMcopyrightnoticeandthetitleofthepublicationanditsdatoappear,andnoticeisgiventhatcopyingisbypermissionoftheAssociationforComputingMachinery.
Tocopyotherwise,ortorepublish,requiresafeeand/orspecificpermission.
TheworkofD.
S.
HirschbergwassupportedbytheNationalScienceFoundationunderGrantMCS-76-07683.
TheworkofD.
V.
SarwatewassupportedbytheJointServicesElectronicsProgramunderContractDAAG-29-78-C-0016.
Apreliminaryversionofthispaperwaspresentedatthe8thAnnualACMSymposiumontheTheoryofComputing,1976.
Authors'addresses:D.
S.
Hirschberg,DepartmentofElectricalEngineering,RiceUniversity,Houston,TX77001;A.
K.
Chandra,ComputerSciencesDepartment,IBMThomasJ.
WatsonResearchCenter,YorktownHeights,NY10598;D.
V.
Sarwate,CoordinatedScienceLaboratory,UniversityofIllinois,Urbana,IL61801.
1979ACM0001-0782/79/0800-0461$00.
75.
461LetV={0,1,2.
.
.
.
.
n-1),andletG=(V,E)denoteanundirectedgraphwithvertexsetVandedgesetE.
WerepresentGbyitsadjacencymatrixAwhichisannxnsymmetricBooleanmatrixwhereA(i,j)=1if(i,j)EEandA(i,j)=0otherwise.
Aconnectedcom-ponentofGisamaximalsubgraphofGsuchthatthereexistsapathbetweeneverypairofverticesinthesubgraph.
Eachvertexbelongstoexactlyoneconnectedcomponent,andweuseavectorDoflengthntospecifytheconnectedcomponentsofGasfollows.
IfGc--(Vc,Ec)isanyconnectedcomponent,thenforalliEV,,D(/)equalstheleastelementofV~.
TheparallelalgorithmCONNECTgivenbelowiterativelycomputesthevectorDfromtheadjacencymatrixAforanundi-rectedgraphonnvertices.
AlgorithmCONNECTInput:ThenXnadjacencymatrix.
4foranundirectedgraph.
Output:ThevectorDoflengthnsuchthatD(i)equalsthesmallest-numberedvertexintheconnectedcomponenttowhichibelongs.
Comment:Eachofthefollowingstepsisexecutedinparallelforalli,0__O,isadirectedgraphinwhicheveryvertexhasoutdegree1(i.
e.
exactlyoneedgeleaveseachvertex)andinwhichthereisexactlyonecycle,thelengthofthecyclebeingk+1.
Atree-loopisak-tree-loopforsomek.
Noticethatak-tree-loophasatleastk+1vertices.
Thereasonforthenametree-loopisthatifoneoftheedgesinthecycleisdeleted,weobtainarootedtree,therootbeingthevertexwithnoedgeleavingit.
Thedirec-tionofalltheedgesinthistreeisthereverseofthatgivenintheusualdefinition(seee.
g.
[1,p.
52]ofrootedtrees.
Weareinterestedinthesequelinl-tree-loops,whicharedefinedbythevectorCinthealgorithm,andinaspecialcaseof0-tree-loops(calledclubs)whicharedefinedbythevectorDinthealgorithm.
Definition.
Therootofa0-tree-loopisthevertexvsuchthattheedge(v,v)isthecycleoflength1.
Aclubisa0-tree-loopinwhichalltheedgesentertheroot.
LEMMA1.
LetGc=(Vc,Ec)denoteaconnectedcom-ponentofGsuchthatIVc[>-2anddefinethefunctionC:Vc---~VcbyC(i)=min(jlA[i,j]=1ANDj#i).
ThefunctionCdefinesadirectedgraphG~(C)=(Vc,E")whereE"={(i,C(i))[iEV~).
ThenG~(C)isacollectionofl-tree-loops,andthesmallest-numberedvertexineachtree-loopisinthecycleofthetree-loop.
PROOF.
FromthefactthatCisafunction,itiseasytoseethatGo(C)isacollectionoftree-loops.
SinceC(i)#i,noneofthetree-loopscanbea0-tree-loop.
Ifatree-loopinG~(C)isak-tree-loop,letVo,vl,v2.
.
.
.
.
vk,v0denotethesuccessiveverticesinthecycle(i.
e.
C(vi)-~-V/+lfori=0,1.
.
.
.
.
k-1andC(vk)=Vo)where,withoutlossofgenerality,v0=min{vo,vl.
.
.
.
.
vk).
How-ever,inthegraphG~,bothVoandv2areneighborsofvl.
HenceC(v~)=v2>Vowhichcontradictsthedefini-tionofCexceptwhenk=1.
Inthiscase,thetwoverticesintheloopareVoandvlwithC(vo)=v~andC(vl)=vo.
Asimilarargumentshowsthatthesmallest-numbered462vertexinthetree-loopmustbeinthecycleofthetree-loop.
[]LetusmaketheusualdefinitionofCk(v)asCl(v)=C(v)andCk(v)=C(Ck-l(v))fork>1.
LEMMA2.
LetCbedefinedasinLemma1andletvbeanyvertexinatree-loopofGo(C).
Letvoandvldenotethetwoverticesinthecycleofthetree-loop.
Then,forallN>_n-2,oneofthetwonumbersCN(v)andCN+I(v)equalsVoandtheotherequalsVx.
PROOF.
Theresultfollowseasilyfromthefactthatthepathfromvtothenearerofv0andvlisoflengthatmostn-2.
[]Thetwolemmasabovearethebasisofthemethodusedinthealgorithmtoidentifyverticesinthesameconnectedcomponent.
ThefunctionCsetsuptree-loopsineachconnectedcomponent,thefunctionCNiscom-putediteratively,andthenD(v)~--min{CN(v),CN+I(v)}setsupclubs(supervertices)withrootsv0.
Thereare,ofcourse,numerousbookkeepingdetailstobesettled,andwetakeuptheseintheproofofthefollowingtheorem.
THEOREM.
AlgorithmCONNECTcomputesthecon-nectedcomponentsoftheundirectedgraphGspecifiedbythesymmetricBooleanmatrixA.
PROOF.
Itiseasytoverifythatforthetrivialcon-nectedcomponentsconsistingofisolatedverticesLD(i)issettoiatstep1andremainsunchangedthroughouttheexecutionofthealgorithm.
Intheremainderofthisproof,weconsiderconnectedcomponentswithtwoormoreverticesonly.
LetG(D)=(V,ED)denotethedirectedgraphdefinedbyDwhereEo={(i,D(/))Ii~V}.
Aftertheexecutionofstep1,andjustpriortotheexecutionofstep2,G(D)satisfiesthefollowingproperties:(i)G(D)isasetofclubs(withdisjointvertexsets).
(ii)Therootofeachclubisthesmallest-numberedvertexintheclub.
(iii)Thevertexsetofanyclubisasubsetofthevertexsetofsomeconnectedcomponent.
WeshowthatifG(D)satisfiesproperties(i)-(iii)justpriortotheexecutionofstep2,thenafterexecutingsteps2-6,thenewfunctionD(computedatstep6)issuchthatthenewG(D)alsohasproperties(i)-(iii).
Furthermore,thenumbersofclubsineachconnectedcomponentisreducedbyafactorofatleast2,providedthattherewereatleasttwoclubsintheconnectedcomponentjustpriortostep2.
Itisinstructivetoobservewhathappensduringthefirstiterationofsteps2-6.
SinceDistheidentityfunc-tion,thefunctionCdefinedatstep2isexactlythefunctionofLemma1,andsetsup1-tree-loopsineachconnectedcomponentofG.
Step3doesnotchangeCbecausetheonlyjsatisfyingD(j)=iisiitself,andC(i)#i.
Instep4,thefunctionCiscopiedintoD,whileinstep5,CistransformedtoCNwhereN=2~g"_>n.
Step6setsD(i)tomin(CN(/),D(ClV(i))}whichisthesameasmin(C/V(i),cN+t(i)}.
ItfollowsfromLemma2thatforalli,D(i)equalsthesmallest-numberedvertexinCommunicationsAugust1979ofVolume22theACMNumber8thetree-loopthatcontainedi.
Thusthesetofverticesineachtree-loophasbeenmergedintoaclub.
Itiseasytoseethatafterthefirstiteration,G(D)satisfiesproperties(i)-(iii).
Sinceeach1-tree-loopcontainedatleasttwovertices,thenumberofclubsineachnontrivialcon-nectedcomponentisnomorethanhalfthenumberofvertices(dubs)thatitcontainedoriginally.
Asmentionedearlier,furtheriterationsofsteps2-6mergesupervertices,i.
e.
clubs.
Connectionsbetweensu-perverticesmaybedefinedasfollows.
LetVrdenotethesetofrootsofclubsinG(D)andletGr=(Vr,Er)denoteanundirectedgraphwherefori~j,(vi,vi)EErifandonlyifthereexistverticesv~andv~intheclubsofviandvj,respectively,suchthat(v~,v~~E.
Inotherwords,superverticesareneighborsifandonlyifthereisanedgeconnectingsomepairofmembervertices.
ThefunctionCissetupinsteps2and3.
Instep2,eachvertexiexaminestheclubmembershipsofitsneighborsandsetsC(i)tothesmallest-numberedneighboringclub.
Instep3,eachiEVrexaminesitsownclubmembers(specifiedbyD(j)=i)andpicksthesmallest-numberedofallthesmallest-numberedclubsthatthemembersfound.
Inshort,thefunctionC:Vr---)VrissuchthatforalliEVr,C(0equalsthesmallest-numberedvertexthatisadjacenttoiinGr.
AsinLemma1,Cdefinesacollectionofl-tree-loopsonGr.
Nextletusconsiderverticesi~Vr.
Forsuchvertices,thereisnojsuchthatD(j)=iandthusatstep3,C(/)isresettoD(/).
Hence,C:V~Vdefinesacollectionof1-tree-loopsonGbecauseeachnonrootispointingtoarootandtherootsarein1-tree-loops.
Itfollows(asinthediscussionofthefirstiterationofsteps2-6)thatafterstep6,thenewfunctionDissuchthatG(D)satisfiesproperties(i)-(iii).
Furthermore,each1-tree-loopinvolvestwoormoreverticesinGr,i.
e.
twoormoreclubs,andhenceineachconnectedcomponentthatcontainedatleasttwoclubs,thenumberofclubsisdecreasedbyafactorofatleast2.
Fromtheabovediscussion,itisclearthatthenumberofclubsineachconnectedcomponentdecreasesbyafactorofatleast2ateachiterationuntiltheconnectedcomponentconsistsofasingleclub.
Itiseasytoverifythatfurtheriterationsdonotaffectsuchsingleclubs.
Sincethereareatmostnvertices(clubs)tobeginwith,lgniterationssufficetoreduceeachconnectedcompo-nenttoasingleclub,whereclubmembershipisdefinedbyD.
[]WehaveshownthatCONNECTcomputesthecon-nectedcomponentsofthegraphGspecifiedbythesymmetricBooleanmatrixA.
ThetransitiveclosureofA,denotedbyA*,isgivenbyA*(i,j)=1ifandonlyifthereisapathinGfromitoj,i.
e.
ifandonlyifiandjareinthesameconnectedcomponent.
HenceweobtainanalgorithmforthetransitiveclosureofsymmetricmatricesbyaddingthefollowingsteptoCONNECT:7.
foralli,jfloifD(0=D(j)thenA*(i,j)~1andbychangingtheinput-outputspecificationsappro-priately.
463TimeandProcessorBoundsThemainloopoftheprogramisexecutedlgntimes,whilewithintheloop,theiterationatstep5isexecutedlgntimes.
Thusthealgorithmrequires~(log2n)timeregardlessofthenumberofprocessorsused.
Letussupposethatn2processorsareavailable.
Steps1,4,and6requireonlyO(1)timewhenever~(n)processorsareavailable,whilestep5requiresO(logn)timewiththesameprocessorrequirements.
Wenowshowthatsteps2and3alsocanbeprogrammedtoexecuteintimeO(logn)togiveanO(log2n)timeboundusingn2proc-essors.
Theprogramforstep2isStep2.
Thefollowingstepsareperformedinparallelfor0_2(a)Foralli,jdoifA(i,j)=1ANDO(j)#D(i)thenTemp(i,j)~--D(j)elseTemp(i,j)~--on2(b)Fork~--0until(lgn)-1doforalli,jdoTemp(i,j)min{Temp(i,j),Temp(i,j+2*modn)}2(c)ForallidoifTemp(i,0)=~thenC(i)~D(i)elseC(i)~Temp(i,O)Hereonmeansanynumberexceedingn-1.
Instep2(a)thenumberswhoseminimumistobecomputedarestoredinthearrayTemp.
Instep2(b),theminimumisfoundasfollows.
AtthefirstiterationTemp(i,0)iscomparedwithTemp(i,1)asisTemp(i,2)withTemp(i,3),Temp(i,4)withTemp(i,5).
.
.
etc.
Attheseconditeration,Temp(i,0)iscomparedwithTemp(i,2),Temp(i,4)withTemp(i,6)etc.
Theformercomparisonfindsmin(Temp(i,j),0<_j<--3},whilethelatterfindsmin{Temp(i,j),4<_j<_7)etc.
Thus,inlgniterationstheminimumisfound.
Themethodissimplebutwaste-fulofprocessorsinthat,forexample,theresultofcomparingTemp(i,1)withTemp(i,2)isnotusedatall.
Obviously,foreachvalueofi,[n/2]processorswouldsufficeforthefirstiteration,[[n/2]/2]forthesecondetc.
Theprogramforstep3issimilarandwillnotbestatedseparately.
Thenetresultisthefollowingtheorem.
THEOREM.
AlgorithmCONNECTfindstheconnectedcomponentsofanundirectedgraphwithnverticesintimeO(log2n)usingn2processors.
COROLLARY.
Thetransitiveclosureofann*nsym-metricBooleanmatrixcanbefoundintimeO(log2n)usingnzprocessors.
ThereductioninthenumberofprocessorsthatwasobservedbyPreparataandProbertoccursasfollows.
Wepartitiontheintegers{0___jEachsuchsubset(exceptpossiblytheonewithk=[n/lgn]-1)haslgnelements.
Theideaistocomputethen2entriesofthearr~iyTempintimeO(logn)usingn[n/lgn]processors.
InordertocomputetheminimumvalueofTemp(i,j)for0_ThesearefoundintimeCommunicationsAugust1979ofVolume22theACMNumber8O(logn)viasequentialsearch.
Then,theminimumofthe[n/lgn]candidateminimaisfound(asinstep2(b)above)intimeO(logn-loglogn)using[n/lgn]processorsateachstep.
Thegrubbydetailsareasfollows.
Step2.
Thefollowingstepsareperformedinparallelfor0_2(a)ForI,,-0until(lgn)-1doforalli,kdoifA(i,l+klgn)=1ANDD(i)~D(I+klgn)thenTemp(i,1+klgn)*--D(I+klgn)elseTemp(i,l+klgn)~2(b)Forl~luntil(lgn)-1doforalli,kdoTemp(i,kIgn)~min{Temp(i,klgn),Temp(i,l+klgn)}2(c)For1~--0until(lgrn/lgn'D-1doforalli,kdoTemp(Lklgn)~min{Temp(i,klgn),Temp(i,(k+2t)lgnmodn)}2(d)ForallidoifTemp(i,0)=oothenC(i)*--D(i)elseC(i)~Temp(i,O)Intheaboveprogram,wehaveignoredthefactthatoneofthe[n/lgn]subsetsmaycontainfewerthanlgnelements.
Onewayaroundthisistopadthearrays,4,C,andDapproximately.
Anotherpossibilityistoreplacel+klgnby(l+klgn)modn.
Theprogramforstep3issimilarandwehavethefollowingtheorem.
THEOREM.
AlgorithmCONNECTfindstheconnectedcomponentsofanundirectedgraphwithnverticesintimeO(log2n)usingnrn/lgn]processors.
COROLLARY.
ThetransitiveclosureofannXnsym-metricBooleanmatrixcanbefoundintimeO(log2n)usingn[n/lgn]processors.
Remark.
In[5],itisshownthatthetransitiveclosureofanarbitrarynxnBooleanmatrixcanbefoundintimeO(log2n)usingO(nl°g27/logn)processors.
AlthoughtheexponentofnmaybereducedslightlybyusingsomerecentresultsofPan[11],itisclearthatsymmetryreducesprocessorrequirementssignificantlyforthetran-sitiveclosureproblem.
7.
Hirschberg,D.
S.
Fastparallelsortingalgorithms.
Comm.
ACM21,8(Aug.
1978),657-661.
8.
Hyafil,L.
,andKung,H.
T.
Thecomplexityofparallelevaluationoflinearrecurrences.
J.
ACM24,(July1977),513-521.
9.
Levitt,K.
N.
,andKautz,W.
H.
Cellulararraysforthesolutionofgraphproblems.
Comm.
ACM15,(Sept.
1972),789-801.
10.
Munro,I.
,]ndPaterson,M.
Optimalalgorithmsforparallelpolynomialevaluation.
J.
Comp.
Syst.
Sci.
7(1973),183-198.
11.
Pan,V.
Y.
Strassen'salgorithmisnotoptimal.
Proc.
19thAnnu.
Symp.
onFoundationsofComptr.
Sci.
,1978,pp.
166-176.
12.
Preparata,F.
P.
Newparallel-sortingschemes.
IEEETrans.
Comptrs.
C-27(July1978),669-673.
13.
Preparata,F.
P.
,andSarwate,D.
V.
Animprovedparallelprocessorboundinfastmatrixinversion.
Inf.
Proc.
Letters7(April1978),148-150.
14.
Reghbati,E.
,andCorneil,D.
C.
Parallelcomputationsingraphtheory.
SlAMJ.
Comping.
7(May1978),230-237.
15.
Savage,C.
D.
Parallelalgorithmsforgraphtheoreticproblems.
Ph.
D.
Th.
,U.
ofIllinois,Urbana,I11.
,Aug.
1977.
16.
Thompson,C.
D.
,andKung,H.
T.
Sortingonamesh-connectedparallelcomputer.
Comm.
ACM20,4(April1977),263-271.
ReceivedOctober1975;revisedOctober1978References1.
Aho,AN.
,Hopcroft,J.
E.
,andUllman,J.
D.
TheDesignandAnalysisofComputerAlgorithms,Addison-Wesley,Reading,Mass.
,1974.
2.
Batcher,K.
E.
Sortingnetworksandtheirapplications.
Proc.
AFIPS1968SJCC,Vol.
32,AFIPSPress,Montvale,N.
J.
,pp.
307-314.
3.
Baudet,G.
,andStevenson,D.
Optimalsortingalgorithmsforparallelcomputers.
1EEETrans.
Comptrs.
C-27(Jan.
1978),84-87.
4.
Brent,R.
P.
Theparallelevaluationofgeneralarithmeticexpressions.
J.
ACM21,(April1974),201-206.
5.
Chandra,A.
K.
Maximalparallelisminmatrixmultiplication.
~BMTech.
Rep.
RC6193,Sept.
1976.
6.
Csanky,L.
Fastparallelmatrixinversionalgorithms,SlAMJ.
Comping.
5(Dec.
1976),618-623.
464CommunicationsAugust1979ofVolume22theACMNumber8

腾讯云CVM云服务器大硬盘方案400GB和800GB数据盘方案

最近看到群里的不少网友在搭建大数据内容网站,内容量有百万篇幅,包括图片可能有超过50GB,如果一台服务器有需要多个站点的话,那肯定默认的服务器50GB存储空间是不够用的。如果单独在购买数据盘会成本提高不少。这里我们看到腾讯云促销活动中有2款带大数据盘的套餐还是比较实惠的,一台是400GB数据盘,一台是800GB数据盘,适合他们的大数据网站。 直达链接 - 腾讯云 大数据盘套餐服务器这里我们看到当前...

麻花云-香港CN2云服务器,安徽BGP线路,安徽移动大带宽!全系6折!

一、麻花云官网点击直达麻花云官方网站二、活动方案优惠码:专属优惠码:F1B07B 享受85折优惠。点击访问活动链接最新活动 :五一狂欢 惠战到底 香港云主机 1.9折起香港特价体验云主机CN2 云服务器最新上线KVM架构,,默认40G SSD,+10G自带一个IPv4,免费10Gbps防御,CPU内存带宽价格购买1核1G1M19元首月链接2核2G 2M92元/3个月链接2核4G3M112元/3个月...

LOCVPS(29.6元/月)KVM架构 香港/美国机房全场8折

LOCVPS商家我们还是比较熟悉的老牌的国内服务商,包括他们还有其他的产品品牌。这不看到商家的信息,有新增KVM架构轻量/迷你套餐,提供的机房包括香港云地和美国洛杉矶,适用全场8折优惠,月付29.6元起。LOCVPS是一家成立于2011年的稳定老牌国人商家,主要从事XEN、KVM架构的国外VPS销售,主推洛杉矶MC、洛杉矶C3、香港邦联、香港沙田电信、香港大埔、日本东京、日本大阪、新加坡等数据中心...

27eee.com为你推荐
哈利波特罗恩升级当爸为什么赫敏喜欢的是罗恩而不是哈里?真希望他们在一起。.cn域名cn域名和com域名有什么不同?哪个更好?好在哪里?同ip网站查询怎么查自己的服务器挂着哪些网站psbc.com邮政储蓄卡如何激活百花百游百花净斑方效果怎么样?125xx.com115xx.com是什么意思www.mywife.ccMywife-No 00357 MANAMI SAITO种子下载地址有么?求好心人给baqizi.cc孔融弑母是真的吗?haole012.com说在:012qq.com这个网站能免费挂QQ,是真的吗?关键词分析怎么样分析关键词?
132邮箱 东莞电信局 google镜像 国外服务器 轻博客 抢票工具 最好看的qq空间 789电视网 ca187 重庆电信服务器托管 iki 畅行云 服务器论坛 深圳主机托管 godaddyssl vpsaa g6950 dbank ddos攻击工具 上海服务器托管 更多