Abstract
In this paper we generalize a technique used by La Poutré and van Leeuwen in [14] for updating the transitive closure and the transitive reduction of a dag, and propose a uniform approach to deal with semi-dynamic problems on dags. We define a propagation property on a binary relationship as a simple sufficient condition to apply this approach. The proposed technique is suitable for a very simple implementation which does not depend on the particular problem; in other words, the same procedures can be used to deal with different problems on dags by simply setting appropriate border conditions.
In particular we provide semi-dynamic algorithms and data structures for maintaining a binary relationship defined over the vertices of a dag with n vertices and m edges, requiring O(n(q+m)) total time, for any sequence of q edge insertions (deletions). This gives O(n) amortized time per operation over a sequence of Ω(m) edge insertions (deletions). Queries can be answered in constant time. The space required is O(n 2).
We apply the proposed technique to various problems about dominance, providing the first known incremental and decrementai solutions for maintaining the dominance relationship, the dominator tree, and the nearest common dominator of a dag.
Partially supported by EU ESPRIT Long Term Research Project ALCOM-IT under contract no.20244, and by Progetto Finalizzato Trasporti 2 (PFT 2) of the Italian National Research Council (CNR).
Preview
Unable to display preview. Download preview PDF.
References
A. V. Aho, R. Sethi, and J. D. Ullman. Compilers, Principles, Techniques, and Tools. Addison-Wesley, 1986.
G. Ausiello, G. F. Italiano, A. Marchetti Spaccamela, and U. Nanni. Incremental algorithms for minimal length paths. Journal of Algorithms, 12(4):615–638, 1991.
G. Ausiello and M. Scasso. Algoritmos para mantener dinamicamente clausura transitiva y arbol de dominadores en grafos aciclicos dirigidos. Technical report, Buenos Aires, November 1989.
M. D. Carrol and B. G. Ryder. Incremental dataflow update via attribute and dominator update. In ACM Symposium on Principles of Programming Languages., pages 274–284, 1988.
J. Chu. Optimal algorithms for the nearest common dominator problem. Journal of Algorithms, 13:693–697, 1992.
M. J. Chung and M. S. Krishnamoorthy. Algorithms for placing recovery points. Information Processing Letters, 28:177–181, 1988.
R. Cytron, J. Ferrante, B. K. Rosen, M. N. Wegman, and K. Zadeck. Efficiently computing static single assignment form and the control dependence graph. ACM Transactions on Programming Languages and Systems, 13(4):451–490, 1991.
F. Harary. Graph Theory. Addison-Wesley, Reading, MA, 1969.
D. Harel. A linear time algorithm for finding dominators in flow graphs and related problems. In ACM Symposium on Theory of Computing, pages 185–194, 1985.
D. Harel and R. E. Tarjan. Fast algorithms for finding nearest common ancestors. SIAM Journal on Computing, 13(2):338–355, 1984.
G. F. Italiano. Amortized efficiency of a path retrieval data structure. Theoretical Computer Science, 48:273–281, 1986.
G. F. Italiano. Finding paths and deleting edges in directed acyclic graphs. Information Processing Letters, 28:5–11, 1988.
P. N. Klein, S. Rao, M. Rauch, and S. Subramanian. Faster shortest-path algorithms for planar graphs. In ACM Symposium on Theory of Computing, pages 27–37, Montreal, Quebec, Canada, 1994.
J. A. La Poutré and J. van Leeuwen. Maintenance of transitive closure and transitive reduction of graphs. In International Workshop on Graph-Theoretic Concepts in Computer Science, pages 106–120. Lect. Notes in Comp. Sci., 314, 1988.
T. Lengauer and R. E. Tarjan. A fast algorithm for finding dominators in a flowgraph. ACM Transactions on Programming Languages and Systems, 1(1):121–141, 1979.
S. R. Pawagi and I. V. Ramakrishnan P. S. Gopalakrishnan. Computing dominators in parallel. Information Processing Letters, 24:217–221, 1987.
G. Ramalingam and T. Reps. An incremental algorithm for maintaining the dominator tree of a reducible flowgraph. In ACM Symposium on Principles of Programming Languages., pages 287–296, 1994.
S. Subramanian. A fully dynamic data structure for reachability in planar digraphs. In Proc. of ESA '93, pages 372–383. Lecture Notes in Comp. Sci., 726, 1993.
R. E. Tarjan. Finding dominators in directed graphs, SIAM Journal on Computing, 3(1):62–89, 1974.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1997 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Cicerone, S., Frigioni, D., Nanni, U., Pugliese, F. (1997). Counting edges in a dag. In: d'Amore, F., Franciosa, P.G., Marchetti-Spaccamela, A. (eds) Graph-Theoretic Concepts in Computer Science. WG 1996. Lecture Notes in Computer Science, vol 1197. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-62559-3_9
Download citation
DOI: https://doi.org/10.1007/3-540-62559-3_9
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-62559-9
Online ISBN: 978-3-540-68072-7
eBook Packages: Springer Book Archive