Packing trees

  • Joseph Gil
  • Alon Itai
Session 2. Chair: Josep Diaz
Part of the Lecture Notes in Computer Science book series (LNCS, volume 979)


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.


Binary Tree Optimal Packing Page Fault Cache Performance Space Consumption 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    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.Google Scholar
  2. 2.
    A. V. Aho, R. Sethi, and J. D. Ullman. Compilers: principles, techniques, and tools. Addison-Wesley, Reading, Massachusetts, 1988.Google Scholar
  3. 3.
    T. Cormen, C. Leiserson, and R. Rivest. Introduction to Algorithms. McGraw Hill and The MIT Press, 1990.Google Scholar
  4. 4.
    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.Google Scholar
  5. 5.
    J. D. Foley and A. V. Dam. Fundamental of Interactive Computer Graphics. The Systems Programming Series. Addison-Wesley, Reading, Massachusetts, 1984.Google Scholar
  6. 6.
    S. Gal, Y. Hollander, and A. Itai. Optimal mappings in a direct mapped cache environment. Math. Programming B, 63:371–387, 1994.Google Scholar
  7. 7.
    M. R. Garey and D. S. Johnson. Computers and Intractability, A Guide to the Theory of NP-Completeness. W.H. Freeman and Company, 1979.Google Scholar
  8. 8.
    C. F. Goldfarb. The SGML Handbook. Clarendon Press, Oxford, 1990.Google Scholar
  9. 9.
    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.Google Scholar
  10. 10.
    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.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1995

Authors and Affiliations

  • Joseph Gil
    • 1
  • Alon Itai
    • 1
  1. 1.Department of Computer ScienceTechnion - Israel Institute of TechnologyHaifaIsrael

Personalised recommendations