ISAAC 2008: Algorithms and Computation pp 704-715

Computing Frequency Dominators and Related Problems

Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5369)

Abstract

We consider the problem of finding frequency dominators in a directed graph with a single source vertex and a single terminal vertex. A vertex x is a frequency dominator of a vertex y if and only if in each source to terminal path, the number of occurrences of x is at least equal to the number of occurrences of y. This problem was introduced in a paper by Lee et al. [11] in the context of dynamic program optimization, where an efficient algorithm to compute the frequency dominance relation in reducible graphs was given. In this paper we show that frequency dominators can be efficiently computed in general directed graphs. Specifically, we present an algorithm that computes a sparse (O(n)-space), implicit representation of the frequency dominance relation in O(m + n) time, where n is the number of vertices and m is the number of arcs of the input graph. Given this representation we can report all the frequency dominators of a vertex in time proportional to the output size, and answer queries of whether a vertex x is a frequency dominator of a vertex y in constant time. Therefore, we get the same asymptotic complexity as for the regular dominators problem. We also show that, given our representation of frequency dominance, we can partition the vertex set into regions in O(n) time, such that all vertices in the same region have equal number of appearances in any source to terminal path. The computation of regions has applications in program optimization and parallelization.

References

1. 1.
Aho, A.V., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques, and Tools. Addison-Wesley, Reading (1986)
2. 2.
Alstrup, S., Husfeldt, T., Rauhe, T.: Marked ancestor problems. In: Proc. 39th IEEE Symp. on Foundations of Computer Science, p. 534Google Scholar
3. 3.
Ball, T.: What’s in a region?: or computing control dependence regions in near-linear time for reducible control flow. ACM Lett. Program. Lang. Syst. 2(1-4), 1–16 (1993)
4. 4.
Buchsbaum, A.L., Georgiadis, L., Kaplan, H., Rogers, A., Tarjan, R.E., Westbrook, J.R.: Linear-time algorithms for dominators and other path-evaluation problems. SIAM Journal on Computing (to appear), http://arxiv.org/abs/cs.DS/0207061
5. 5.
Carter, L., Ferrante, J., Thomborson, C.: Folklore confirmed: reducible flow graphs are exponentially larger. In: Proc. 30th ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages, pp. 106–114 (2003)Google Scholar
6. 6.
Gabow, H.N., Bentley, J.L., Tarjan, R.E.: Scaling and related techniques for geometry problems. In: Proc. 16th ACM Symp. on Theory of Computing, pp. 135–143 (1984)Google Scholar
7. 7.
Gabow, H.N., Tarjan, R.E.: A linear-time algorithm for a special case of disjoint set union. Journal of Computer and System Sciences 30(2), 209–221 (1985)
8. 8.
Georgiadis, L., Tarjan, R.E.: Finding dominators revisited. In: Proc. 15th ACM-SIAM Symp. on Discrete Algorithms, pp. 862–871 (2004)Google Scholar
9. 9.
Georgiadis, L., Tarjan, R.E., Werneck, R.F.: Finding dominators in practice. Journal of Graph Algorithms and Applications (JGAA) 10(1), 69–94 (2006)
10. 10.
Johnson, R., Pearson, D., Pingali, K.: The program structure tree: computing control regions in linear time. SIGPLAN Not 29(6), 171–185 (1994)
11. 11.
Lee, B., Resnick, K., Bond, M.D., McKinley, K.S.: Correcting the dynamic call graph using control-flow constraints. In: Krishnamurthi, S., Odersky, M. (eds.) CC 2007. LNCS, vol. 4420, pp. 80–95. Springer, Heidelberg (2007); Full paper appears as technical report TR-06-55, The University of Texas at Austin, Department of Computer Sciences (2006)
12. 12.
Lengauer, T., Tarjan, R.E.: A fast algorithm for finding dominators in a flowgraph. ACM Transactions on Programming Languages and Systems 1(1), 121–141 (1979)
13. 13.
Tarjan, R.E.: Depth-first search and linear graph algorithms. SIAM Journal on Computing 1(2), 146–159 (1972)
14. 14.
Tarjan, R.E.: Testing flow graph reducibility. In: Proceedings of the Fifth Annual ACM Symposium on Theory of Computing, pp. 96–107 (1973)Google Scholar
15. 15.
Tarjan, R.E.: Efficiency of a good but not linear set union algorithm. Journal of the ACM 22(2), 215–225 (1975)
16. 16.
Tarjan, R.E.: Edge-disjoint spanning trees and depth-first search. Acta Informatica 6(2), 171–185 (1976)
17. 17.
Tarjan, R.E., van Leeuwen, J.: Worst-case analysis of set union algorithms. Journal of the ACM 31(2), 245–281 (1984)
18. 18.
Zhang, L.: Personal communication (2008)Google Scholar