Abstract
In a virtual memory system, the address space is partitioned into pages, and main memory serves as a cache to the disk. The problem we address is: Given a tree T, find a packing, an allocation of its nodes to pages, which optimizes the cache performance. We investigate a model for tree access in which a node is accessed only via the path leading to it from the root. Two cost functions are considered: the total number of different pages visited in the search, and the number of page faults incurred. It is shown that both functions can be optimized simultaneously. An efficient dynamic programming algorithm to find an optimal packing is presented. The problem of finding an optimal packing which also uses the minimum number of pages, is shown to be NP-complete. However, an efficient approximation algorithm is presented. This algorithm finds a packing that uses the minimum number of pages, and requires at most one extra page fault per search. Finally, we study dynamic trees which allow insertions and deletions.
Preview
Unable to display preview. Download preview PDF.
References
A. Aggarwal, B. Alpern, A. K. Chandra, and M. Snir. A model for hierarchical memory. In Proceedings of the 19th Annual Symposium on Computing, pages 305–314, New York, 1987.
A. V. Aho, R. Sethi, and J. D. Ullman. Compilers: principles, techniques, and tools. Addison-Wesley, Reading, Massachusetts, 1988.
T. Cormen, C. Leiserson, and R. Rivest. Introduction to Algorithms. McGraw Hill and The MIT Press, 1990.
B. Farizon. Local and global memory for the implementation of ray tracing on a parallel machine. Master's thesis, Computer Science Dept., Technion — Israel Institute of Technology, 1995.
J. D. Foley and A. V. Dam. Fundamental of Interactive Computer Graphics. The Systems Programming Series. Addison-Wesley, Reading, Massachusetts, 1984.
S. Gal, Y. Hollander, and A. Itai. Optimal mappings in a direct mapped cache environment. Math. Programming B, 63:371–387, 1994.
M. R. Garey and D. S. Johnson. Computers and Intractability, A Guide to the Theory of NP-Completeness. W.H. Freeman and Company, 1979.
C. F. Goldfarb. The SGML Handbook. Clarendon Press, Oxford, 1990.
M. S. Lam, E. Rothberg, and M. E. Wolf. The cache performance and optimizations of blocked algorithms. In Fourth International Conference on Architectural Support for Programming Languages and Operation Systems (ASPLOS IV), 1991.
M. E. Wolf and M. S. Lam. A data locality optimizing algorithm. In Proceedings of the ACM SIGPLAN'91 Conference on Programming Language Design and Implementation, 1991.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1995 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Gil, J., Itai, A. (1995). Packing trees. In: Spirakis, P. (eds) Algorithms — ESA '95. ESA 1995. Lecture Notes in Computer Science, vol 979. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-60313-1_138
Download citation
DOI: https://doi.org/10.1007/3-540-60313-1_138
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-60313-9
Online ISBN: 978-3-540-44913-3
eBook Packages: Springer Book Archive