A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria...
-
Upload
rosa-sharon-ball -
Category
Documents
-
view
214 -
download
0
Transcript of A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria...
![Page 1: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/1.jpg)
A Batch Algorithm for Maintaining a Topological Order
David J. Pearce and Paul H.J. Kelly
Victoria University of Wellington,New Zealand
& Imperial College, London
![Page 2: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/2.jpg)
Topological Orders
1
23
4
76
8
5
9
![Page 3: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/3.jpg)
Topological Orders
2 3 4 5 6 7 81 9
1
23
4
76
8
5
9
![Page 4: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/4.jpg)
Updating Topological Orders
1
23
4
76
8
5
9
2 3 4 5 6 7 81 9
![Page 5: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/5.jpg)
Updating Topological Orders
2 3 4 5 6 7 81 9
Affected Region
1
23
4
76
8
5
9
![Page 6: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/6.jpg)
Updating Topological Orders
2 3 4 5 6 7 81 9
Affected Region
![Page 7: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/7.jpg)
Updating Topological Orders
Unit Change Problem
2 3 4 5 6 7 81 92004: Pearce, et al.
1990: Alpern, et al.
1996: Marchetti-Spaccamela, et al.
2006: Ajwani, et al.
2009: Bender, et al.
2008: Haeupler, et al.
2005: Katriel, et al.
2007: Liu, et al.
![Page 8: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/8.jpg)
1
23
4
76
8
5
9
1 2 3 4 5 6 7 8 9
![Page 9: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/9.jpg)
1
23
4
76
8
5
9
1 2 3 4 5 6 7 8 9
![Page 10: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/10.jpg)
1
23
4
76
8
5
9
1 2 3 45 6 7 8 9
1 2 3 4 5 6 7 8 9
![Page 11: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/11.jpg)
1
23
4
76
8
5
9
1 2 3 45 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 45 6 7 89
![Page 12: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/12.jpg)
Batch Problem
Definition: Given a batch of edge insertions, update the topological order
Q) Can we do better than by processing them one at a time?
![Page 13: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/13.jpg)
Batch Problem
Definition: Given a batch of edge insertions, update the topological order
Q) Can we do better than by processing them one at a time?
A) Yes!
![Page 14: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/14.jpg)
Previous MNR Algorithm
2 3 4 5 6 7 81 9
Discovery – DFS to identify nodes reachable from tail in affected region
![Page 15: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/15.jpg)
Previous MNR Algorithm
2 3 4 5 6 7 81 9
Discovery – DFS to identify nodes reachable from tail in affected region
![Page 16: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/16.jpg)
Previous MNR Algorithm
2 3 4 5 6 7 81 9
Discovery – DFS to identify nodes reachable from tail in affected region
![Page 17: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/17.jpg)
Previous MNR Algorithm
2 3 4 5 6 7 81 9
Discovery – DFS to identify nodes reachable from tail in affected region
![Page 18: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/18.jpg)
Previous MNR Algorithm
2 3 4 5 6 7 81 9
Discovery – DFS to identify nodes reachable from tail in affected region
![Page 19: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/19.jpg)
Previous MNR Algorithm
2 3 4 5 6 7 81
9
Shift – marked nodes up the order, unmarked nodes down the order (in affected region)
![Page 20: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/20.jpg)
Previous MNR Algorithm
2 3 4 5 6 7 81
9
Shift – marked nodes up the order, unmarked nodes down the order (in affected region)
![Page 21: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/21.jpg)
Previous MNR Algorithm
2 3 4 5 6 7 81
9
Shift – marked nodes up the order, unmarked nodes down the order (in affected region)
![Page 22: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/22.jpg)
Previous MNR Algorithm
2 3 4 5 6 7 81
9
Shift – marked nodes up the order, unmarked nodes down the order (in affected region)
![Page 23: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/23.jpg)
Previous MNR Algorithm
2 3 45 6 7 81
9
Shift – marked nodes up the order, unmarked nodes down the order (in affected region)
![Page 24: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/24.jpg)
Previous MNR Algorithm
2 3 45 6 7 81
9
Shift – marked nodes up the order, unmarked nodes down the order (in affected region)
![Page 25: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/25.jpg)
MNR Algorithm
2 3 45 6 7 81 9
Shift – marked nodes up the order, unmarked nodes down the order (in affected region)
![Page 26: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/26.jpg)
Our Novel Batch Algorithm
Observation – edge insertions which overlap can be processed independently of others
![Page 27: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/27.jpg)
Our Novel Batch Algorithm
Observation – edge insertions which overlap can be processed independently of others
Affected Region Affected Region
![Page 28: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/28.jpg)
Our Novel Batch Algorithm
Discovery – identify “target node” for each node reachable from an insertion in affected region
45 67 2 13
![Page 29: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/29.jpg)
Our Novel Batch Algorithm
Discovery – identify “root node” for each node reachable from an insertion in affected region
45 67 2 13
![Page 30: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/30.jpg)
Our Novel Batch Algorithm
Discovery – identify “root node” for each node reachable from an insertion in affected region
45 67 2 13
![Page 31: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/31.jpg)
Our Novel Batch Algorithm
Discovery – identify “root node” for each node reachable from an insertion in affected region
45 67 2 134 44
![Page 32: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/32.jpg)
Our Novel Batch Algorithm
Discovery – identify “root node” for each node reachable from an insertion in affected region
45 67 2 134 44 1 1
![Page 33: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/33.jpg)
Our Novel Batch Algorithm
Shift – marked nodes up order and unmarked nodes down order; marked nodes moved just past their target
45 67 2 134 44 1 1
![Page 34: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/34.jpg)
Our Novel Batch Algorithm
Shift – marked nodes up order and unmarked nodes down order; marked nodes moved just past their target
45 6
7
2 134 4
4
1 1
![Page 35: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/35.jpg)
Our Novel Batch Algorithm
Shift – marked nodes up order and unmarked nodes down order; marked nodes moved just past their target
45 6
7
2 134 4
4
1 1
![Page 36: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/36.jpg)
Our Novel Batch Algorithm
Shift – marked nodes up order and unmarked nodes down order; marked nodes moved just past their target
45 6
7 2
134 4
4 1
1
![Page 37: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/37.jpg)
Our Novel Batch Algorithm
Shift – marked nodes up order and unmarked nodes down order; marked nodes moved just past their target
45 6
7 2
134 4
4 1
1
![Page 38: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/38.jpg)
Our Novel Batch Algorithm
Shift – marked nodes up order and unmarked nodes down order; marked nodes moved just past their target
45 6
7 2
1
3
4 4
4 1 1
![Page 39: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/39.jpg)
Our Novel Batch Algorithm
Shift – marked nodes up order and unmarked nodes down order; marked nodes moved just past their target
45 6
7 2
1
3
4 4
4 1 1
![Page 40: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/40.jpg)
Our Novel Batch Algorithm
Shift – marked nodes up order and unmarked nodes down order; marked nodes moved just past their target
45 6
7
21
3
4 4
4 1
![Page 41: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/41.jpg)
Our Novel Batch Algorithm
Shift – marked nodes up order and unmarked nodes down order; marked nodes moved just past their target
45 6
7
21 34 4
4
![Page 42: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/42.jpg)
Our Novel Batch Algorithm
Shift – marked nodes up order and unmarked nodes down order; marked nodes moved just past their target
4 5 6 721 3
![Page 43: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/43.jpg)
Results on Sparse Random Graphs
![Page 44: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/44.jpg)
Results on Sparse Random Graphs
![Page 45: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/45.jpg)
Results on Denser Random Graphs
![Page 46: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/46.jpg)
Results on Denser Random Graphs
![Page 47: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/47.jpg)
Applications
• Extensions:– Incremental Cycle Detection
• Applications:– Pointer Analysis– Software Model Checking– Constraint-based Local Search
Algorithms– Dead-lock Detection– Machine Learning– Multiple Sequence Alignment
![Page 48: A Batch Algorithm for Maintaining a Topological Order David J. Pearce and Paul H.J. Kelly Victoria University of Wellington, New Zealand & Imperial College,](https://reader030.fdocuments.in/reader030/viewer/2022032518/56649cc55503460f9498e254/html5/thumbnails/48.jpg)
Conclusion
That’s all folks!