improved decremental algorithms for
DESCRIPTION
Improved Decremental Algorithms for. Transitive Closure All-Pairs Shortest Paths in Directed Graphs. Surender Baswana work supported by a fellowship from Infosys Tech. Bangalore Sandeep Sen work supported in part by an IBM UPP award I.I.T. Delhi India. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/1.jpg)
Improved Decremental Algorithms for
• Transitive Closure• All-Pairs Shortest Paths in Directed Graphs
![Page 2: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/2.jpg)
34th ACM STOC 2002
• Surender Baswana work supported by a fellowship from Infosys Tech. Bangalore
• Sandeep Senwork supported in part by
an IBM UPP award
I.I.T. Delhi
India
• Ramesh Hariharan
I.I.Sc. Bangalore
India
![Page 3: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/3.jpg)
Two Fundamental Algorithmic Graph Problems
• Transitive Closure
• All-Pairs Shortest Paths
![Page 4: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/4.jpg)
Transitive Closure
• Process a given directed graph G(V,E) so that any query
of the form,
“ Is there a path from u to v in the graph?”
can be answered efficiently
![Page 5: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/5.jpg)
Existing Static Algorithms
• Classical Algorithms : O(mn)
• Algorithms based on fast matrix multiplications : O(n2.575)
(Zwick, FOCS 1998)
![Page 6: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/6.jpg)
Dynamic Maintenance of APSP (Transitive Closure)
Given a directed graph G(V,E) followed by an online sequence of updates interspersed with queries
Process each query and update efficiently
![Page 7: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/7.jpg)
Aim of Dynamic Algorithms for APSP (Transitive Closure)
To Maintain a data-structure that
• can answer each query efficiently
• can be updated efficiently after each update (in time less than the best static
algorithm)
![Page 8: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/8.jpg)
Two Types of Dynamic Algorithms
• Fully Dynamic ( both insertion and deletion of edges allowed)
• Partially Dynamic Incremental (only insertion) Deletion (only deletion)
![Page 9: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/9.jpg)
Decremental Algorithms for Transitive Closure
Query Time Update time(per edge deletion)
Leeuwen et al.
1998O(1) O(m)
Henzinger & King, STOC 1995
O(n/log n) O(n log n)
Demetrescu et al.
FOCS 2000O(1) O(n/m)
2
3
![Page 10: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/10.jpg)
Contribution of our Paper
Decremental Algorithms for
• Transitive Closure
• APSP
that achieve improved update time while keeping optimal query time
![Page 11: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/11.jpg)
Decremental Algorithm for transitive closure
![Page 12: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/12.jpg)
Main Idea
A new data-structure that
• stores transitive closure imformation implicitly
• is more suitable for maintaining reachability for long paths
![Page 13: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/13.jpg)
Main Idea Contd.
Suitably combine two data-structures
• S:
suitable for reachability corresponding to short paths.
• L :
suitable for reachability corresponding to long paths.
![Page 14: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/14.jpg)
Basic Data-structure Used
Theorem : A BFS tree of depth d, rooted at a vertex can be maintained under deletion of edges that
• takes O(1) query time
• requires O(d) amortized update time per edge deletion.
![Page 15: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/15.jpg)
Explicit Maintenance of Transitive Closure
uv
![Page 16: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/16.jpg)
Explicit Maintenance of Transitive Closure contd.
uv
![Page 17: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/17.jpg)
Implicit Maintenance of Transitive Closure
uv
![Page 18: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/18.jpg)
Implicit Maintenance of Transitive Closure
uv
![Page 19: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/19.jpg)
Implicit Maintenance of Transitive Closure
uv
In_treeOut_tree
![Page 20: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/20.jpg)
Transitive closure corresponding to paths of length d passing through
set of witnesses W
![Page 21: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/21.jpg)
Transitive closure corresponding to paths of length d passing through
set of witnesses W
![Page 22: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/22.jpg)
Transitive closure corresponding to paths of length d passing through
set of witnesses W
u
vM
![Page 23: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/23.jpg)
Transitive closure corresponding to paths of length d passing through
set of witnesses W
u
v
w
M
![Page 24: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/24.jpg)
Handling Edge Deletion
u
v
w
u vw
W’
M
![Page 25: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/25.jpg)
Handling Edge Deletion contd.
u
v
w
u vw
u vW’
W’
M
![Page 26: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/26.jpg)
Handling Edge Deletion contd.
u
v
w
u vw
u vW’
W’
M
![Page 27: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/27.jpg)
Handling Edge Deletion contd.
• For each w, update in_tree(w) and out_tree(w)
• For each pair (u,v) for which w has ceased to remain witness, search for new witness.
• Update M[u,v] appropriately
![Page 28: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/28.jpg)
Handling Edge Deletion contd.
• Invariant maintained :
M[u,v] points to the first vertex in the witness list W that is a witness of
reachability from u to v
![Page 29: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/29.jpg)
Total update time
• For each pair (u,v), the witness list is scanned exactly once.
O(n |W|)
• Total update time for maintaining in_trees
and out_trees
O(md|W|)
2
![Page 30: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/30.jpg)
Maintaining all-pairs reachability corresponding to paths of length <d
passing through W
Theorem :
All-pairs reachability corresponding to paths of length <d passing through vertices of set W can be maintained under deletion of edges in amortized time :
O((n2/m + d)W) per edge deletion
![Page 31: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/31.jpg)
Random sampling to pick the witness vertices
Theorem : Given a path puv of length l from u to v, if we sample cn/l log2 n vertices (for any c>0), then with probability 1-1/nc , at least one of the vertices will be picked from the path puv
![Page 32: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/32.jpg)
Maintaining all-pairs reachability corresponding to paths of length
[d/2,d]
• Form a set Wd of n/d log n vertices uniformly randomly.
• Build and maintain in_trees and out_trees on vertices of set Wd.
Update time : O((n3/(dm) + n)log n)
![Page 33: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/33.jpg)
Maintaining all-pairs reachability corresponding to paths of length
[d,n]
• For each interval [2id,2i+1d], build and maintain in_trees and out_trees on a collection of n/(2id) log n vertices. • Maintain the reachability matrix M Total Update time : O((n3/(dm) + n)log2 n)
![Page 34: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/34.jpg)
Comparing the two data-structures
• Explicit maintenance of transitive closure
for path of length
[1,d]
Update time :
O(nd)
• Implicit maintenance of transitive closure for paths of length
[d,n]
Update time :
O((n3/(dm)+n)log2n)
![Page 35: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/35.jpg)
Comparing the two data-structures
• Explicit maintenance of transitive closure
for path of length [1,d] Update time : O(nd)
Suitable for short paths
• Implicit maintenance of transitive closure for paths of length
[d,n] Update time : O((n3/(dm)
+n)log2n)
Suitable for long paths
![Page 36: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/36.jpg)
Improved algorithm for transitive closure
Previous New
Update time O(n3/2) O(n4/3)
Source Leeuwen et al. (1988) and Demetrescu (FOCS 2000)
![Page 37: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/37.jpg)
Improved Decremental Algorithm for maintaining all-
pairs 2-approximate paths
![Page 38: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/38.jpg)
u
v
w
![Page 39: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/39.jpg)
• Invariant maintained :
M[u,v] points to the first vertex in the witness list W that is a witness of
reachability from u to v
![Page 40: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/40.jpg)
Improved update bounds for maintaining 2-approximate
APSPPrevious New
Update time per edge deletion none O(n2/m)
![Page 41: Improved Decremental Algorithms for](https://reader031.vdocuments.us/reader031/viewer/2022012919/56814fb3550346895dbd6c84/html5/thumbnails/41.jpg)
Improved Update bounds for maintaining exact APSP
Type of query Previous New
Report distance from u to v
O(n3m log3 n)
FOCS 2000
O(n3/m log2 n)
Report shortest path from u to v
O(n3/m log3 n)
FOCS 2000
Min(n3/m log2n,
n1.5 log n)