Improved Shortest Path Algorithms for Nearly Acyclic Directed Graphs L. Tian and T. Takaoka University of Canterbury New Zealand 2007.

Slides:



Advertisements
Similar presentations
TWO STEP EQUATIONS 1. SOLVE FOR X 2. DO THE ADDITION STEP FIRST
Advertisements

Chapter 28 Weighted Graphs and Applications
Delta Confidential 1 5/29 – 6/6, 2001 SAP R/3 V4.6c PP Module Order Change Management(OCM)
Advanced Piloting Cruise Plot.
Feichter_DPG-SYKL03_Bild-01. Feichter_DPG-SYKL03_Bild-02.
© 2008 Pearson Addison Wesley. All rights reserved Chapter Seven Costs.
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Chapter 1 The Study of Body Function Image PowerPoint
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
Author: Julia Richards and R. Scott Hawley
1 Copyright © 2013 Elsevier Inc. All rights reserved. Appendix 01.
1 Copyright © 2010, Elsevier Inc. All rights Reserved Fig 2.1 Chapter 2.
Properties Use, share, or modify this drill on mathematic properties. There is too much material for a single class, so you’ll have to select for your.
UNITED NATIONS Shipment Details Report – January 2006.
and 6.855J Cycle Canceling Algorithm. 2 A minimum cost flow problem , $4 20, $1 20, $2 25, $2 25, $5 20, $6 30, $
and 6.855J Spanning Tree Algorithms. 2 The Greedy Algorithm in Action
1 RA I Sub-Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Casablanca, Morocco, 20 – 22 December 2005 Status of observing programmes in RA I.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Properties of Real Numbers CommutativeAssociativeDistributive Identity + × Inverse + ×
Exit a Customer Chapter 8. Exit a Customer 8-2 Objectives Perform exit summary process consisting of the following steps: Review service records Close.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Addition Facts
Year 6 mental test 5 second questions
Year 6 mental test 10 second questions
ZMQS ZMQS
Solve Multi-step Equations
REVIEW: Arthropod ID. 1. Name the subphylum. 2. Name the subphylum. 3. Name the order.
Randomized Algorithms Randomized Algorithms CS648 1.
Data Structures: A Pseudocode Approach with C
ABC Technology Project
Comp 122, Spring 2004 Graph Algorithms – 2. graphs Lin / Devi Comp 122, Fall 2004 Identification of Edges Edge type for edge (u, v) can be identified.
1 Undirected Breadth First Search F A BCG DE H 2 F A BCG DE H Queue: A get Undiscovered Fringe Finished Active 0 distance from A visit(A)
2 |SharePoint Saturday New York City
Green Eggs and Ham.
VOORBLAD.
1 Breadth First Search s s Undiscovered Discovered Finished Queue: s Top of queue 2 1 Shortest path from s.
Factor P 16 8(8-5ab) 4(d² + 4) 3rs(2r – s) 15cd(1 + 2cd) 8(4a² + 3b²)
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
1..
Graphs, representation, isomorphism, connectivity
CONTROL VISION Set-up. Step 1 Step 2 Step 3 Step 5 Step 4.
© 2012 National Heart Foundation of Australia. Slide 2.
Welcome To The Four Umpire System. © 2007 Softball Canada All Rights Reserved Softball Canada Four Umpire System FP & SP 2 Tips for the Four Umpire System.
Understanding Generalist Practice, 5e, Kirst-Ashman/Hull
1 On c-Vertex Ranking of Graphs Yung-Ling Lai & Yi-Ming Chen National Chiayi University Taiwan.
Addition 1’s to 20.
25 seconds left…...
H to shape fully developed personality to shape fully developed personality for successful application in life for successful.
Januar MDMDFSSMDMDFSSS
1 hi at no doifpi me be go we of at be do go hi if me no of pi we Inorder Traversal Inorder traversal. n Visit the left subtree. n Visit the node. n Visit.
Week 1.
Analyzing Genes and Genomes
We will resume in: 25 Minutes.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Intracellular Compartments and Transport
PSSA Preparation.
Essential Cell Biology
Foundations of Data Structures Practical Session #7 AVL Trees 2.
Immunobiology: The Immune System in Health & Disease Sixth Edition
CpSc 3220 Designing a Database
all-pairs shortest paths in undirected graphs
Interval Graph Test.
Minimum Vertex Cover in Rectangle Graphs
Presentation transcript:

Improved Shortest Path Algorithms for Nearly Acyclic Directed Graphs L. Tian and T. Takaoka University of Canterbury New Zealand 2007

Introduction  What is nearly acyclic directed graphs? (1) Takaoka (1998) explained this using a strongly connected component (sc- component) approach, cyc(G). SC 1 SC 2 e1e1 e2e2 SC 1 e1e1 e2e2 In this example, cyc(G) = 3

Solve the SSSP problem using sc- component decomposition 1.Compute sc-components V r,V r-1, …,V 1 ; 2.for v ∈ V do d[v] ← ∞; 3.d[s] ← 0; 4.for i ← r to 1 do{ 5.Solve the GSS for G i ; 6.for V j such that (V i, V j ) ∈ E do 7. for v ∈ V i and w ∈ V j such that (v, w) ∈ E do 8. d[w] ← min{d[w], d[v] + cost(v,w)}; 9.} The time complexity of this algorithm is O(m + nlogk), where m is the number of edges in a graph and n is the number of vertices. K is the maximum size of sc components

Introduction (continue) (2) Saunders and Takaoka (2005) used a 1-dominator approach to explain that. The SSSP algorithm based on the approach is O(m+rlogr) where r is the number of triggers. AC 1 AC 2 e1e1 e2e2 e3e3 e3e3 AC 1 AC 2 e1e1 e2e2

Restricted Depth First Search for 1-dominator decomposition 1.function AcyclicSetA(u){ 2. VertexSet A, L; 3. procedure rdfs(v){ 4. A ← A + {v}; 5. for each w ∈ OUT(A) do{ 6. if w  L then L ← L + {w}; // w is visited 7. inCount[w] ← inCount[w] – 1; 8. if inCount[w] = 0 then rdfs(w); // w is unlocked 9. } 10. } 11. A ← ; L ← {u}; 12. inCount[u] ← inCount[u] + 1; // prevents re-traversal of u 13. rdfs(u); 14. VertexSet B ← L – A; // boundary vertices 15. for each w ∈ L do inCount[w] ← |IN(w)|; 16. return (A,D); 17.}

Computing the 1-Dominator Set 1.for all v ∈ V do inCount[v] ← |IN(v)|; 2.for all v ∈ V do vertexType[v] ← unknown; 3.a queue Q ← {s}; 4.while Q ≠  do{ 5. Remove the next vertex u from Q; 6. if vertexType[u] = unknown then { 7. (A, B) ← AcyclicSetA(u); 8. for each v ∈ A do Let AC[v] refer to A; 9. for each v ∈ A do vertexType[v] ← nontrigger; 10. vertexType[u] ← trigger; 11. for each v ∈ B do 12. if vertexType[v] = unknown and v  Q then Add v to Q; 13. } 14.}

SSSP Algorithm using Acyclic Decomposition 1.procedure decreaseKey(u){ 2. for each v ∈ AC[u] in topological order do 3. for each w ∈ OUT[v] and w  S do 4. d[w] ← min{d[w], d[v] + cost(v,w)}; 5.} 6.for all v ∈ V do d[v] ← ∞ ; 7.solution set S ← ; 8.insert all triggers into frontier set F; 9.d[s] ← 0; // s is the source vertex 10.if s is not a trigger then decreaseKey(s); 11.while F is not empty do{ 12. find u from F with minimum key and delete u from F; 13. S ← {u}; 14. decreaseKey(u); 15.}

Higher-Order Approach  This approach extends the technique of sc-component decomposition, denoted by cyc h (G). cyc 1 (G) cyc 2 (G) In the second order decomposition, it eats the black node and then decomposes the subgraph.

Higher-Order SSSP Algorithm 1.procedure Dynamic(G, SV){ 2. Compute h th order sc-components V h r, V h r-1, …,V h 1 ; 3. for i ← r to 1 do{ 4. for V h j such that (V h i, V h j ) ∈ E h do 5. for v ∈ V h i and w ∈ V h j such that (v, w) ∈ E do 6. d[w] ← min{d[w], d[v] + cost(v,w)}; 7. v min ← w that gives min{d[w] | w ∈ V h i-1 }; 8. SV ← {v min }; 9. if (|G h i-1 |>c 1 ) and (h+1< c 2 ) 10. then { h ← h+1; Dynamic(G h i-1 ; SV); } 11. else solve the GSS for G h i-1 ; 12. } 13.} 14.for all v ∈ V do d[v] ← ∞; 15.d[s] ← 0; // s is the source vertex 16.Dynamic(G, {s});

Hierarchical Approach  This approach is based on modifications of the sc-component and 1-dominator approaches. AC 3 AC 1 AC 2 AC 4 AC 5 SC 1 SC 2

Hierarchical Decomposition Algorithm 1. function HierarchySets(v 0 ) { 2. procedure hdfs(v) { 3.(A, B) ← AcyclicSet(v); 4. Let AC[v] refer to A; 5. vertexType[v] ← trigger ; 6. for all u ∈ A do vertexType[u] ← non-trigger; 7.for all u ∈ B do 8. if visitNum[u] = 0 do{ 9. c ← c + 1 ; visitNum[u] ← c ; lowlink[u] ← c; 10. T ← T + {u} ; 11. hdfs(u) ; // search from unvisited v ∈ B 12. if u ∈ T then lowlink[v] ← min(lowlink[u],lowlink[v] ); 13. else lowlink[v] ← min(lowlink[v], vsistNum[u] ); //update lowlink[v] from connected triggers 14. } 15. if lowlink[v] = visitNum[v] and v ∈ T do { 16. VertexSet C ← pop up vertices from T until v; 17. p ← p + 1; // count sc-components 18. Let SC[p] refer to C; 19. } 20. } 21. VertexSet AC ← , SC ← , T ← ; 22. for all v ∈ V do { 23. inCount[v] ← |IN(v)|; vertexType[v] ← unknown; 24. visitNum[v] ← 0; lowlink[v] ← ; 25. } 26. p ← 0; c ← 0; 27. for all unvisited v 0 ∈ V do { 28. c ← c + 1; visitNum[v 0 ] ← c; lowlink[v 0 ] ← c; 29. T ← T + v 0 ; 30. hdfs(v 0 ); 31. } 32. return(AC, SC, p); 33. }

1-2-dominator sets  Difficulty on 2-dominator sets:  A 1-2-dominator set is a generalization of the 1-dominator set. u1u1 u2u2 u3u3 v1v1 v2v2 V j+1 v3v3 vjvj V j+2 V 2j-1 u1u1 u2u2 u3u3 v1v1 v2v2 V j+1 v3v3 vjvj V j+2 V 2j-1

Restricted Depth First Search for 1-2-dominator decomposition 1.function AcyclicSetA(u){ 2. VertexSet A, L; 3. procedure rdfs(v){ 4. A ← A + {v}; 5. for each w ∈ OUT(A) do{ 6. if w  L then L ← L + {w}; // w is visited 7. inCount[w] ← inCount[w] – 1; 8. if inCount[w] = 0 then rdfs(w); // w is unlocked 9. } 10. } 11. A ← ; L ← {u}; 12. inCount[u] ← inCount[u] + 1; // prevents re-traversal of u 13. rdfs(u); 14. VertexSet B ← L – A; // boundary vertices 15. for each w ∈ B do { 15.1 inc(v,w) ← |IN(w)| – inCount[w]; 15.2 BS[v] ← (w, inc(v,w)); 15.3 inCount[w] ← |IN(w)|; 15.4 } 16. return (A,B); 17. }

1-2-Dominator Set Algorithm 1. procedure gdfs(u 1, u 2, v) { 2. for all w ∈ BS[v] do { 3. inCount[w] ← inCount[w] - inc(v, w) ; 4. if inCount[w] = 0 do { // w is unlocked 5. T 1 ← T 1 - {w} ; // 1-dominator set T 1 6. AC[u 1 ] ← AC[u 1 ] + {w}; 7. AC[u 2 ] ← AC[u 2 ] + {w}; 8. gdfs(u 1, u 2, w); 9. } 10. } 11. } /***** main program *****/ 12. Compute 1-dominator set T 1 ; 13. for u 1 ∈ T 1 do{ 14. inCount[u 1 ] ← inCount[u 1 ] + 1; 15. for all v ∈ BS[u 1 ] do inCount[v] ← inCount[v] - inc(u 1, v); 16 for u 2 ∈ T 1 - {T 1 } do { 17. inCount[u 1 ] ← inCount[u 2 ] + 1; 18. gdfs(u 1, u 2, u 2 ); 19. } 20. T 1 ← T 1 - {u 1 } ; 21. for all v ∈ BS[u 1 ] do inCount[v] ← |IN(v)|; 22. }

SSSP Algorithm using Acyclic Decomposition 1.procedure decreaseKey(u){ 2. for each v ∈ AC[u] in topological order do 3. for each w ∈ OUT[v] and w  S do 4. d[w] ← min{d[w], d[v] + cost(v,w)}; 5.} 6.for all v ∈ V do d[v] ← ∞ ; 7.solution set S ← ; 8.insert all triggers into frontier set F; 9.d[s] ← 0; // s is the source vertex 10.if s is not a trigger then decreaseKey(s); 11.while F is not empty do{ 12. find u from F with minimum key and delete u from F; 13. S ← {u}; 14. decreaseKey(u); 15.}

Future research  k domnator approach: Acyclic structures are dominated by up to k trigger vertices  All Pairs with 1-dominator set O(mn + r 2 log r) General feedback set approach for all pairs: If we have a feedback vertex set of size r, the best time is O(mn + r 3 ). Conjecture O(mn + r 2 log r)?