USF Libraries
USF Digital Collections

An experimental study of distance sensitivity oracles

MISSING IMAGE

Material Information

Title:
An experimental study of distance sensitivity oracles
Physical Description:
Book
Language:
English
Creator:
Williams, Vincent
Publisher:
University of South Florida
Place of Publication:
Tampa, Fla
Publication Date:

Subjects

Subjects / Keywords:
Algorithm analysis; data structures; Dijkstra's algorithm; dynamic programming; experimental algorithmics; graphs and trees
Dissertations, Academic -- Engineering Computer Science -- Masters -- USF   ( lcsh )
Genre:
non-fiction   ( marcgt )

Notes

Abstract:
ABSTRACT: The paper ``A Nearly Optimal Oracle for Avoiding Failed Vertices and Edges'' by Aaron Bernstein and David Karger lays out a nearly optimal algorithm for finding the shortest distances and paths between vertices with any given single failure in constant time without reconstructing the oracle. Using their paper as a guideline, we have implemented their algorithm in C++ and recorded each step in this thesis. Each step has its own pseudo-code and its own analysis to prove that the entire oracle construction stays within the stated running time and total space bounds, from the authors. The efficiency of the algorithm is compared against that of the brute-force methods total running time and total space needed. Using multiple test cases with an increasing number of vertices and edges, we have experimentally validated that their algorithm holds true to their statements of space, running time, and query time.
Thesis:
Thesis (MSCS)--University of South Florida, 2010.
Bibliography:
Includes bibliographical references.
System Details:
Mode of access: World Wide Web.
System Details:
System requirements: World Wide Web browser and PDF reader.
Statement of Responsibility:
by Vincent Williams.
General Note:
Title from PDF of title page.
General Note:
Document formatted into pages; contains X pages.

Record Information

Source Institution:
University of South Florida Library
Holding Location:
University of South Florida
Rights Management:
All applicable rights reserved by the source institution and holding location.
Resource Identifier:
usfldc doi - E14-SFE0004679
usfldc handle - e14.4679
System ID:
SFS0027991:00001


This item is only available as the following downloads:


Full Text
xml version 1.0 encoding UTF-8 standalone no
record xmlns http:www.loc.govMARC21slim
leader nam 22 Ka 4500
controlfield tag 007 cr-bnu---uuuuu
008 s2010 flu s 000 0 eng d
datafield ind1 8 ind2 024
subfield code a E14-SFE0004679
035
(OCoLC)
040
FHM
c FHM
049
FHMM
090
XX9999 (Online)
1 100
Williams, Vincent.
0 245
An experimental study of distance sensitivity oracles
h [electronic resource] /
by Vincent Williams.
260
[Tampa, Fla] :
b University of South Florida,
2010.
500
Title from PDF of title page.
Document formatted into pages; contains X pages.
502
Thesis (MSCS)--University of South Florida, 2010.
504
Includes bibliographical references.
516
Text (Electronic thesis) in PDF format.
538
Mode of access: World Wide Web.
System requirements: World Wide Web browser and PDF reader.
3 520
ABSTRACT: The paper ``A Nearly Optimal Oracle for Avoiding Failed Vertices and Edges'' by Aaron Bernstein and David Karger lays out a nearly optimal algorithm for finding the shortest distances and paths between vertices with any given single failure in constant time without reconstructing the oracle. Using their paper as a guideline, we have implemented their algorithm in C++ and recorded each step in this thesis. Each step has its own pseudo-code and its own analysis to prove that the entire oracle construction stays within the stated running time and total space bounds, from the authors. The efficiency of the algorithm is compared against that of the brute-force methods total running time and total space needed. Using multiple test cases with an increasing number of vertices and edges, we have experimentally validated that their algorithm holds true to their statements of space, running time, and query time.
590
Advisor: Rahul Tripathi, Ph.D.
653
Algorithm analysis; data structures; Dijkstra's algorithm; dynamic programming; experimental algorithmics; graphs and trees
690
Dissertations, Academic
z USF
x Engineering Computer Science
Masters.
773
t USF Electronic Theses and Dissertations.
4 856
u http://digital.lib.usf.edu/?e14.4679



PAGE 1

AnExperimentalStudyofDistanceSensitivityOracles by VincentTroyWilliams Athesissubmittedinpartialfulllment oftherequirementsforthedegreeof MasterofScienceinComputerScience DepartmentofComputerScienceandEngineering CollegeofEngineering UniversityofSouthFlorida MajorProfessor:RahulTripathi,Ph.D. LawrenceO.Hall,Ph.D. SudeepSarkar,Ph.D. DateofApproval: 10/26/2010 Keywords:algorithmanalysis;datastructures;Dijkstra'salgorithm;dynamic programming;experimentalalgorithmics;graphsandtrees Copyright c 2010,VincentTroyWilliams

PAGE 2

DEDICATION tomyFather,MotherandBrother

PAGE 3

ACKNOWLEDGEMENTS IwouldliketothankDr.Tripathifortakingmeonashisresearchassistantand bringingtomyattentiontherecentworkonthe distancesensitivity problem[BK09]| theproblemofconstructingadatastructurecalled distancesensitivityoracle forany edge-weightedgraph G thatsupportsqueriesonshortestdistanceand/orpathfromany vertex x toanyvertex y avoidinganyvertex v in G .Alongtheway,hehashelpedme toimprovemycode,allowingforamorereliableandstablereleaseofthecodethatI canbeproudof. IwouldliketothankAaronBernsteinandDavidKarger,theauthorsofthepaperA NearlyOptimalOracleforAvoidingFailedVerticesandEdges"[BK09],fordeveloping anecientalgorithminbothspaceandtimeforthedistancesensitivityproblem. IwouldliketothankJohnBoyerforpostinghiscodeforaFibonacciheapimplementationofmin-priorityqueue[Boy97].Usinghiscode,Iwasabletohavethemost ecientimplementationofDijkstra'salgorithmforcomputingsingle-sourceshortest distancesandpaths. IwouldliketothankJohannesFischerandVolkerHeunfordevelopingcodeforthe RangeMinimumQueryRMQdatastructure[FH06]thatwasusedtominimizethe totalrunningtimeofthedistancesensitivityoracleconstruction.Ididmodifytheir codetoreturnthelargestvalueinarangeinsteadofthesmallest. IwouldliketothankDanMouldingforcreatingtheVisualLeakDetectorcode[Mou09]. HiscodewhenranonaWin32machinecompiledinVisualStudiohelpedmetond manymemoryleaks.

PAGE 4

TABLEOFCONTENTS LISTOFTABLESiii LISTOFFIGURESv LISTOFALGORITHMSvi ABSTRACTvii CHAPTER1INTRODUCTION1 1.1BackgroundandProblemDescription1 1.2Motivation3 1.3Notations4 CHAPTER2COMPUTINGALL-PAIRSOFSHORTESTPATHS6 2.1Denitionsofthe D H P ,and ST Tables6 2.2Creationofthe D H P ,and ST Tables6 CHAPTER3ASSIGNINGPRIORITIES11 3.1DenitionofCenters11 3.2Assign-PriorityAlgorithm11 CHAPTER4COVERINGCHAINS15 4.1Denitionsofthe Cr Cl ,and BCP Tables15 4.2Creationofthe Cr Cl ,and BCP Tables16 4.3FindingCentersonBothSidesofanAvoidingVertex19 CHAPTER5SHORTESTDISTANCESFROMALLCENTERSAVOIDING THEIRCOVEREDVERTICES20 5.1Denitionsofthe D k D k E c D k and d D k E Tables20 5.2Creationofthe D k D k E c D k and d D k E Tables21 CHAPTER6SHORTESTDISTANCESFROMALLVERTICESAVOIDING THEFIRSTEDGESOFTHEIRSHORTESTPATHS24 6.1Denitionsofthe De DeE c De ,and d DeE Tables24 6.2Creationofthe De DeE c De ,and d DeE Tables25 CHAPTER7BOTTLENECKVERTICES28 7.1Denitionofthe BV Table28 7.2Creationofthe BV Table29 i

PAGE 5

CHAPTER8SHORTESTDISTANCESBETWEENALLPAIRSOFVERTICESAVOIDINGTHEBOTTLENECKVERTICES32 8.1Denitionofthe DBV and FEBV Tables32 8.2Creationofthe DBV and FEBV Tables33 CHAPTER9ANSWERINGQUERIES36 9.1TypesofQueries36 9.2Query:ShortestDistanceAvoidingAFailedVertex37 9.3Query:ShortestDistanceAvoidingAFailedEdge38 9.4Query:ShortestPathAvoidingAFailedVertex39 9.5Query:ShortestPathAvoidingAFailedEdge41 CHAPTER10RESULTS43 10.1ExperimentalSetup43 10.1.1EnvironmentforSyntheticDataSets44 10.1.2EnvironmentforReal-WorldDataSets44 10.2TotalMemoryUsed-SyntheticDataSets45 10.3TotalMemoryUsed-Real-WorldDataSets48 10.4TotalConstructionTime-SyntheticDataSets48 10.4.1TheNearlyOptimalOracleandTheBrute-ForceMethod48 10.4.2All-PairsofShortestPaths52 10.4.3AssigningPriorities53 10.4.4CoveringChains54 10.4.5ShortestDistancesfromCenters56 10.4.6BottleneckTables58 10.5TotalConstructionTime-Real-WorldDataSets61 10.5.1TheNearlyOptimalOracleandTheBrute-ForceMethod61 10.5.2All-PairsofShortestPaths61 10.5.3AssigningPriorities62 10.5.4CoveringChains62 10.5.5ShortestDistancesfromCenters62 10.5.6BottleneckTables63 CHAPTER11CONCLUSION64 11.1FinalThoughts64 REFERENCES66 ABOUTTHEAUTHOREndPage ii

PAGE 6

LISTOFTABLES Table1.1NotationsusedinthisThesis5 Table10.1Memoryusageofthenearlyoptimaloracleonsynthetic testdatatotalmemoryusedismeasuredinkilobytes47 Table10.2Memoryusageofthebrute-forcemethodonsynthetictest datatotalmemoryusedismeasuredinkilobytes47 Table10.3Memoryusageofthenearlyoptimaloracleandthebruteforcemethodonreal-worldtestdatatotalmemoryused ismeasuredinkilobytes48 Table10.4Totalrunningtimesusedbythebrute-forcemethodon synthetictestdatarunningtimeismeasuredinseconds50 Table10.5Totalrunningtimesusedbythenearlyoptimaloracleon synthetictestdatarunningtimeismeasuredinseconds51 Table10.6TotalrunningtimesforthealgorithmAll-Pairs-ShortestPathsonsynthetictestdatarunningtimeismeasuredin seconds53 Table10.7TotalrunningtimesforthealgorithmAssign-Priorityon synthetictestdatarunningtimeismeasuredinseconds54 Table10.8TotalrunningtimesforthealgorithmsCreate-Cr-and-BCPTablesandCreate-Cl-Tableonsynthetictestdatarunning timeismeasuredinseconds55 Table10.9TotalrunningtimesforthealgorithmsCreate-D k -and-D k E TablesandCreate-De-and-DeE-Tablesonsynthetictest datarunningtimeismeasuredinseconds57 Table10.10TotalrunningtimesforthealgorithmsCreate-BV-Table andCreate-DBV-and-FEBV-Tablesonsynthetictestdata runningtimeismeasuredinseconds60 Table10.11Constructiontimesofthenearlyoptimaloracleandthe oraclegivenbythebrute-forcemethodonreal-worldtest datarunningtimeismeasuredinseconds61 iii

PAGE 7

Table10.12TotalrunningtimesforthealgorithmAll-Pairs-ShortestPathsonreal-worldtestdatarunningtimeismeasuredin seconds61 Table10.13TotalrunningtimesforthealgorithmAssign-Priorityon real-worldtestdatarunningtimeismeasuredinseconds62 Table10.14TotalrunningtimesforthealgorithmsCreate-Cr-and-BCPTablesandCreate-Cl-Tableonreal-worldtestdatarunningtimeismeasuredinseconds62 Table10.15TotalrunningtimesforthealgorithmsCreate-D k -and-D k E TablesandCreate-De-and-DeE-Tablesonreal-worldtest datarunningtimeismeasuredinseconds62 Table10.16TotalrunningtimesforthealgorithmsCreate-BV-Table andCreate-DBV-and-FEBV-Tablesonreal-worldtestdata runningtimeismeasuredinseconds63 iv

PAGE 8

LISTOFFIGURES Figure10.1Totalmemoryusedforthenearlyoptimaloracleonsynthetictestdata46 Figure10.2Totalmemoryusedforthebrute-forcemethodonsynthetic testdata46 Figure10.3Totalrunningtimesforthenearlyoptimaloracleonsynthetictestdata49 Figure10.4Totalrunningtimesforthebrute-forcemethodonsynthetictestdata49 Figure10.5TotalrunningtimesforthealgorithmAll-Pairs-ShortestPathsonsynthetictestdata52 Figure10.6TotalrunningtimesforthealgorithmAssign-Priorityon synthetictestdata54 Figure10.7TotalrunningtimesforthealgorithmsCreate-Cr-and-BCPTablesandCreate-Cl-Tableonsynthetictestdata55 Figure10.8TotalrunningtimesforthealgorithmsCreate-D k -and-D k ETablesandCreate-De-and-DeE-Tablesonsynthetictestdata56 Figure10.9TotalrunningtimesforthealgorithmsCreate-BV-Table andCreate-DBV-and-FEBV-Tablesonsynthetictestdata58 v

PAGE 9

LISTOFALGORITHMS 1Initialize-Single-Source7 2Relax8 3Construct-Shortest-Paths-Tree8 4All-Pairs-Shortest-Paths9 5Assign-Priority13 6Create-Cr-and-BCP-Tables17 7Create-Cl-Table18 8Find-Centers19 9CreateD k -andD k E -Tables22 10CreateDe -andDeE -Tables26 11MTC29 12Find-Bot30 13Create-BV-Table31 14CreateDBV -andFEBV -Tables34 15Shortest-Distance-Avoiding-Vertex37 16Shortest-Distance-Avoiding-Edge38 17Shortest-Path-Avoiding-Vertex40 18Create-Path-Avoiding-Vertex41 19Shortest-Path-Avoiding-Edge42 vi

PAGE 10

AnExperimentalStudyofDistanceSensitivityOracles VincentTroyWilliams ABSTRACT ThepaperANearlyOptimalOracleforAvoidingFailedVerticesandEdges"by AaronBernsteinandDavidKargerlaysoutanearlyoptimalalgorithmforndingthe shortestdistancesandpathsbetweenverticeswithanygivensinglefailureinconstant timewithoutreconstructingtheoracle.Usingtheirpaperasaguideline,wehave implementedtheiralgorithminC++andrecordedeachstepinthisthesis.Eachstep hasitsownpseudo-codeanditsownanalysistoprovethattheentireoracleconstruction stayswithinthestatedrunningtimeandtotalspacebounds,fromtheauthors.The eciencyofthealgorithmiscomparedagainstthatofthebrute-forcemethodstotal runningtimeandtotalspaceneeded.Usingmultipletestcaseswithanincreasing numberofverticesandedges,wehaveexperimentallyvalidatedthattheiralgorithm holdstruetotheirstatementsofspace,runningtime,andquerytime. vii

PAGE 11

CHAPTER1 INTRODUCTION 1.1BackgroundandProblemDescription The distancesensitivity problemrequirestheconstructionofadatastructurecalled distancesensitivityoracle or,inshort,oracleforanyedge-weightedgraph G that supportsqueriesonshortestdistanceand/orpathfromanyvertex x toanyvertex y avoidinganyvertex v oranyedge u;v in G .Theoraclehasbeencreatedmany timesbefore,eachrevisionimprovinguponthepreviousoracle.In1959,Dijkstragave thefamousDijkstra'salgorithm"[Dij59]thatcanndall-pairsofshortestpathsin totalrunningtimeof O mn + n 2 log n andtotalspaceof O n 2 1 AlthoughDijkstra's algorithmcannothandleanyvertexoredgefailurewithoutrstreconstructingthe oracleforthefailedvertexoredge,itisstillthestartingpointforallknownoracles. In2008,Demetrescuetal.[DTCR08]createdanoraclewithatotalrunningtimeof O mn 2 + n 3 log n ,totalspaceof O n 2 log n ,andquerytimeof O .Followingintheir footsteps,BernsteinandKarger[BK08]createdtheirrstoraclewithatotalrunning timeof e O n 2 p m ,totalspaceof e O n 2 ,andquerytimeof O 2 Improvingupontheir earlierresult,BernsteinandKarger[BK09]createdanearlyoptimaloraclethattakes atotalrunningtimeof e O mn ,totalspaceof e O n 2 ,andquerytimeof O Inthisthesis,wehaveimplementedthenearlyoptimaloraclebyBernsteinand Karger[BK09]andpresentedanexperimentalevaluationofourimplementation.The oraclein[BK09]wasconstructedthroughaseriesofstepsthatbuiltupfromoneanother. Astypicalforproblemsdealingwithshortestdistancesandpathsinedge-weighted 1 Values n and m standforthetotalnumberofverticesandthetotalnumberofedges,respectively, inthegraph G .RefertoTable1.1forallnotationsusedthroughoutthisthesis. 2 f n = ~ O g n i f n = O g n polylog n 1

PAGE 12

graphs,Dijkstra'salgorithmmustberunrstonthegraphtoobtainall-pairsofshortest distancesandpaths.Fromthere,thealgorithmdealswithassigningverticeswithan integerpriorityintherange[1 ; log n ]thatdeterminesthenumberofverticesthata singlevertexcancover.Avertex c issaidtocoveranothervertex v iftheshortestpath from c toeveryothervertex y thatavoids v isknownandstored.Thecoververtices c areclassiedintodierentprioritygroups.Higherpriorityverticesarerareandcover moreverticesthanthemorecommonlowerpriorityvertices.Acoververtex c ofpriority k ,where1 k log n ,cancoverallverticeswithprioritylessthanorequaltoitsown, betweenalllevels1and O k initsownshortestpathtree. Everyvertexinthegraphisacoververtexand,onashortestpathbetweenanytwo vertices,intervalsofverticesaredenedusingincrementalpriorities.Letussaythata vertex x haspriority k .Thenonashortestpath x;y from x to y ,therstinterval[ x;u ] containsallverticesfrom x totherstvertex u ofprioritygreaterthan k .Thisprocess ofintervalcreationisrepeateduntilvertex y isreached.Foreachinterval,thenext stepistodeterminewhichvertexontheintervalcausesthehighestdistanceifremoved fromthegraph.Ontheshortestpath x;y ,avertex w inanyinterval[ s;t ]issaidtobe the bottleneckvertex withrespectto x y ,and[ s;t ]if,amongtheverticesin[ s;t ],the removalof w fromthegraphresultsinthemaximumincreaseintheshortestdistance. Withthebottleneckverticesofalltheintervalsknown,thealgorithmthenndsthe shortestdistanceavoidingthebottleneckverticesandstoresallthesedistances.With theoraclenowconstructed,queriesforcomputingshortestdistancesinthepresenceof asinglefailedvertexoredgecanbeansweredin O time.Theoraclecanalsoanswer queriesaskingforshortestpathsavoidingasinglefailedvertexoredgein O L time, where L isthenumberofedgesontheshortestpath.Thefollowinglemmaiscrucial forcomputingtheanswersofthesequeries: Lemma1.1BottleneckLemma[BK09]:Foranyvertices x y ,and v ,let d x;y denote theshortestdistancefrom x to y andlet d x;y;v denotetheshortestdistancefrom x to y avoiding v .Let x s v t ,and y beverticesinthatorderontheshortestpath x;y from 2

PAGE 13

x to y ,where v isthefailedvertexand s 6 = v 6 = t .Let w bethebottleneckvertexofthe interval [ s;t ] .Then, d x;y;v = min f d x;s + d s;y;v ;d x;t;v + d t;y ;d x;y;w g : Inotherwords, d x;y;v istheminimumofthefollowingthreevalues:theshortest distancefromvertex x to s plustheshortestdistancefromvertex s tovertex y avoiding vertex v ,theshortestdistancefromvertex x tovertex t avoidingvertex v plusthe shortestdistancefromvertex t tovertex y ,andtheshortestdistancefromvertex x tovertex y avoidingthebottleneckvertex w WhileBernsteinandKarger[BK09]gavetheoreticalguaranteesfortheiroracleconstruction,theydidnotevaluatetheiroracleforreal-worldapplications.Wehavetaken ituponourselvestoexperimentallyvalidatethattheiralgorithmperformstosupport theirstatementsinimplementationwithdatabothrandomlygeneratedandreal-world comparedwiththeworst-casealgorithm.Usingtheirguidelinesandalgorithm,wehave implementedaworkingprogramthatshowsthattheiroraclecanbeecientlyimplementedandevaluatedontypicalcomputingplatforms.Ourprogrammakesitpossible todecreasenetworkdowntimewhenafailureoccurs,wherethenetworkcanbeanything fromacomputertoroadnetwork.Iftheproblemcanberelatedtoagraphandthe desiredoutcomeistheshortestpathand/ordistance,thenthisalgorithmcanbeused asamoreecientmethodtoproducelessdowntime. 1.2Motivation Themotivationbehindtheimplementationofthisalgorithmisjustiedbythenumber ofapplicationsthatcanbenetfromadecreaseinrunningtimeandspace.Onesuch applicationisthatofvehiculartracmodelingonroadsandhighways.Whenthereis anobstructionofsomekindonaroadwayoratanintersection,ourcodecanbeused tondanalternateshortestpathinconstanttime.Thiswouldbeextremelyhelpful 3

PAGE 14

topoliceandcitizensastheycanbereroutedbyapolicedetourorachangeontheir GPSunitsintheircars.Anotherrealworldapplicationwouldbethatofcomputer networks.Nocomputerisfoolproofagainstdowntimeandifthatoccurstheenduser isstillexpectingtheirdatatobemanagedinatimelymanner.Withourcode,anew networkpathbetweencomputerscanbequicklyreroutedwhilethebrokencomputeris xed. 1.3Notations Allthenotationsusedinthisthesisaretakenfrom[DTCR08].Wearegivenanonnegativeedge-weighted,directedgraph G = V;E;W .Weuse m todenotethenumber ofedgesand n todenotethenumberofverticesin G .W.l.o.g.,weassumethatall shortestpathsin G areuniqueandthat m n )]TJ/F15 10.9091 Tf 9.244 0 Td [(1.Forgeneralgraphs,therequirement thatallshortestpathsin G areunique,canbeenforcedbyhavingsomemechanismfor breakinganyties,e.g.,byaddingperturbationsorbyusinglexicographicselection. Foranysetofvertices S j S j denotesthenumberofverticesin S .Foranyvertex v ,let IN v = f u 2 V j u;v 2 E g Let b G denotethedirectedgraphthatisthesameas G exceptthatthedirections ofedgesin b G arethereverseofthosein G .Theuniqueshortestpathfromanyvertex x toanyvertex y in G isdenotedby x;y andin b G isdenotedby b x;y .Thenumber ofedgesonanypath isdenotedby j j .Thelengthofapath isdenotedby W wherethelength W isthesummationofalltheedgeweightsonthepath .For allvertices x and y of G ,let d x;y denote W x;y ,thelengthoftheshortestpathor shortestdistancebetween x and y in G .Forallvertices x and y andsubset S of verticesof G ,let x;y;S denotetheshortestpathfrom x to y thatavoids S andlet d x;y;S denote W x;y;S ,thelengthoftheshortestpathfrom x to y thatavoids S .For brevity,wewrite x;y; f v g ,where v isavertexinthesubset S ,as x;y;v andwrite d x;y; f v g as d x;y;v .Analogousterms b d x;y b x;y;S b d x;y;S ,and b d x;y;v aredenedforthegraph b G Theshortestpathtreerootedatavertex x in G isdenotedby T x andin b G isdenoted 4

PAGE 15

by b T x .Forallvertices x and v of G ,let T x v bethesubtreeof T x thatisrootedat v .Thesubtree b T x v of b T x isdenedanalogously.Thenotationsusedthroughoutthis thesisaresummarizedinTable1.1. Table1.1:NotationsusedinthisThesis Notation Meaning G Non-negativeedge-weighted,directedgraph G = V;E;W V Setofverticesin G E Setofedgesin G n Totalnumberofverticesin G m Totalnumberofedgesin G W [ u;v ] Weightofthedirectededge u;v in G IN v thesetofvertices u forwhich u;v isanedgein G j j Thenumberofedgesonapath in G x;y Theuniqueshortestpathfromavertex x toavertex y in G x;y;S Theuniqueshortestpathfromavertex x toavertex y avoidingasetofvertices S in G x;y;v Theuniqueshortestpathfromavertex x toavertex y avoidingavertex v in G d x;y Thelengthofashortestpathfromavertex x toavertex y in G d x;y;S Thelengthofashortestpathfromavertex x toavertex y avoidingasetofvertices S in G d x;y;v Thelengthofashortestpathfromavertex x toavertex y avoidingavertex v in G T x Theshortestpathtreerootedatavertex x in G T x v Thesubtreeof T x rootedatavertex v in G 5

PAGE 16

CHAPTER2 COMPUTINGALL-PAIRSOFSHORTESTPATHS 2.1Denitionsofthe D H P ,and ST Tables WerunDijkstra'salgorithmfromallsourceverticesofthegivendirectedgraph G Thisallowsustocomputeall-pairsofshortestpathsintime O mn + n 2 log n or e O mn [Dij59].Ineachshortestpathcomputation,wellintablesasdescribed in[BK09].Thesetablesare D H P and ST ,asdenedbelow. Denition2.1:Forallvertices x and y of G ,thefollowingtablesaredened: D [ x;y ] storestheshortestdistancefrom x to y in G ifitexistsandstores )]TJ/F15 10.9091 Tf 8.484 0 Td [(1 otherwise. H [ x;y ] storesthenumberofedgesontheuniqueshortestpath x;y ititexists andstores )]TJ/F15 10.9091 Tf 8.485 0 Td [(1 otherwise. P [ x;y ] storestheparentof y ontheuniqueshortestpath x;y ifitexistsand stores )]TJ/F15 10.9091 Tf 8.485 0 Td [(1 otherwise. ST [ x ] stores T x ,theshortestpathtreerootedat x Itisclearfromtheabovedenitionthateachofthetables D H P ,and ST takes n 2 space. 2.2Creationofthe D H P ,and ST Tables Algorithm1Initialize-Single-Sourcetakesasinputagraph G andasourcevertex s anditrunsin O n time.Thealgorithminitializesthevaluesinthetables D H ,and P ,foraxedsourcevertex s andallvertices u of G .InAlgorithm2Relax,the 6

PAGE 17

inputconsistsofvertices s u ,and v ,alongwithanarrayofedgeweights W ,anda min-priorityqueue Q .Thealgorithmcomparesthedistance D [ s;v ]againstthevalue of D [ s;u ]plus W [ u;v ].If D [ s;v ]isgreaterthan D [ s;u ]+ W [ u;v ],thenthefollowing updatesareperformed:If D [ s;v ]isinnity,then v isplacedinto Q andthe shortestdistance D [ s;v ],thenumberofedges H [ s;v ],andtheparent P [ s;v ]of v on s;v aresetto D [ s;u ]+ W [ u;v ], H [ s;u ]+1,and u ,respectively.InAlgorithm3ConstructShortest-Paths-Tree,theinputconsistsofagraph G andasourcevertex s ,andthe outputis ST [ s ].Thealgorithmiteratesovereachvertex u 6 = s of G andaddstheedge P [ s;u ] ;u into ST [ s ].InAlgorithm4All-Pairs-Shortest-Paths,theinputconsistsofa graph G ,anarrayofedgeweights W ,andamin-priorityqueue Q .Thealgorithmloops throughallvertices s in G todeterminetheshortestdistancesfrom s toallvertices y in G .ItthenmakesacalltoAlgorithm3toconstructthetable ST Input :Graph G ,sourcevertex s Output :Void begin 1 foreach vertex u in G do 2 D [ s;u ] 1 ; 3 H [ s;u ] 1 ; 4 P [ s;u ] NULL ; 5 end 6 D [ s;s ] 0; 7 H [ s;s ] 0; 8 end 9 Algorithm1:Initialize-Single-Source 7

PAGE 18

Input :Vertices s u ,and v ,arrayofedge-weights W ,min-priorityqueue Q Output :Void begin 1 if D [ s;v ] >D [ s;u ]+ W [ u;v ] then 2 if D [ s;v ]== 1 then 3 Q:Insert v ; 4 D [ s;v ] D [ s;u ]+ W [ u;v ]; 5 H [ s;v ] H [ s;u ]+1; 6 P [ s;v ] u ; 7 8 end 9 Algorithm2:Relax Input :Graph G ,sourcevertex s Output : ST [ s ] begin 1 ST [ s ] NULL ; 2 foreach vertex u in G do 3 if u 6 = s then 4 Addedge P [ s;u ] ;u in ST [ s ]; 5 6 end 7 return ST [ s ]; 8 end 9 Algorithm3:Construct-Shortest-Paths-Tree 8

PAGE 19

Input :Graph G ,arrayofedgeweights W ,min-priorityqueue Q Output :Tables D H P ST begin 1 foreach vertex s in G do 2 Initialize-Single-Source G;s ; 3 Q:Insert s ; 4 while Q:empty do 5 u Q:ExtractMin ; 6 foreach neighbor v of u do 7 Relax s u v W Q ; 8 end 9 end 10 ST [ s ] Construct-Shortest-Path-Tree G;s ; 11 end 12 return D;H;Pred;ST ; 13 end 14 Algorithm4:All-Pairs-Shortest-Paths AnalysisofAlgorithm1: EveryiterationoftheForloopinStep2runsintime O andthereare n iterations.Hence,therunningtimeofthealgorithmis O n AnalysisofAlgorithm2: Itisclearthatthisalgorithmrunsinconstanttime. AnalysisofAlgorithm3: EveryiterationoftheForloopinStep3runsintime O andthereare n iterations.Thus,therunningtimeofthealgorithmis O n AnalysisofAlgorithm4: EveryiterationoftheForloopinStep2callsrstAlgorithm1 thattakes O n runtime,followedbyaWhileloop.Overalltheiterationsofthe Whileloop, Q:ExtractMin iscalled n timesonceforeachvertex,whereeachsuch calltakes O log n worst-casetime.Also,overalltheiterationsoftheWhileloop, Q:DecrementKey iscalled O m times,whereeachsuchcalltakes O amortized timeassuming Q isimplementedasaFibonaccimin-heap.Itfollowsthateachiteration 9

PAGE 20

oftheForloopinStep2takesworst-casetime O m + n log n ,assumingtheFibonacci min-heapimplementationof Q .Thus,thetotalrunningtimeofthealgorithm,usinga Fibonaccimin-heapimplementationof Q ,is O n m + n log n = e O mn ThespaceusedbyeachoftheAlgorithms1,2,3,and4is O n 2 10

PAGE 21

CHAPTER3 ASSIGNINGPRIORITIES 3.1DenitionofCenters Thenextstepinvolvesassigningaprioritytoeachvertexbasedonarandomsampling approach[BK09].Allverticesstartowithapriorityof1.Then,forallintegervalues of k intherange[1 ; log n ],thepriorityofeachvertex x issetto k withprobability = 2 k 1 Iftheprobabilistictrialofassigningpriority k fails,thenthevertex x retains itscurrentpriority. Denition3.1[BK08,BK09]:Let 1 k log n beaninteger.Avertex x issaidto bea k -centerifitspriorityis k .Thesetofall k -centersisdenotedby R k .Avertex x issaidtobea k + -centerifitspriorityisatleast k Thefollowingrequirementsareimportantfortheconstructionofaspace-ecientdistanceoracle:Foreveryinteger1 k log n j R k j = e O n= 2 k Anyshortestpathwith e O k verticescontainsa k -center. 3.2Assign-PriorityAlgorithm InAlgorithm5Assign-Priority,theinputisagraph G andtheoutputisPass"or Fail."Thisalgorithmvisitseachvertexin G andassignsapriorityof k withprobability 1 = 2 k )]TJ/F21 7.9701 Tf 6.587 0 Td [(1 ,where1 k log n .Ifavertexisassignedmultiplepriorities,thevertexkeeps thehighestassignedpriority.Onceeachvertex x hasbeengivenapriority,testthatall 1 f n 2 g n ithereexistspositiveconstants c 1 and c 2 andinteger n 0 suchthat,forallintegers n n 0 ,itholdsthat c 1 g n f n c 2 g n 11

PAGE 22

pathsfrom x of2 k +1edgeshasavertexofprioritymorethan x:priority .Ifthistest fails,thenthealgorithmwillcleartheverticesoftheirpriorityandtryonceagainfor 10ln n times. 12

PAGE 23

Input :Graph G Output :PASS"orFAIL" begin 1 for loop 1 to 10ln n do 2 foreach vertex x in G do 3 for k 1 to log n do 4 x:priority 8 > > < > > : k withprobability2 1 )]TJ/F24 7.9701 Tf 6.587 0 Td [(k x:priority otherwise; 5 end 6 end 7 test 1 test 2 True ; 8 foreach vertex x in G do R [ x:priority ] R [ x:priority ]+1; 9 for k 1 to log n doif R [ k ] > 4 n 2 k then test1 False ; 10 if test 1== True then 11 foreach vertex x in G do 12 k x:priority ; 13 PerformaBFSintree T x startingfrom x ; 14 if thereisapath inthis BFS suchthat j j > 5 2 k andno 15 vertexin haspriority >k then test 2 False ; end 16 end 17 if test 1== TrueANDtest 2== True thenreturn PASS"; 18 end 19 return FAIL"; 20 end 21 Algorithm5:Assign-Priority 13

PAGE 24

Lemma3.2[BK09]:Algorithm5runsintime O n 2 log n = e O n 2 andreturns PASS "withprobability 1 )]TJ/F23 10.9091 Tf 11.628 0 Td [(O =n .Ifthealgorithmreturns PASS "thenthefollowingholds:Foreveryinteger 1 k log n j R k j 4 n 2 k Forevery k -center x andvertex y suchthat j x;y j > 5 2 k ,thereexistsa k +1 + center z on xy AnalysisofAlgorithm5: TheForloopinStep2runsover O log n iterations.Ineach iterationoftheForloop,Steps3{10take O n log n timeandSteps11{18take O n 2 time.Therefore,thetotalrunningtimeofthealgorithmis O log n O n log n + n 2 = O n 2 log 2 n = e O n 2 .Itisclearthatthespaceboundofthealgorithmis O n 14

PAGE 25

CHAPTER4 COVERINGCHAINS 4.1Denitionsofthe Cr Cl ,and BCP Tables Oncetheprioritiesareassignedtoalltheverticesofthegraph,acoveringchainis createdforeachshortestpath x;y byselectingverticesbyincreasingorderofpriority on x;y .Foreveryshortestpath x;y ,therstcoververtexis x ,thesecondcoververtex istherstvertexsucceeding x onthepath x;y thathasahigherprioritythan x ,andso on.Thisprocessofdesignatingcoververticesisrepeateduntilvertex y isreached.After thecoveringverticesforeachshortestpathin G arefound,thesameprocessisrepeated oneachshortestpath b x;y inthegraph b G .Thesetofverticesinbetweentwoadjacent coververtices,say s and t ,onanyshortestpathin G b G isdenotedbytheinterval[ s;t ]. Thesequenceofcoververtices c 1 c 2 ::: c j onanyshortestpath x;y in G b x;y in b G iscalleda coveringchain of x;y respectively, b x;y .Theintervals[ c 1 ;c 2 ],[ c 2 ;c 3 ], ::: [ c j )]TJ/F21 7.9701 Tf 6.587 0 Td [(1 ;c j ]partitiontheshortestpath x;y suchthateach c i coversallverticesin[ c i ;c i +1 ], andsotheintervalsarereferredtoas coveringintervals .Thehighestpriorityofthe coveringchainof x;y isstoredinto BCP [ x;y ]andusedforndingcoveringvertices. Denition4.1[BK08,BK09]:Forallvertices x and y of G andinteger i ,where 1 i log n ,thefollowingtablesaredened: Cr [ x;y;i ] storestherst i + -center v 2 V G on x;y ifitexistsandstores )]TJ/F15 10.9091 Tf 8.485 0 Td [(1 otherwise. Cr standsfor centerright Cl [ x;y;i ] storestherst i + -center v 2 V G on b y;x ifitexistsandstores )]TJ/F15 10.9091 Tf 8.485 0 Td [(1 otherwise. Cl standsfor centerleft 15

PAGE 26

BCP [ x;y ] storesthehighestcenterpriorityon x;y .ThenotationBCPstandsfor biggestcenterpriority Itisclearfromtheabovedenitionthatthetables Cr and Cl take n 2 log n space andthetable BCP takes n 2 space. 4.2Creationofthe Cr Cl ,and BCP Tables InAlgorithm6Create-Cr-and-BCP-Tables,theinputisagraph G andtheoutput consistsoftables Cr and BCP .Thealgorithmiteratesovereachshortestpath x;y in thegraph G andsetsthecoveringverticesforeachpathstartingwithvertex x .While traversingthrougheachshortestpath,thepriorityofeachvertexistestedandthe highestpriorityisstoredforthegivenshortestpath.InAlgorithm7Create-Cl-Table, theinputisagraph G andtheoutputisthetable Cl .Thealgorithmwalksthrough eachshortestpath b x;y inthegraph b G andsetsthecoveringverticesstartingwithvertex y 16

PAGE 27

Input :Graph G Output : Cr and BCP begin 1 foreach vertex x of G do 2 foreach vertex y of G do 3 for i 1 to log n do 4 Cr [ x;y;i ] )]TJ/F15 10.9091 Tf 22.424 0 Td [(1; 5 end 6 end 7 for i 1 to x:priority do 8 Cr [ x;x;i ] x ; 9 end 10 BCP [ x;x ] x:priority ; 11 foreach vertex y inthepre-ordertraversaloftree T x do 12 z P [ x;y ]; 13 BCP [ x;y ] max f BCP [ x;z ] ;y:priority g ; 14 for i 1 to BCP [ x;z ] do 15 Cr [ x;y;i ] Cr [ x;z;i ]; 16 end 17 for i BCP [ x;z ]+1 to y:priority do 18 Cr [ x;y;i ] y ; 19 end 20 end 21 end 22 end 23 Algorithm6:Create-Cr-and-BCP-Tables 17

PAGE 28

Input :Graph G Output : Cl begin 1 foreach vertex y of G do 2 foreach vertex x of G do 3 for i 1 to log n do 4 Cl [ x;y;i ] )]TJ/F15 10.9091 Tf 22.424 0 Td [(1; 5 end 6 end 7 for i 1 to y:priority do 8 Cl [ y;y;i ] y ; 9 end 10 BCP [ y;y ] y:priority ; 11 foreach vertex x inthepre-ordertraversaloftree b T y do 12 z b P [ y;x ]; 13 BCP [ x;y ] max f BCP [ z;y ] ;x:priority g ; 14 for i 1 to BCP [ z;y ] do 15 Cl [ x;y;i ] Cl [ z;y;i ]; 16 end 17 for i BCP [ z;y ]+1 to x:priority do 18 Cl [ x;y;i ] x ; 19 end 20 end 21 end 22 end 23 Algorithm7:Create-Cl-Table 18

PAGE 29

4.3FindingCentersonBothSidesofanAvoidingVertex Algorithm8Find-Centerstakesinputagraph G ,vertices x and y ,andavertex v to avoidonthepath x;y .Itoutputsthepair c x ;c y ofcentersthatcover v andareon eithersidesofvertex v onthepath x;y Input :Graph G ,vertices x and y ,andvertex v toavoidonthepath x;y Output :Centerpairs c x ;c y suchthat v isavertexinthecoveringinterval [ c x ;c y ]onthecoveringchainfor x;y i BCP [ x;v ]; 1 j BCP [ v;y ]; 2 c x Cr [ x;y;i ]; 3 if i>j or i == j then c y Cl [ x;y;j ]; 4 else c y Cr [ v;y;i +1]; 5 return c x ;c y ; 6 Algorithm8:Find-Centers AnalysisofAlgorithm6: TheForloopinStep2runsover O n iterations.Ineach iterationoftheForloop,Steps3{7take O n log n time,Steps8{11take O log n time, andSteps12{21take O n log n time.Hence,thetotalrunningtimeofthealgorithm is O n 2 log n = e O n 2 .Thespaceboundofthealgorithmis O n 2 log n = e O n 2 AnalysisofAlgorithm7: TheanalysisofthisalgorithmisthesameasthatofAlgorithm6.Therefore,thealgorithmrunsintime e O n 2 andusesspace e O n 2 AnalysisofAlgorithm8: Itisclearthatthisalgorithmrunsintime O ,asalldatais pulledfromtablesalreadycomputed.Thespaceboundofthealgorithmis O 19

PAGE 30

CHAPTER5 SHORTESTDISTANCESFROMALLCENTERSAVOIDINGTHEIR COVEREDVERTICES 5.1Denitionsofthe D k D k E c D k and d D k E Tables Withthecoveringchaincreatedforeveryshortestpath x;y ,thenextstepistostore theshortestdistance d c;y;v andtherstedgeofthepath c;y;v intotables.Here, c isa chosencenter, y isanyvertexintheshortestpathtree T c v ,and v isanyvertexthat c covers,whichmustliewithintherst5 2 k levelsof T c Denition5.1[BK08,BK09]:Avertex c issaidto cover avertex v in G ifwestore d c;y;v forevery y 2 T c v .Similarly,avertex c issaidto cover avertex v in b G ifwe store b d c;y;v forevery y 2 b T c v Inotherwords, c covers v in G ifwestorethelengthsoftheshortestpathsfrom c to allvertices y 2 T c v avoiding v in G .Likewise, c covers v in b G ifwestorethelengths oftheshortestpathsfrom c toallvertices y 2 b T c v avoiding v in b G Denition5.2[BK08,BK09]:Foreveryintegerpriority 1 k log n k -center c andforallvertices v and y of G suchthat y 2 T c v )-222(f v g ,wehave If c covers v in G ,then D k [ c;y;v ] stores d c;y;v If c covers v in G ,then D k E [ c;y;v ] storestherstedge c;u 2 c;y;v If c covers v in b G ,then b D k [ c;y;v ] stores b d c;y;v = d y;c;v If c covers v in b G ,then [ D k E [ c;y;v ] storestherstedge c;u 2 b c;y;v Thetotalspaceneededforeachofthetables D k D k E b D k and [ D k E is P log n k =1 n= 2 k n 2 k =20 n 2 log n = O n 2 log n = e O n 2 20

PAGE 31

5.2Creationofthe D k D k E c D k and d D k E Tables Algorithm9CreateD k -andD k E -Tablestakesasinputagraph G andreturnsas outputtheTables D k and D k E .Thealgorithmiteratesovereachcenter c andeach vertex v in T c ,andcreatesanewedge-weightedgraph G v = V v ;E v ;W v whosevertex set V v andedgeset E v aredenedasfollows: V v contains c andtheset U v ofverticesin T c v )-226(f v g and E v containsanedgefrom c toeachvertexin U v andalsotheedgesin G inducedby U v .Oncethegraph G v isconstructed,Dijkstra'salgorithmisrunwith center c asthesourcevertex;allshortestdistancesarestoredinthetable D k andthe rstedgesofthenewshortestpathsarestoredinthetable D k E .Thetables b D k and [ D k E arecreatedbyrunningthesamealgorithmonthegraph b G 21

PAGE 32

Input :Graph G Output : D k and D k E begin 1 foreach vertex c of G do 2 k c:priority 3 for L 1 to 5 2 k do 4 foreach vertex v of T c atlevel L do 5 if v:priority k then 6 U v setofallverticesof T c v exceptthevertex v ; 7 Constructadirectedweightedgraph G v = V v ;E v ;W v : 8 V v = U v [f c g E v containsanedgefrom c toeachvertexin U v andalso containstheedgesin G inducedby U v W v [ a;b ]istheweightoftheedge a;b in G v denedas W v [ a;b ]= 8 > > < > > : min x 62 T c v f d c;x + W [ x;b ] g if a = c; W [ a;b ]otherwise, whereweassumethat d c;x =+ 1 if x isnotreachablefrom c in G and W [ x;b ]=+ 1 if x;b isnotanedgeof G ; foreach vertex y 2 U v do D k [ c;y;v ] theshortestdistancefrom c to y in G v ; D k E [ c;y;v ] therstedgeintheshortestpathfrom c to y in G v ; end end 9 end 10 end 11 end 12 end 13 Algorithm9:CreateD k -andD k E -Tables 22

PAGE 33

AnalysisofAlgorithm9: IneveryiterationoftheForloopinStep2andeveryiteration oftheForloopinStep4,thetotalcomputationtimeoftheForloopinStep5is O m + n log n .Sincethereareatmost4 n= 2 k centersofpriority k ,thetotalcomputation timeofthealgorithmisatmost P log n k =1 n= 2 k 2 k O m + n log n = O nm log n + n 2 log 2 n ,whichis e O mn as m n )]TJ/F15 10.9091 Tf 11.077 0 Td [(1bytheassumptionmadeinSection1.3.The spaceusedbythealgorithmismainlyinmaintainingthetables.Therefore,thetotal spacerequirementofthealgorithmis e O n 2 23

PAGE 34

CHAPTER6 SHORTESTDISTANCESFROMALLVERTICESAVOIDINGTHE FIRSTEDGESOFTHEIRSHORTESTPATHS 6.1Denitionsofthe De DeE c De ,and d DeE Tables Thepreviouschaptershowshowshortestdistancesfromallcentersavoidingtheircoveredverticesarecomputedandstoredinthetables.Here,wecomputetheshortest distancesfromallverticesavoidingtherstedgesontheirshortestpathsusingAlgorithm10CreateDe -andDeE -Tables.Thisalgorithmfollowsthesameprinciplesas Algorithm9andtheycanbecombined.However,wepresentthetwoalgorithmsseparatelytokeeptheprocessclearandunderstandable.Algorithm10storestheinformation inthetablesdenedbelow. Denition6.1[DTCR08,BK08]:Forallvertices x and y of G ,let e x;y b e x;y denote therstedgeof x;y respectively, b x;y .Thefollowingtablesaredened:Forallvertices x and y of G De [ x;y ] storestheshortestdistancefrom x to y in G )-222(f e x;y g DeE [ x;y ] storestherstedgeontheshortestpathfrom x to y in G )-222(f e x;y g c De storestheshortestdistancefrom x to y in b G )-222(f b e x;y g [ DeE [ x;y ] storestherstedgeontheshortestpathfrom x to y in b G )-222(f b e x;y g Itisclearfromtheabovedenitionthateachofthesetablestakes n 2 space. 24

PAGE 35

6.2Creationofthe De DeE c De ,and d DeE Tables Algorithm10CreateDe -andDeE -Tablestakesasinputagraph G andreturnsas outputthetables De and DeE .Thealgorithmiteratesovereachvertex x andevery vertex v suchthattheedge x;v isin T x ,andcreatesanewedge-weightedgraph G v = V v ;E v ;W v whosevertexset V v andedgeset E v aredenedasfollows: V v contains x andtheset U v ofallverticesin T x v and E v containsanedgefrom x toeach vertexin U v exceptfortheorignaledge x;v anewedgeweightisassignedandalso containstheedgesin G inducedby U v .Oncethegraph G v isconstructed,Dijkstra's algorithmisrunwith x asthesourcevertex;allshortestdistancesarestoredinthe table De andtherstedgesofthenewshortestpathsarestoredinthetable DeE .The tables c De and [ DeE arecreatedbyrunningthesamealgorithmonthegraph b G 25

PAGE 36

Input :Graph G Output : De and DeE begin 1 foreach vertex x of G do 2 foreach vertex v suchthattheedge x;v isin T x do 3 U v setofallverticesof T x v ; 4 Constructadirectedweightedgraph G v = V v ;E v ;W v : 5 V v = U v [f x g E v containsanedgefrom x toeachvertexin U v exceptfortheoriginaledgeweight x;v andalso containstheedgesin G inducedby U v W v [ a;b ]istheweightoftheedge a;b in G v denedas W v [ a;b ]= 8 > > < > > : min z 62 T x v f d x;z + W [ z;b ] g if a = x; W [ a;b ]otherwise, whereweassumethat d x;z =+ 1 if z isnotreachablefrom x in G and W [ z;b ]=+ 1 if z;b isnotanedgeof G ; foreach vertex y 2 U v do De [ x;y ] theshortestdistancefrom x to y in G v ; DeE [ x;y ] therstedgeintheshortestpathfrom x to y in G v ; end end 6 end 7 end 8 Algorithm10:CreateDe -andDeE -Tables AnalysisofAlgorithm10: IneveryiterationoftheForloopinStep2,thetotalcomputationtimeoftheForloopinStep3is O m + n log n .Sincethereare n possiblesourcevertices,thetotalrunningtimeofthealgorithmis O n O m + n log n = O mn + n 2 log n whichis e O mn as m n )]TJ/F15 10.9091 Tf 10.978 0 Td [(1bytheassumptionmadeinSection1.3.Thespaceused 26

PAGE 37

bythealgorithmismainlyinmaintainingthetables.Therefore,thetotalspacebound ofthealgorithmis O n 2 27

PAGE 38

CHAPTER7 BOTTLENECKVERTICES 7.1Denitionofthe BV Table Withthe Cr and Cl tablescontainingthecoveringintervalsforeachshortestpath x;y thealgorithmthendeclaresonevertexofeachcoveringinterval I tobethe bottleneck vertex of I withrespecttoitsendpoints.Thebottleneckvertex w ofanyinterval I on anyshortestpath x;y issomevertexin I whoseremovalfromthegraphresultsinthe maximumshortestdistancebetween x and y Denition7.1BottleneckVertex[BK09]:Avertex w islabeledabottleneckvertexof agiveninterval I of x;y ifandonlyif w =argmax v 2 I f d x;y;v g Thefollowinglemmaexpresses d x;y;v intermsof d x;y;w ,where w isthebottleneckvertex oftheinterval I that v belongstoon x;y .Thislemmaisthecornerstoneofthenearly optimaloracle. BottleneckLemmaLemma1.1Restated:Let x s v t ,and y beverticesinthatorder ontheshortestpath x;y from x to y ,where v isthefailedvertexand s 6 = v 6 = t .Let w bethebottleneckvertexoftheinterval [ s;t ] .Then, d x;y;v = min f d x;s + d s;y;v ;d x;t;v + d t;y ;d x;y;w g Denition7.2[BK09]:Thetable BV isdenedasfollows:Forallvertices x and y of G andintegerpriority 1 i log n BV [ x;y;i ] storesthebottleneckvertexofthe i 'thcoveringintervalonthecovering chainfor x;y Ititclearfromtheabovedenitionthatthetable BV takes O n 2 log n = e O n 2 28

PAGE 39

7.2Creationofthe BV Table InAlgorithm11MTC,theinputconsistsofvertices x and y andavertex v toavoid. Thealgorithmreturnsthelengthoftheshortestpathfrom x to y avoiding v ,but passingthroughthetwocenters c x and c y covering v .ForAlgorithm12Find-Bot,the inputconsistsofvertices x and y ,andasubinterval I =[ s;t ]onthecoveringchainfor x;y toperformthesearchforthebottleneckvertex.Theoutputofthealgorithmisa vertex w thatisthebottleneckvertexof I withrespectto x and y .Thealgorithm isarecursivebinarysearchthatisperformedontheinterval[ s;t ]bybreakingthe intervalintotwosubintervals,thencomparingthedistancevaluesforthesubintervals, andnallychoosingonesubintervalbasedonthecomparison.Whentherecursivecall reachesanintervalwithatmosttwovertices,thenacandidateforthebottleneckvertex isreturnedusinganexhaustivesearchovertheinterval.InAlgorithm13Create-BVTable,theinputisagraph G andtheoutputisthebottleneckvertexofeveryinterval I ofeveryshortestpath x;y .Thealgorithmiteratesoverallvertices x and y ,andover allintervals I ontheshortestpath x;y Input :Vertices x and y ,vertex v toavoid Output :Lengthoftheshortestpathfrom x to y avoiding v ,butpassing throughthetwocenters c x and c y covering v c x ;c y Find-Centers x;y;v ; 1 return min f d x;c x + d c x ;y;v ;d x;c y ;v + d c y ;y g ; 2 Algorithm11:MTC 29

PAGE 40

Input :Vertices x and y ,centers c x and c y ofacoveringinterval I =[ c x ;c y ]on thecoveringchainfor x;y ,thecoveringinterval I ,andindiceslowand high,wherelow high,ofasubinterval I [low ::: high]of I Output :Avertex w =argmax v 2 I [low ::: high] MTC x;y;v if j I [low ::: high] j 2 thenreturn argmax w 2 I [low ::: high] MTC x;y;w ; 1 mid b low+high = 2 c ; 2 v argmax w 2 I [mid ::: high] d c x ;y;w ; 3 L x;y;v d x;c x + d c x ;y;v ; 4 R x;y;v d x;c y ;v + d c y ;y ; 5 if L x;y;v R x;y;v then 6 w Find-Bot x;y;c x ;c y ;I; low ; mid; 7 w 0 argmax v;w f MTC x;y;v ; MTC x;y;w g ; 8 end 9 if L x;y;v >R x;y;v then w 0 Find-Bot x;y;c x ;c y ;I; mid ; high; 10 return w 0 11 Algorithm12:Find-Bot 30

PAGE 41

Input :Graph G Output :Thebottleneckvertexofeverycoveringinterval I ofeveryshortest path x;y foreach vertex x of G do 1 foreach vertex y of G do 2 for i 1 to log n do 3 c x Cr [ x;y;i ]; 4 c y Cr [ x;y;i +1]; 5 BV [ x;y;i ] Find-Bot x;y;c x ;c y ; [ c x ;c y ] ; 0 ;H [ c x ;c y ]; 6 end 7 end 8 end 9 Algorithm13:Create-BV-Table AnalysisofAlgorithm11: Itisclearthatthisalgorithmrunsintime O ,asalldata ispulledfromtablesalreadycomputed.Thespaceboundofthealgorithmis O AnalysisofAlgorithm12: Thealgorithmismuchlikearecursivebinarysearchinthat itrecursesonhalf-intervals.Thisleadstoan O log n totalrunningtimetorecurse throughtheintervalandndthebottleneckvertex.Eachinvocationofthealgorithm takesonly O runningtime,asStep4usesRMQdatastructuretondthemaximum valueinasubarrayinconstanttime.Sincethereare O log n recursivecalls,thetotal runningtimeofthealgorithmis O log n .Thespaceboundofthealgorithmis O n AnalysisofAlgorithm13: SincethetotalnumberofcallstoAlgorithm12is O n 2 log n andeachcalltakes O log n time,thetotalrunningtimeofthealgorithmis O n 2 log 2 n = e O n 2 .Thespaceboundofthealgorithmis e O n 2 31

PAGE 42

CHAPTER8 SHORTESTDISTANCESBETWEENALLPAIRSOFVERTICES AVOIDINGTHEBOTTLENECKVERTICES 8.1Denitionofthe DBV and FEBV Tables Withthebottleneckverticesstoredinthetable BV ,theoraclethendetermines,for eachpairofvertices x and y andforeachcoveringinterval i ,theshortestdistance from x to y whileavoidingthebottleneckvertex BV [ x;y;i ]of i withrespectto x and y andstoresthisdistanceintoatable DBV .Togettheshortestdistancesbetween allpairsofverticeswhileavoidingthebottleneckverticeswithrespecttothepairs,a newnon-negativeedge-weighted,directedgraph G bv = V bv ;E bv ;W bv iscreated.The vertexset V bv consistsofasource s andthevertices v [ x;y;i ],forallvertices x and y andforeveryintegerpriority1 i log n intheoriginalgraph G .Thegoalbehind thecreationof G bv istoreducethecomputationof DBV [ x;y;i ]= d x;y;BV [ x;y;i ] tothe computationoftheshortestdistancefrom s to v [ x;y;i ]. Duringthecreationof DBV ,anadditionaltable FEBV willbecreated.Theentry FEBV [ x;y;i ]willstoretherstedgeontheshortestpathfrom x to y avoidingthe bottleneckvertexofthe i 'thcoveringintervalon x;y .Thistablewillbeusedfor answeringqueriesthatdealwithndingtheshortestpathbetweentwoverticesfora givenfailedvertexoredge. Denition8.1[BK09]:Forallvertices x and y of G andinteger 1 i log n ,the followingtablesaredened: DBV [ x;y;i ] storestheshortestdistancefrom x to y avoidingthebottleneckvertex BV [ x;y;i ] ofthe i 'thcoveringintervalonthecoveringchainfor x;y 32

PAGE 43

FEBV [ x;y;i ] storestherstedgeoftheshortestpathfrom x to y avoidingthe bottleneckvertex BV [ x;y;i ] ofthe i 'thcoveringintervalonthecoveringchainfor x;y Itisclearfromtheabovedenitionthateachofthetables DBV and FEBV takes O n 2 log n = e O n 2 space. Lemma8.2BottleneckValues[BK09]:Forallvertices x and y of G = V;E;W and integer 1 i log n ,thebottleneckvalue DBV [ x;y;i ]= d x;y;BV [ x;y;i ] isgivenby DBV [ x;y;i ]=min f min y 0 2 IN y MTC x;y 0 ;BV [ x;y;i ]+ W [ y 0 ;y ]term1 ; min y 0 2 IN y DBV [ x;y 0 ;j ]+ W [ y 0 ;y ]term2 g ; where j in DBV [ x;y 0 ;j ] isthecenterpriorityforwhich BV [ x;y;i ] isinthe j 'thcovering intervalonthecoveringchainfor x;y 0 in G 8.2Creationofthe DBV and FEBV Tables InAlgorithm14CreateDBV -andFEBV -Tables,theinputisagraph G = V;E;W andtheoutputconsistsoftables DBV and FEBV .Thealgorithmimplicitlymaintains anewnon-negativeedge-weighted,directedgraph G bv = V bv ;E bv ;W bv thatcontains asourcevertex s andvertices v [ x;y;i ]correspondingtobottleneckvertices BV [ x;y;i ] intheoriginalgraph G .Anedgefromthesourcevertex s toeachvertex v ] x;y;i ]is implicitlycreatedandtheweightofthisedgeissettotheminimumofMTC x;y 0 ;v + W [ y 0 ;y ]overall y 0 2 V suchthat y 0 ;y 2 E and v isthebottleneckvertex BV [ x;y;i ]of the i 'thcoveringintervalonthecoveringchainfor x;y in G .Anedgeisimplicitlyadded from v [ x;y 0 ;j ]to v [ x;y;i ]if y 0 2 IN y and j istheindexofthecoveringintervalon thecoveringchainfor x;y 0 in G thatcontains BV [ x;y;i ].Withalltheedgesimplicitly createdinthegraph G bv ,Dijkstra'salgorithmisthenrunon G bv with s asthestart vertex.Theshortestdistancesfrom s toallverticesof G bv arestoredinthetable DBV andtherstedgeoftheshortestpathsarestoredinthetable FEBV 33

PAGE 44

Input :Graph G = V;E;W Output :Tables DBV and FEBV Deneadirectedweightedgraph G bv = V bv ;E bv ;W bv withadesignatedsource 1 vertex s asfollows: V bv = f s g[f v [ x;y;i ] j x;y 2 V and1 i log n isanintegerpriority g ; E bv containsanedgefrom s toeachvertex v [ x;y;i ]andanedgefrom each v [ x;y 0 ;j ]to v [ x;y;i ],where y 0 2 IN y and j istheintervalon x;y 0 in G thatcontains BV [ x;y;i ]. W bv isanon-negativeweightfunctiononedgesof G bv suchthat a W bv [ s;v [ x;y;i ]]=min y 0 2 IN y f MTC x;y 0 ;BV [ x;y;i ]+ W [ y 0 ;y ] g and b W bv [ v [ x;y 0 ;j ] ;v [ x;y;i ]]= W [ y 0 ;y ]if y 0 2 IN y and j isthecenter priorityforwhich BV [ x;y;i ]isinthe j 'thcoveringintervalonthe coveringchainfor x;y 0 in G Notethattheremaybesome y 0 2 IN y forwhich BV [ x;y;i ]isnoton x;y 0 in G ;so,forsuch y 0 ,MTC x;y 0 ;BV [ x;y;i ]and BV [ x;y 0 ;j ]arenotdened. Inthiscase,itiseasytoseethat d x;y 0 ;v equals d x;y 0 .Thus,thisspecialcase ishandledbydeningMTC x;y 0 ;BV [ x;y;i ]tobe d x;y 0 anddening DBV [ x;y 0 ;j ]tobeinnity. foreach vertices x;y 2 V andintegerpriority1 i log n do DBV [ x;y;i ] theshortestdistancefrom s to v [ x;y;i ]in G bv ; FEBV [ x;y;i ] therstedgeontheshortestpathfrom s to v [ x;y;i ]in G bv ; end Algorithm14:CreateDBV -andFEBV -Tables AnalysisofAlgorithm14: Sinceeachvertex y in G ispartof O n log n tripletsofthe form x;y;i ,thenumberofedgesin G bv is O n log n P y 2 V j IN y j = O mn log n or ~ O mn .Itisclearthatthenumberofverticesin G bv is O n 2 log n .Once G bv is constructed,Dijkstra'salgorithmisthenrunoninput G bv and s ,whichtakestime 34

PAGE 45

O mn log n + n 2 log 2 n ,whichis e O mn as m n )]TJ/F15 10.9091 Tf 11.764 0 Td [(1bytheassumptionmadein Section1.3.Thus,thetotalrunningtimeofthealgorithmis e O mn .Noticethatthe edgeinformationof G bv isnotexplicitlystored,ratheredgesleavinganyvertexin G bv arecomputedon-the-yusingthedenitionof G bv giveninAlgorithm14.Thus,the totalspaceboundofthealgorithmis O j V bv j = O n 2 log n = e O n 2 35

PAGE 46

CHAPTER9 ANSWERINGQUERIES 9.1TypesofQueries Thereareatotaloffourdierentqueriesthatcanbeaskedtotheoracle.Therst isaqueryaskingfortheshortestdistancefromanyvertex x toanyvertex y avoiding anyfailedvertex v .ThepseudocodeforansweringthisqueryistakenfromSection6 of[BK08],withoneexceptionthatthetable EP [ x;y;i ]isreplacedby[BK09]'stable DBV [ x;y;i ].Thesecondqueryasksfortheshortestdistancefromanyvertex x toany vertex y avoidinganyfailededge u;v .Thepseudocodeforansweringthisqueryis takenfromFigure6.1of[DTCR08],replacingthev-dist x;y;u "functioncallwith thequeryfortheshortestdistancefrom x to y avoidingthefailedvertex u .Thethird queryasksfortheshortestpath x;y;v fromanyvertex x toanyvertex y avoidingany failedvertex v .Thisqueryalsousestheshortestdistanceavoidingafailedvertex, butbasedonwhichtermischosenfromthemin"functionintheBottleneckLemma Lemma1.1,anedgeofthepath x;y;v isreturned[DTCR08].Sinceonlyasingle edgeisreturned,thisquerymustberan O L times,where L isthenumberofedges intheshortestpath x;y;v .Thelastqueryasksfortheshortestpathfromanyvertex x toanyvertex y avoidinganyfailededge u;v .Thepseudocodeforansweringthis queryfollowsthesamestepsasforthequeryfortheshortestdistanceavoidingafailed edge.Basedonwhichtermischosenfromthemin"functionintheBottleneckLemma Lemma1.1,asingleedgeisreturned[DTCR08].Thisquerymustalsoberan O L timestoreturneachedgeoftheshortestpathavoidingafailededge. 36

PAGE 47

9.2Query:ShortestDistanceAvoidingAFailedVertex Algorithm15Shortest-Distance-Avoiding-Vertexanswersqueriesthataskforthe shortestdistanceavoidingasinglefailedvertex.Theinputtothealgorithmconsists ofvertices x y ,and v ofagraph G andtheoutputistheshortestdistancefrom x to y avoiding v .Thealgorithmrstdetermineswhether v ,thevertextoavoid,isonthe path x;y .If v isnoton x;y ,thentheshortestdistance d x;y isreturned.Otherwise, thealgorithmndstheendpoints, c x and c y ,ofthecoveringintervalthat v belongsto on x;y .Thealgorithmthencomparesthreepossibledistancesfrom x to y thatavoid v ,asstatedintheBottleneckLemmaLemma1.1,andreturnstheminimumofthe threedistances. Input :Vertices x y ,and v ofagraph G ,where v isthevertextoavoid Output :Shortestdistancefrom x to y avoiding v ingraph G if d x;v + d v;y >d x;y then 1 return d x;y ; 2 end 3 i BCP [ x;v ]; 4 j BCP [ v;y ]; 5 if i>j then 6 breakandcompute ^ d y;x;v instead; 7 end 8 c x Cr [ x;y;i ]; 9 if i = j then c y Cl [ x;y;j ]; 10 else c y Cr [ v;y;i +1]; 11 return min f d x;c x + D i [ c x ;y;v ] ; d c y ;y + ^ D j [ c y ;x;v ] ;DBV [ x;y;i ] g ; 12 Algorithm15:Shortest-Distance-Avoiding-Vertex 37

PAGE 48

AnalysisofAlgorithm15: Eachstepcallsuponavariableinanalreadycreatedtable thattakes O timetopullthedatafromthetable.Therefore,thetotalruntimeis O 9.3Query:ShortestDistanceAvoidingAFailedEdge Algorithm16Shortest-Distance-Avoiding-Edgeanswersqueriesthataskfortheshortestdistanceavoidingasinglefailededge.Theinputconsistsofvertices x and y andan edge u;v ofagraph G ,andtheoutputistheshortestdistancefrom x to y avoiding theedge u;v .Thealgorithmrstdetermineswhether u;v ,theedgetoavoid,ison thepath x;y .If u;v isnoton x;y ,thenthedistance d x;y isreturned.Otherwise, thealgorithmcallsAlgorithm15bypassinginthevertices x and y alongwiththerst vertexofthefailededge u;v .Thedistancereturnedfromthiscallisthencompared againstthecombineddistanceof d x;u and d u;y;v ,andtheminimumofthetwodistances isreturned. Input :Vertices x and y andanedge u;v ofagraph G ,where u;v istheedge toavoid Output :Shortestdistancefrom x to y avoidingtheedge u;v ingraph G if d x;u + W [ u;v ]+ d v;y >d x;y then 1 return d x;y ; 2 end 3 d 1 Shortest-Distance-Avoiding-Vertex x;y;u ; 4 d 2 d x;u + De [ u;y ]; 5 return min f d 1 ;d 2 g ; 6 Algorithm16:Shortest-Distance-Avoiding-Edge AnalysisofAlgorithm16: Eachstepcallsuponavariableinanalreadycreatedtable thattakes O timetopullthedatafromthetable.Therefore,thetotalruntimeis O 38

PAGE 49

9.4Query:ShortestPathAvoidingAFailedVertex Algorithm18Create-Path-Avoiding-Vertexanswersqueriesthataskfortheshortest pathavoidingafailedvertex.Theinputtothealgorithmconsistsofvertices x y and v ofagraph G ,andtheoutputistheshortestpathfrom x to y avoiding v .Thealgorithm repeatedlycallsAlgorithm17Shortest-Path-Avoiding-Vertextoconstructthepath x;y;v .Algorithm17rstdetermineswhether v ,thevertextoavoid,isonthepath x;y .If v isnoton x;y ,thentherstedgeonthepath x;y isreturned.Otherwise,the algorithmndstheendpoints, c x and c y ,ofthecoveringintervalthat v belongstoon x;y .Thealgorithmthencomparesthreepossibledistancesfrom x to y thatavoid v ,as statedintheBottleneckLemmaLemma1.1,choosesoneoftheminimumdistances, andreturnsasingleedgebasedonthechoicemade. 39

PAGE 50

Input :Vertices x y ,and v ofagraph G ,where v isthevertextoavoid Output :Asingleedgeintheshortestpathfrom x to y avoiding v ingraph G andabooleanvalue1or0.Thevalue1denotesthatthereturnededge isfortheforwardpathandthevalue0denotesthatthereturnededge isforthebackwardpath. if d x;v + d v;y >d x;y then 1 return therstedgeof x;y andthevalue1; 2 end 3 i BCP [ x;v ]; 4 j BCP [ v;y ]; 5 if i>j then 6 break;computeanedgeof^ y;x;v andthebooleanvalue; 7 end 8 c x Cr [ x;y;i ]; 9 if i = j then c y Cl [ x;y;j ]; 10 else c y Cr [ v;y;i +1]; 11 d min f d x;c x + D i [ c x ;y;v ] ; d c y ;y + ^ D j [ c y ;x;v ] ;DBV [ x;y;i ] g ; 12 if Term1 ischoseninthecomputationof d then 13 return therstedgeof x;c x andthevalue1; 14 end 15 elseif Term2 ischoseninthecomputationof d then 16 return theedge P [ c y ;y ] ;y andthevalue0; 17 end 18 else 19 return FEBV [ x;y;i ]andthevalue1; 20 end 21 Algorithm17:Shortest-Path-Avoiding-Vertex 40

PAGE 51

Input :Vertices x y ,and v ofagraph G ,where v isthevertextoavoid Output :Shortestpath x;y;v Front List x ; 1 Back List y ; 2 while Front List :last 6 =Back List :last do 3 u;v;flag Shortest-Path-Avoiding-VertexFront List :last ,Back List :last 4 v ; if flag =1 then insert v toFront List :last ; 5 else insert u toBack List :last ; 6 end 7 CombineFront ListandBack Listtogetthesequenceofverticesin x;y;v ; 8 Algorithm18:Create-Path-Avoiding-Vertex AnalysisofAlgorithm17: Eachstepcallsuponavariableinanalreadycreatedtable thattakes O timetopullthedatafromthetable.Therefore,thetotalruntimeis O AnalysisofAlgorithm18: EachcalltoAlgorithm17Shortest-Path-Avoiding-Vertex inStep4takesconstanttime.Step8andtheWhileloopinStep3takeatotalof O L time,where L isthenumberofedgesin x;y;v .Therefore,thealgorithmrunsin O L 9.5Query:ShortestPathAvoidingAFailedEdge Algorithm19Shortest-Path-Avoiding-Edgeanswersqueriesthataskfortheshortest pathavoidingasinglefailededge.Theinputconsistsofvertices x and y andanedge u;v ofagraph G ,andtheoutputistheshortestpathfrom x to y avoidingtheedge u;v .Thisshortestpathmayeithertotallyavoidthevertex u oritpassesthrough u butavoidstheedge u;v .Thisisdeterminedbycomparingthedistancereturnedby Algorithm15Shortest-Distance-Avoiding-Vertexwith d x;u plus De [ u;y ],andstoring theminimumofthetwovaluesinavariable d .If d isassignedtheformervalue,then acalltoAlgorithm18Create-Path-Avoiding-Vertexismadeandtheshortestpathis 41

PAGE 52

returned.Otherwise,theshortestpathisconstructedbyconcatenating x;u ,thesecond endpoint z of DeE [ u;y ],and z;y Input :Vertices x and y andanedge u;v ofagraph G ,where u;v istheedge toavoid. Output :Shortestpathfrom x to y avoidingtheedge u;v ingraph G if d x;u + W [ u;v ]+ d v;y >d x;y then 1 return x;y ; 2 end 3 d 1 Shortest-Distance-Avoiding-Vertex x;y;u ; 4 d 2 d x;u + De [ u;y ]; 5 d min f d 1 ;d 2 g ; 6 if Term1 ischoseninthecomputationof d then 7 return Create-Path-Avoiding-Vertex x;y;u ; 8 end 9 else 10 u;z DeE [ u;y ]; 11 return x;u z z;y ; 12 end 13 Algorithm19:Shortest-Path-Avoiding-Edge AnalysisofAlgorithm19: Steps8and12takeatotalof O L time,where L isthe numberofedgesintheshortestpathavoidingtheedge u;v .Thecomputationtime ofallotherstepsis O .Therefore,thetotalruntimeofthealgorithmis O L 42

PAGE 53

CHAPTER10 RESULTS 10.1ExperimentalSetup Todeterminetheamountofspeedupinrunningtimeandreductionintotalspace isachievedbythenearlyoptimaloracleproposedin[BK09],theresultsarecompared againstthebrute-forcemethod,runonthesamemachineandthesameinput.Wechose tocomparethenearlyoptimaloracleagainstthatofthebrute-forcemethodtoshow themaximumamountofspeedupandmemoryreductionpossiblefromtheworst-case runningtimeandmemoryusage.Comparingthenearlyoptimaloracletothenextbest knownoraclemightnotgiveagoodcomparisonofhowwellthenearlyoptimaloracle performs.Asinanyexperimentalsetup,thereneedstobeacontrolcasetogaugehow wellthenewtheoryoralgorithmperforms;thebrute-forcemethodisourcontrolcase. Thebrute-forcemethodkeepsthefollowingtables: D withatotalspaceneededof O n 3 thatholdstheshortestdistancebetweenallverticeswhileavoidingeachvertex inturnandthetable Pred withatotalspaceneededof O n 3 thatholdstheparentof vertex y ontheshortestpath x;y;v avoidingthefailedvertex v .Tollinthesetables, thebrute-forcemethodmustrunthrougheachpairofverticesinthegraph,remove anothervertexfromthegraph,thenrunDijkstra'salgorithm,andrecordthedata. Therefor,thetotalcomputationtimeforllinginthetablesis O n 2 m + n log n Whenrunningthebrute-forcemethod,wetookthersttenverticesoftheinput graphforsinglesourceshortestpathcomputationsandthenextrapolatedthecomputationtimeoverallthesourceverticesandallsinglevertexfailures.Thiswasdonebecause ofthelargeamountofrunningtimethebrute-forcemethodwouldtaketocompletely traverseeverypathforeveryfailedvertex.Indoingso,thetimewasrecordedforthe 43

PAGE 54

tensampledverticesandthenestimatedforthenalruntime.Iftherewere,say250, verticesbeingtested,thentherecordedtimewasmultipliedby25as10 25=250. Althoughthisdoesnotaccuratelyportraythenalrunningtimeforthebrute-force method,itseemstobeagoodestimateoftheamountoftimethatcouldbeneededto runthebrute-forcemethodinitsentirety. Thetestswerebuilttodetermine,foreachdataset,theamountoftimeandthe amountofmemoryneededforconstructionofthenearlyoptimaloracleandtheoracle givenbythebrute-forcemethod.Thenumberofqueriesaskedforisnotimportantto theoverallrunningtimeortotalspacerequired;itisonlytodeterminethatthenearly optimaloracleisworkingcorrectly. 10.1.1EnvironmentforSyntheticDataSets Werstcreatedrandomlygeneratedinputgraphsorsyntheticdatasetstotestourcode on.Wecompiledandranboththenearlyoptimaloracleandthebrute-forcemethodon aWindowsmachinewithanIntelCore2DuoProcessor,withbothCPUcoresrunning at2.40GHzand4GBofmemoryrunningtheWindowsVistaHomePremiumservice pack264-bitoperatingsystem.ThecodewascompiledusingVisualStudio2008with nooptimizationagsandwithalllesstoredonlocalharddrive. 10.1.2EnvironmentforReal-WorldDataSets Inadditiontothesyntheticdatasets,weusedwithpermissionthreerealworlddata sets.Therstdataset[Kot04]ismodeledafterthatofalocalneuralnetworkof131 frontalneurons.Whereeachneuronisavertexinthegraphandthenervepathsarethe edgesbetweentheneurons.Thisdatasetiscomposedof131verticesand764edges. Theseconddataset[CMK04]isalsomodeledafterthatofaglobalneuralnetworkof277 neurons.Onceagain,eachneuronisavertexinthegraphandthenervepathsarethe edgesbetweentheneurons.Thisdatasetiscomposedof277verticesand2 ; 105edges. Finally,thethirddataset[BM06]ismodeledafterthepositionandightpathsofthe 44

PAGE 55

UnitedStatesairportsandairplanes.Whereeachairportisavertexandtheightpaths betweeneachairportaretheedges.Thisdatasetiscomposedof322verticesand2 ; 126 edges.Wethentestedourcode,boththenearlyoptimaloracleandthebruteforce method,onaLinuxMachineusinganIntelXeondualquadcoreprocessorinwhichall eightcoreswererunningat2661.126MHzand32GBofmemorywiththeLinuxROCKS 32-bitOS.Thecodewascompiledwithgccversion3.4.6withnooptimizationagsand withalllesstoredonlocalharddrive. 10.2TotalMemoryUsed-SyntheticDataSets InFigures10.1and10.2,thetotalmemoryusageisshownforboththenearlyoptimal andthebrute-forcemethod.Inthesegures,thex-axisrepresentsthenumberofvertices foreachinputgraphandthey-axisrepresentsthetotalmemoryusedintheconstruction oftheoracles.Thetotalmemoryforboththenearlyoptimaloracleandthebrute-force methodarecloseintermsofhowmuchisusedandareseparatedbyasmuchas1MB insomeinstances,withthenearlyoptimaloracleusinglessmemory.Thismaycomes asasurprisebecausethebrute-forcemethodhasamemoryusageof n 3 ,whereasthe nearlyoptimaloraclehasamemoryusageof e O n 2 .Theproblemarisesthoughduring execution,wherethebrute-forcemethodhasonlytwotablesthatrequire n 3 space, whilethenearlyoptimaloraclehasmanytablesthatrequireatotalof e O n 2 space. Havingsomanymoretables,itisnosurprisethatthenearlyoptimaloraclecomesclose intermsofmemoryusagetothatofthebrute-forcemethod,onsmalldatasets. 45

PAGE 56

Figure10.1:Totalmemoryusedforthenearlyoptimaloracleon synthetictestdata Figure10.2:Totalmemoryusedforthebrute-forcemethodon synthetictestdata 46

PAGE 57

Table10.1:Memoryusageofthenearlyoptimaloracleonsynthetictestdatatotalmemory usedismeasuredinkilobytes Number ofVertices NumberofEdges 45 1,225 11,175 19,900 31,125 44,850 61,075 79,800 10 1,423 -1 -1 -1 -1 -1 -1 -1 50 4,520 8,680 -1 -1 -1 -1 -1 -1 150 33156 65,740 69,144 67,328 -1 -1 -1 -1 200 57644 120,428 116,196 130,132 116,348 -1 -1 -1 250 90,076 188,100 178,656 184,120 184,448 192,224 193,520 -1 300 131,700 261,676 261,216 278,408 257,888 276,604 271,488 279,768 350 179,120 338,140 362,700 345,864 359,740 386,580 377,952 365,316 400 234,716 437,728 471,580 461,288 481,280 456,632 493,248 484,960 Table10.2:Memoryusageofthebrute-forcemethodonsynthetictestdatatotalmemory usedismeasuredinkilobytes Number ofVertices NumberofEdges 45 1,225 11,175 19,900 31,125 44,850 61,075 79,800 10 1,132 -1 -1 -1 -1 -1 -1 -1 50 2,504 2,544 -1 -1 -1 -1 -1 -1 150 31,280 31,340 31,572 31,688 -1 -1 -1 -1 200 70,372 70,440 70,660 70,880 71,160 -1 -1 -1 250 133,784 133,856 134,088 134,264 134,472 134,760 185,296 -1 300 227,360 227,460 227,668 227,876 228,152 228,484 228,632 229,056 350 357,012 357,096 357,320 357,488 357,728 357,968 358,376 358,996 400 528,560 528,644 528,868 529,060 529,312 529,624 530,072 530,180 Togetabetterideaofhowclosethenearlyoptimaloracleandthebrute-forcemethod areintermsofmemory,Tables10.1and10.2containtherecordeddatavaluesusedin theinputgraphs.Aninterestingpatternseeninbothdatatablesisthat,regardlessof thenumberofedgesintheinputgraphs,thetotalamountofmemoryuseddoesnot varymuchacrosseachrowi.e.,xingthenumberofvertices,butvaryingthenumberof edgesfortheinputgraphsdoesnotresultsinabigchangeinthetotalmemoryspentin theconstructionoforacles.Thisshowsthatitisthenumberofverticesthatdominates howmuchmemorywillbeusedduringtheexecutionofthealgorithm.Thiscomesas nosurpriseasboththenearlyoptimaloracleandtheoraclegivenbythebrute-force methodhaveatotalspacerequirementof e O n 2 and O n 3 ,respectively,where n isthe numberofvertices. 47

PAGE 58

Table10.3:Memoryusageofthenearlyoptimaloracleandthebrute-forcemethodon real-worldtestdatatotalmemoryusedismeasuredinkilobytes DataSets NearlyOptimalOracle Brute-forceMethod [Kot04] 34,520 19,516 [CMK04] 147,932 170,848 [BM06] 121,444 291,416 10.3TotalMemoryUsed-Real-WorldDataSets Table10.3containstherecordeddatavaluesforthetotalmemoryneededforthenearly optimaloracleandtheoraclegivenbythebrute-forcemethod.Exceptfortherstcase, thenearlyoptimaloracleusesthelessmemory.Thersttestcaseisagoodexample ofhowthenearlyoptimaloracle,insmalltestcases,canbeoutdonebythatofthe brute-forcemethod.Thisisattributedtothenumeroustablesthatthenearlyoptimal oraclemustcreateinordertoanswerqueriesinconstanttime. 10.4TotalConstructionTime-SyntheticDataSets 10.4.1TheNearlyOptimalOracleandTheBrute-ForceMethod InFigures10.3and10.4,thetotalconstructiontimeofthetwooraclesareshown.In thesegures,thex-axisrepresentsthenumberofverticesforeachinputgraphtest caseandthey-axisrepresentsthetotalconstructiontimeforeachtestcase.Here,it iseasilyseenthattheconstructiontimeofthenearlyoptimaloracleforeachtestcase ismuchlessthanthatoftheoraclegivenbythebrute-forcemethodforthesametest case.Thisclearlydemonstratesthesuperiorityintermsoftheconstructiontimeofthe nearlyoptimaloracleovertheoraclegivenbythebrute-forcemethod. 48

PAGE 59

Figure10.3:Totalrunningtimesforthenearlyoptimaloracleon synthetictestdata Figure10.4:Totalrunningtimesforthebrute-forcemethodon synthetictestdata 49

PAGE 60

Table10.4:Totalrunningtimesusedbythebrute-forcemethodonsynthetictestdatarunningtimeismeasuredinseconds Number ofVertices NumberofEdges 45 1,225 11,175 19,900 31,125 44,850 61,075 79,800 10 0.452 -1 -1 -1 -1 -1 -1 -1 50 2.582 68.040 -1 -1 -1 -1 -1 -1 150 49.771 768.042 5,136.270 8957.459 -1 -1 -1 -1 200 124.999 1,461.319 9,237.279 15,753.620 25,504.080 -1 -1 -1 250 207.775 2,340.949 14,190.900 23,931.150 38,749.025 60,255.050 123,319.830 -1 300 367.650 3,802.889 21,335.730 41,750.910 60,088.110 85,095.500 140,116.230 143,387.430 350 548.415 5,342.154 28,431.794 61,253.394 92,350.685 128,454.024 186,292.890 188,576.080 400 850.920 5,032.159 37,724.040 67,030.760 13,2229.039 185,758.880 205,832.519 276,464.519 50

PAGE 61

Table10.5:Totalrunningtimesusedbythenearlyoptimaloracleonsynthetictestdatarunningtimeismeasuredinseconds Number ofVertices NumberofEdges 45 1,225 11,175 19,900 31,125 44,850 61,075 79,800 10 0.783 -1 -1 -1 -1 -1 -1 -1 50 1.920 73.925 -1 -1 -1 -1 -1 -1 150 11.233 817.057 4,973.538 8,556.75 -1 -1 -1 -1 200 20.925 2,163.595 8,998.388 12,308.873 19,759.669 -1 -1 -1 250 30.513 4,300.29 11,668.698 20,060.217 25,497.112 27,577.922 38,740.574 -1 300 49.624 3,469.619 21,306.894 19,429.652 27,414.086 37,065.996 27,822.313 21,342.032 350 64.025 9,506.404 21,123.537 29,358.258 49,698.926 40,214.438 51,564.714 69,372.652 400 85.045 18,291.991 38,348.864 39,320.705 48,194.032 51,438.216 48,108.304 55,654.209 51

PAGE 62

Tables10.4and10.5showtherecordeddataforthenalconstructiontimesofboththe oraclesgivenbythebrute-forcemethodandthenearlyoptimaloracle.Lookingdowna columnincreasingverticesoracrossarowincreasingedges,itisnosurprisethatthe totalconstructiontimes,inmostcases,increasethewaytheydo.Atthecoreofeach algorithmisDijkstra'salgorithmwhoseruntimeisdependentonthenumberofvertices andthenumberofedges.ThereisnowaytoavoidrunningDijkstra'salgorithm,asthe shortestpathsbetweenverticesmustbeknowninboththeoracleconstructions. Lookingcloselyateachtableforthetotalconstructiontime,thereareafewinstances wherethetimerecordeddoesnotincreaseasthenumberofverticesincrease,butinfact decreases.ThisisclearlyevidentinTable10.5forthenearlyoptimaloracle.Thiscan beattributedtoDijkstra'salgorithm,asitisusedinmultiplestepsintheconstruction oftheoracle.TherunningtimeofDijkstra'salgorithmnotonlydependsonthenumber ofverticesandthenumberofedgesinthegraph,butalsodependsonthearrangement ofedgesinthegraph.Duetothelatterdependence,therecanbeadierenceinthe amountoftimebetweentwographsofequalsizenumberofverticesandnumberof edgesthatarestructurallydierently. 10.4.2All-PairsofShortestPaths Figure10.5:TotalrunningtimesforthealgorithmAll-Pairs-Shortest-Pathsonsynthetictest data 52

PAGE 63

InFigure10.5,thetotaltimetakenforAlgorithm4All-Pairs-Shortest-Pathsusedin thenearlyoptimaloracleisshown.Inthisgure,itisnoteasytoseeapatternwith thegivendata.Afewtestcasesshowanincreaseintheamountoftimeneededasthe numberofverticesgrow,butinmosttestcases,theamountofrunningtimecaneither increaseordecreasewithoutanynoticeablepattern.Thiscanbeexplainedasthisstep ofthenearlyoptimaloracleconstructionreliesonusingDijkstra'salgorithm.Where therunningtimeofDijkstra'salgorithmnotonlydependsonthenumberofvertices andthenumberofedgesinthegraph,butalsothewaythegraphisstructured. Table10.6:TotalrunningtimesforthealgorithmAll-Pairs-Shortest-Pathsonsynthetictest datarunningtimeismeasuredinseconds Number ofVertices NumberofEdges 45 1,225 11,175 19,900 31,125 44,850 61,075 79,800 10 0.063 -1 -1 -1 -1 -1 -1 -1 50 0.239 2.733 -1 -1 -1 -1 -1 -1 150 1.709 12.445 58.187 89.463 -1 -1 -1 -1 200 3.799 20.005 72.479 198.342 504.347 -1 -1 -1 250 4.672 25.133 226.762 159.542 494.408 631.746 802.714 -1 300 6.593 28.491 258.771 554.980 487.185 737.551 520.263 678.390 350 9.001 46.907 400.955 587.512 656.312 921.306 1,239.762 1,577.773 400 11.692 39.505 476.533 750.484 1,115.385 1,072.760 1,403.620 1,232.353 Table10.6showstherecordeddatafortherunningtimesforthealgorithmAllPairs-Shortest-Paths.Lookingcloselydownacolumnincreasingverticesoracross arowincreasingedges,thereisageneralincreaseintheamountofrunningtime, althoughthereareafewcaseswheretheamountoftimetakendoesdecrease.Once again,Dijkstra'salgorithmisthecauseofthis. 10.4.3AssigningPriorities InFigure10.6,thetotaltimetakenforAlgorithm5Assign-Priorityinthenearly optimaloracleisshown.Thisgureisstraightforwardtounderstandand,asexpected, thetotalrunningtimeislowevenwithahighnumberofedgesandahighnumberof vertices. Table10.7holdstherecordedrunningtimedataforthealgorithm.Inmosttestcases ofaxednumberofedges,thetotalrunningtimeincreasesasthenumberofvertices 53

PAGE 64

Figure10.6:TotalrunningtimesforthealgorithmAssign-Priorityonsynthetictestdata Table10.7:TotalrunningtimesforthealgorithmAssign-Priorityonsynthetictestdata runningtimeismeasuredinseconds Number ofVertices NumberofEdges 45 1,225 11,175 19,900 31,125 44,850 61,075 79,800 10 0.003 -1 -1 -1 -1 -1 -1 -1 50 0.005 0.034 -1 -1 -1 -1 -1 -1 150 0.008 0.246 0.472 0.412 -1 -1 -1 -1 200 0.008 0.516 0.429 1.182 1.184 -1 -1 -1 250 0.010 0.801 1.887 0.715 2.120 1.292 1.377 -1 300 0.012 2.196 4.763 2.785 3.360 1.956 1.983 2.400 350 0.014 1.247 4.136 3.970 2.796 2.730 2.824 2.861 400 0.016 2.739 7.120 5.258 5.267 3.717 3.613 3.738 increase.Thisiseasytoexplain,aseachvertexcanbevisitedatmost O log n times and,oneachvisit,atestisran O log n timesinanattempttosetthehighestpriority. Asforthediscrepancieswherethetimedecreasesastheverticesincrease,thiscanbe causedbyobtainingacorrectpriorityforeachvertexonasmallernumberoftriesthan thatoftheothertestcases. 10.4.4CoveringChains InFigure10.7,thetotaltimetakenforAlgorithms6and7Create-Cr-and-BCP-Tables andCreate-Cl-Tableinthenearlyoptimaloracleisshown.Onceagain,wegeta straightforwardplotand,asexpected,alowtotalrunningtimeofthealgorithm. 54

PAGE 65

Figure10.7:TotalrunningtimesforthealgorithmsCreate-Cr-and-BCP-Tablesand Create-Cl-Tableonsynthetictestdata Table10.8:TotalrunningtimesforthealgorithmsCreate-Cr-and-BCP-Tablesand Create-Cl-Tableonsynthetictestdatarunningtimeismeasuredinseconds Number ofVertices NumberofEdges 45 1,225 11,175 19,900 31,125 44,850 61,075 79,800 10 0.014 -1 -1 -1 -1 -1 -1 -1 50 0.056 0.190 -1 -1 -1 -1 -1 -1 150 0.399 2.260 3.481 3.304 -1 -1 -1 -1 200 0.920 3.877 3.137 9.279 9.162 -1 -1 -1 250 1.079 6.526 14.342 4.865 14.580 9.833 9.886 -1 300 1.739 8.122 22.288 22.487 14.218 14.224 13.716 14.521 350 2.127 10.894 29.908 29.183 20.191 19.769 19.529 19.474 400 2.693 14.227 39.669 38.742 39.321 25.422 25.568 26.143 Table10.8holdstherecordeddataforthealgorithmsduringeachconstructionofthe nearlyoptimaloracle.Thetableshowsthatinmosttestcasesforaxednumberof edges,therunningtimegrowswithanincreaseinthenumberofverticesused.This canbeexplainedbythefollowingreasoning:asthenumberofverticesgrow,sodothe numberofshortestpaths x;y thathavetobetraversedtondallcentervertices.For therecordedtimesthatdecreasewhenthenumberofverticesincrease,thisiscaused bythenumberofedgesontheshortestpath.Thelessamountofedgesmeansshorter pathtreesandafasterreturntime. 55

PAGE 66

Figure10.8:TotalrunningtimesforthealgorithmsCreate-D k -and-D k E-Tablesand Create-De-and-DeE-Tablesonsynthetictestdata 10.4.5ShortestDistancesfromCenters InFigure10.8,thetotaltimetakenforAlgorithms9and10Create-D k -and-D k E-Tables andCreate-De-and-DeE-Tablesinthenearlyoptimaloracleisshown.Here,onecan seeabottleneckintheamountoftimeittakestocreatethenearlyoptimaloracle. Thisistobeexpectedthoughasthecreationofthe D k and De tablesrequiresrunning Dijkstra'salgorithmmanytimesonsub-graphscreatedfromthemaingraph.Theonly waytospeedthisprocessupwouldbetondafasterwaythanthatoftheimplemented Dijkstra'salgorithm. 56

PAGE 67

Table10.9:TotalrunningtimesforthealgorithmsCreate-D k -and-D k E -TablesandCreate-De-and-DeE-Tablesonsynthetictestdatarunning timeismeasuredinseconds Number ofVertices NumberofEdges 45 1,225 11,175 19,900 31,125 44,850 61,075 79,800 10 0.637 -1 -1 -1 -1 -1 -1 -1 50 0.882 58.177 -1 -1 -1 -1 -1 -1 150 1.259 334.068 3,538.985 7,343.312 -1 -1 -1 -1 200 1.742 688.943 5,226.499 9,278.650 16,167.356 -1 -1 -1 250 2.454 869.192 6,984.117 12,267.551 20,077.349 21,569.927 32,394.640 -1 300 2.696 1,473.274 9,436.752 12,478.880 17,649.640 26,830.760 18,719.736 12,270.429 350 2.965 2,187.400 10,160.260 19,474.289 35,740.898 28,256.646 40,641.660 58,301.121 400 3.324 2,449.580 14,148.271 20,546.458 26,945.380 36,275.750 27,513.763 34,200.804 57

PAGE 68

Table10.9givestherecordedrunningtimesforeachofthetestcases.Here,onecansee apatternforeachtestcaseinwhichthetotalrunningtimeincreasesforaxednumber ofedgesandavaryingnumberofvertices.Thiscanbeexplainedasthealgorithmran herelookstocoverallverticesfromacentervertex,wherethecentervertex c witha priorityof k cancoververticesupto5 2 k levelsonitsshortestpathtree, T c .Withthe increaseinthenumberofedges,thiscausesanincreaseinthenumberofverticeson eachlevel,whichleadstoalargegraphtopassasinputintoDijkstra'salgorithm.As forthefewtestcaseswherethetotalrunningtimedecreasesasthenumberofvertices increase,thiscanbecausedbyoneoftwothings:Thenewgraphscreatedaresmaller insizethanthatoftheprevioustestcasesandthewayinwhichthenewgraphsare constructedasthatalsoeectstheamountofrunningtimeDijkstra'salgorithmtakes. 10.4.6BottleneckTables Figure10.9:TotalrunningtimesforthealgorithmsCreate-BV-Tableand Create-DBV-and-FEBV-Tablesonsynthetictestdata InFigure10.9,thetotaltimetakenforAlgorithms13and14Create-BV-Tableand Create-DBV-and-FEBV-Tablesinthenearlyoptimaloracleisshown.Aswiththetotal timeforconstructingtheCreate-D k -and-D k E-TablesandCreate-De-and-DeE-Tables algorithms,thesealgorithmstakealargeamountoftimetocreate.Onceagainthecause ofthisisDijkstra'salgorithm.Inthecreationofthebottlenecktables,anewgraph 58

PAGE 69

iscreatedthathas O n 2 log n numberofverticesand O mn log n implicitnumberof edges.Withthisnewgraphcreated,Dijkstra'salgorithmisthenrunuponit.Astobe expected,asthenumberofverticesandnumberofedgesincrease,thetotaltimetaken usuallyincreases. 59

PAGE 70

Table10.10:TotalrunningtimesforthealgorithmsCreate-BV-TableandCreate-DBV-and-FEBV-Tablesonsynthetictestdatarunningtime ismeasuredinseconds Number ofVertices NumberofEdges 45 1,225 11,175 19,900 31,125 44,850 61,075 79,800 10 0.066 -1 -1 -1 -1 -1 -1 -1 50 0.738 12.791 -1 -1 -1 -1 -1 -1 150 7.858 468.038 1,372.413 1,120.259 -1 -1 -1 -1 200 14.456 1,450.254 3,695.844 2,821.420 3,077.620 -1 -1 -1 250 22.298 3,398.638 4,441.590 7,627.544 4,908.655 5,365.124 5,531.957 -1 300 38.584 1,957.536 11,584.320 6,370.520 9,259.683 9,481.505 8,566.615 8,376.292 350 49.918 7,259.956 10,528.278 9,263.304 13,278.729 11,013.987 9,660.939 9,471.423 400 67.320 15,785.940 23,677.271 17,979.763 20,088.679 14,060.567 19,161.740 20,191.171 60

PAGE 71

Table10.10holdstherecordeddataforthetotalrunningtimeofthealgorithms.Looking downacolumnincreasingverticesorlookingacrossarowincreasingedgesthereare uctuationsinthetimerecorded,butnotasteadyincrease.Thisiscausedonceagain byDijkstra'salgorithm,wherethestructureofthegrapheectsthetotalamountof runningtimetakentondall-pairsofshortest-paths. 10.5TotalConstructionTime-Real-WorldDataSets 10.5.1TheNearlyOptimalOracleandTheBrute-ForceMethod Table10.11:Constructiontimesofthenearlyoptimaloracleandtheoraclegivenbythe brute-forcemethodonreal-worldtestdatarunningtimeismeasuredinseconds DataSets NearlyOptimalOracle Brute-forceMethod [Kot04] 13.033 13.175 [CMK04] 85.433 144.000 [BM06] 43.981 105.701 Table10.11containstherecordeddatavaluesforthetotalconstructiontimeneededfor thenearlyoptimaloracleandtheoraclegivenbythebrute-forcemethod.Thevalues herearemeasuredinseconds,andonceagainthenearlyoptimaloracleoutperformsthe oraclegivenbythebrute-forcemethodineverytestcase. 10.5.2All-PairsofShortestPaths Table10.12:TotalrunningtimesforthealgorithmAll-Pairs-Shortest-Pathsonreal-worldtest datarunningtimeismeasuredinseconds DataSets NearlyOptimalOracle [Kot04] 0.283 [CMK04] 1.624 [BM06] 105.701 Table10.12showsthetotaltimetakenforAlgorithm4All-Pairs-Shortest-Pathsused inthenearlyoptimaloracle.Thesevalueswereobtainedbyrunningthenearlyoptimal oracleonthereal-worlddatasets.Asistobeexpectedfromanalgorithmthatisbased onDijkstra'salgorithm,asthenumberofverticesandthenumberofedgesincrease,so doestherunningtimeforthisstep. 61

PAGE 72

10.5.3AssigningPriorities Table10.13:TotalrunningtimesforthealgorithmAssign-Priorityonreal-worldtestdata runningtimeismeasuredinseconds DataSets NearlyOptimalOracle [Kot04] 0.180 [CMK04] 0.800 [BM06] 0.500 Table10.13showsthetotaltimetakenforAlgorithm5Assign-Priorityinthenearly optimaloracle.Here,thetotalrunningtimeofthisstepisdependentontheprobability of = 2 k .Ifanassignmentofprioritiesisnotcorrect,thentheymustbereassigned again,thisleadstothedierencesintimeshowninthetable. 10.5.4CoveringChains Table10.14:TotalrunningtimesforthealgorithmsCreate-Cr-and-BCP-Tablesand Create-Cl-Tableonreal-worldtestdatarunningtimeismeasuredinseconds DataSets NearlyOptimalOracle [Kot04] 0.266 [CMK04] 1.290 [BM06] 1.255 Table10.14showsthetotaltimetakenforAlgorithms6and7Create-Cr-and-BCPTablesandCreate-Cl-Tableinthenearlyoptimaloracle.Inthistable,dataset[CMK04] takesthemostamountoftime.Thiscouldbecausedbyhowtheverticeswereassigned prioritiesorjustthearrangementofedgesproducinglongershortestpathsthanthe largerdataset[BM06]. 10.5.5ShortestDistancesfromCenters Table10.15:TotalrunningtimesforthealgorithmsCreate-D k -and-D k E -Tablesand Create-De-and-DeE-Tablesonreal-worldtestdatarunningtimeismeasuredinseconds DataSets NearlyOptimalOracle [Kot04] 8.510 [CMK04] 62.829 [BM06] 32.206 62

PAGE 73

Table10.15showsthetotaltimetakenforAlgorithms9and10Create-D k -and-D k ETablesandCreate-De-and-DeE-Tablesinthenearlyoptimaloracle.Onceagain,data set[CMK04]takesthemostrunningtime,eventhoughitisasmallerdatasetinthe numberofverticesandthenumberofedges.Thissteprequiresthecenterverticesto coververtices O k levelsdeepinitsshortestpathtree.Withtherecordedrunning time,itissafetoassumethatdataset[CMK04]hasmorelevelsthanthatoftheothers. 10.5.6BottleneckTables Table10.16:TotalrunningtimesforthealgorithmsCreate-BV-Tableand Create-DBV-and-FEBV-Tablesonreal-worldtestdatarunningtimeismeasuredinseconds DataSets NearlyOptimalOracle [Kot04] 4.415 [CMK04] 21.237 [BM06] 9.492 Table10.16showsthetotaltimetakenforAlgorithms13and14Create-BV-Table andCreate-DBV-and-FEBV-Tablesinthenearlyoptimaloracle.Followingthetrend sofar,dataset[CMK04]doesindeedtakethelongestrunningtime.Inthisstep, thebottleneckverticesarefoundandthenavoided.Dataset[CMK04],goingothe assumptionbeforeofhavingahighnumberofverticeswithahighpriority,couldhave manycoveringintervalsofgreatlength.Ifonlytheendpoints, x and y ,oftheshortest path x;y ,hadthegreatestpriority,thentherewouldonlybeonecoveringintervalfor thepath x;y ,thatof x to y .Thiscouldcauseanincreaseintheamountofrunningtime aseachintervalmustberecursivelybrokendowntillonlyoneortwoverticesremain. 63

PAGE 74

CHAPTER11 CONCLUSION 11.1FinalThoughts Inconclusion,theplanslaidoutbytheauthorsofANearlyOptimalOracleforAvoidingFailedVerticesandEdges"[BK09]havebeenproventoholdtrueinourexperimentalstudy.Ineverywaythenearlyoptimaloracleisbetterthanthatofthebrute-force method:amuchshorterrunningtimeof ~ O mn andalowermemoryrequirementof ~ O n 2 .Thealgorithmmaintainstheshortestdistancefromeachvertextoeveryother vertexoftheinputgraph,andsoitrequiresatleast n 2 space.Thisisagreatreductionfromthebrute-forcemethodthatwouldrequire n 3 space.Adecreasein thetotaltimeneededispossibleifthereisanalgorithmthatoutperformsDijkstra's algorithminndingsingle-sourceshortestpathsinanygivengraph.However,thisdoes notseemlikelyatthispointintime. Inthisthesis,welimitedourfocusonimplementationandexperimentalvalidation ofthedistancesensitivityoracleconstructionbyBernsteinandKarger[BK09]andso werestrainedexperimentsonsmalldatasets.Asfuturework,wewouldliketotest ourimplementationonlargerdatasetsforstudyingtheperformanceontimeandspace requirementsasafunctionofgraphsizei.e.,thenumberofverticesandthenumber ofedgesoftheinputgraphandtoexperimentallyndtheoptimalconstantsused throughoutthecode.Agoodexampleofthisisthenumberoflevelsacentervertex c willcoverinitsshortestpathtree.InAlgorithms5and9,wefoundthattheconstant valueof5multipliedby2 k k beingthecenterpriority,wasabletocoverthesmallest amountofverticesandstillanswerqueries.Ifthenumberofverticesweretoincrease, sowouldthatofthenumberoflevelsthatcanbecovered.Wecouldthenrunmany 64

PAGE 75

experimentstoseeifthevalueof5couldbedecreased,orsincethereisanincreaseinthe numberofvertices,needstobeincreased.Thiswouldleadtoanewstudyofgraphsize versusconstantsthatcouldbeexploredandusedinevaluatingperformanceatruntime ofthenearlyoptimaloracle.Ourcodeisavailableforfurtherdevelopmentandtesting andcanbemadeavailablethroughrequestsbyemailorthroughUSFarchives.The codehasbeenwrittentobecross-platform,meaningthatthecodecanbecompiledand runonanyWin32orWin64machine,MacOSXmachine,orLinuxmachine. 65

PAGE 76

REFERENCES [BK08]A.BernsteinandD.Karger.Improveddistancesensitivityoraclesviarandomsampling.In Proceedingsofthe19thAnnualACM-SIAMSymposium onDiscreteAlgorithms ,pages34{43.SIAM,2008. [BK09]A.BernsteinandD.Karger.Anearlyoptimaloracleforavoidingfailed verticesandedges.In Proceedingsofthe41stAnnualACMSymposiumon TheoryofComputing ,pages101{110.ACM,2009. [BM06]V.BatageljandA.Mrvar.Pajekdatasets.http://vlado.fmf.unilj.si/pub/networks/data/,2006. [Boy97]J.Boyer.Algorithmalley. Dr.DobbsJournalofSoftwareTools ,22:115{ 116,118,129,1997. [CMK04]Y.Choe,B.McCormick,andW.Koh.Networkconnectivityanalysison thetemporallyaugmentedemc.elegansweb:Apilotstudy. Societyof NeuroscienceAbstracts ,30:921{929,2004. [Dij59]E.Dijkstra.Anoteontwoproblemsinconnexionwithgraphs. Numerishche Mathematik ,pages269{271,1959. [DTCR08]C.Demetrescu,M.Thorup,R.Chowdhury,andV.Ramachandran.Oracles fordistancesavoidingafailednodeorlink. SIAMJournalonComputing 37:1299{1318,2008. [FH06]J.FischerandV.Heun.Theoreticalandpracticalimprovementsonthe RMQ-problem,withapplicationstoLCAandLCE.In Proceedingsofthe 17thAnnualACMSymposiumonCombinatorialPatternMatching ,pages 36{48,2006. [Kot04]R.Kotter.Onlineretrieval,processing,andvisualizationofprimateconnectivitydatafromthecocomacdatabase. Neuroinformatics ,2:127{144, 2004. [Mou09]D.Moulding.Visualleakdetector.http://sites.google.com/site/dmoulding/vld, 2009. 66

PAGE 77

ABOUTTHEAUTHOR VincentWilliamsiscurrentlyagraduatestudentworkingonhismaster'sdegree inComputerScienceintheDepartmentofComputerScienceandEngineeringatthe UniversityofSouthFloridaUSF,Tampa.VincentisalsopartoftheBSandMS veyearprogramintheDepartmentofComputerScienceandEngineeringatUSF andwillbegraduatingwithbothhisbachelorsandmastersdegree.Vincentbeganhis collegecareerearlybydual-enrollinginacommunitycollegewhilestillinhighschool andobtaininghisAAbeforehishighschooldiploma.Vincentisaselfmotivatedperson whobacksdownfromnochallenge.WhengiventheopportunitytoteachEnglishin Chinaforayear,hetookthechance.WhileinChina,Vincentneverfellbehindin hisstudies,hestayedenrolledatUSFandcontinuedhisworkonhisthesis.Withhis graduationonthehorizon,Vincenthasbegunworkingpart-timeatacompanycalled Wynright.Wynrightisasoftwarecompanythatwritesapplicationsforconveyorbelts androboticsthatareusedinsidewarehousestoincreasetheshippingrateofproducts. ComeJanuary2011,Vincentwillpursueafull-timeemploymentwithWynrightuntil Juneof2011whenhewilljointheAirForceandservehiscountry.