文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > 高等教育 > 理学 > Dijkstra’s algorithm with Fibonacci heaps An executable description
侵权投诉

Dijkstra’s algorithm with Fibonacci heaps An executable description

Abstract. We construct a readable, compact and efficient implementation of Dijkstra’s shortest path algorithm and Fibonacci heaps using Constraint Handling Rules (CHR), which is increasingly used as a high-level rule-based general-purpose programming lang

Dijkstra’sAlgorithmwithFibonacciHeaps:

AnExecutableDescriptioninCHR

JonSneyers ,TomSchrijvers ,BartDemoen

Dept.ofComputerScience,K.U.Leuven,Belgium

{jon,toms,bmd}@cs.kuleuven.be

Abstract.Weconstructareadable,compactande cientimplementationofDijkstra’sshortestpathalgorithmandFibonacciheapsusingConstraintHandlingRules(CHR),whichisincreasinglyusedasahigh-levelrule-basedgeneral-purposeprogramminglanguage.Wemeasureitsperformanceindi erentCHRsystems,investigatingboththetheoreticalasymp-toticcomplexityandtheconstantfactorsrealizedinpractice.

1Introduction

ConstraintHandlingRules(CHR)[10]isahigh-levelprogramminglanguageextensionbasedonmulti-headedcommitted-choicerules.Originallydesignedforwritingconstraintsolvers,itisin-creasinglyusedasageneral-purposeprogramminglanguage.WeassumethatthereaderisfamiliarwithCHR,referringto[10]foranoverview.Recently,wehaveshown[21]thateveryalgorithmcanbeimplementedinCHRwiththebest-knownasymptotictimeandspacecomplexity.How-ever,itremainsanopenproblemwhetherclassicalalgorithmscanbeimplementedinCHRinanelegantandcompactway.Also,theconstantfactorhiddenbehindthenotionofasymptotictimecomplexitycouldbesohugetobecompletelyparalyzinginpractice.

EarlierworkbySchrijversandFr¨uhwirth[20]resultedinanelegantCHRimplementationoftheclassicalunion- ndalgorithmwhichhastheoptimalasymptotictimecomplexity.Inthispa-per,weconstructareadable,compactande cientCHRprogram(Section3)whichimplementsDijkstra’sshortestpathalgorithmwithFibonacciheaps.Weanalyzeitstheoreticaltimecomplex-ity(Section4)andexperimentallycompareitsperformanceindi erentCHRsystemsagainstalow-levelreferenceimplementationinC(Section5).

Inthispaper,wehopetodemonstratethatCHRcanbeusedas‘executablepseudo-code’forstudyinganddesigningalgorithmswhileconstructingarealprogramwiththedesiredtime(andspace)complexity.WealsoinvestigatetheconstantfactorseparatingCHRfromlow-levellanguages,andproposeamoree cienttypeofconstraintstoresforindexingongroundintegerarguments,improvingtheconstantfactor(forourprogram)by35%ormore.

2Thesingle-sourceshortestpathproblem

Theshortestpathproblem[26]isoneofthemostbasic,andmoststudied,problemsinalgorithmicgraphtheory.Itappearsasasub-probleminmanygraphrelatedalgorithms,suchasnetworkoptimizationalgorithms.GivenaweighteddirectedgraphG=(V,E)andasourcenodes∈V,weareinterestedinthe(shortest)distancesfromstoallothernodesofthegraph.ThisiscalledtheSingle-SourceShortestPath(SSSP)problem.Intherestofthispaperwewillusen=|V|todenotethenumberofnodesandm=|E|todenotethenumberofedges.Weassumetheweightstobenonnegative,butnotnecessarilyinteger.Wealsoassumethatthegraphisconnected,sonisO(m).

ThisworkwaspartlysupportedbyprojectsG.0144.03andG.0160.02fundedbytheResearchFounda-tion-Flanders(F.W.O.-Vlaanderen).ResearchAssistantoftheResearchFoundation-Flanders(F.W.O.-Vlaanderen).

第1页

你可能喜欢

热门文档

相关文档

  • fibonacci heaps

    Dijkstra’s algorithm wi... 16页 免费 Dijkstra... Meeting 11 October 4, 2005 Fibonacci Heaps The...cost applied to an initially empty Fibonacci heap...

  • Are Fibonacci heaps optimal

    Dijkstra’s algorithm wi... 10页 免费 Rangan. Relaxed fibonacc... 暂无...[5] invented an implementation of the priority queue called Fibonacci heaps....

  • Are Fibonacci heaps optimal

    Dijkstra’s algorithm wi... 10页 免费 Rangan. Relaxed fibonacc... 暂无...[5] invented an implementation of the priority queue called Fibonacci heaps....

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email