How to Pack Trees |
| |
Authors: | Joseph Gil Alon Itai |
| |
Institution: | Department of Computer Science, Technion—Israel Institute of Technology, Technion City, Haifa, Israel, 3200 |
| |
Abstract: | In a virtual memory system, the address space is partitioned into pages, and the main memory serves as a cache to the disk. In this setting, we address the following problem: Given a tree, find an allocation of its nodes to pages, so-called a packing, which optimizes the cache performance for some access pattern to the tree nodes. 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 this problem in the context of dynamic trees which allow insertions and deletions. |
| |
Keywords: | |
本文献已被 ScienceDirect 等数据库收录! |
|