How to pack trees

Authors
Citation
J. Gil et A. Itai, How to pack trees, J ALGORITHM, 32(2), 1999, pp. 108-132
Citations number
11
Categorie Soggetti
Computer Science & Engineering
Journal title
JOURNAL OF ALGORITHMS
ISSN journal
01966774 → ACNP
Volume
32
Issue
2
Year of publication
1999
Pages
108 - 132
Database
ISI
SICI code
0196-6774(199908)32:2<108:HTPT>2.0.ZU;2-T
Abstract
In a virtual memory system, the address space is partitioned into pages, an d the main memory serves as a cache to the disk. In this setting, we addres s the following problem: Given a tree, find an allocation of its nodes to p ages, so-called a packing, which optimizes the cache performance for some a ccess 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 bo th functions can be optimized simultaneously. An efficient dynamic programm ing algorithm to find an optimal packing is presented. The problem of findi ng an optimal packing which also uses the minimum number of pages is shown to be NP-complete. However, an efficient approximation algorithm is present ed. This algorithm finds a packing that uses the minimum number of pages an d requires at most one extra page fault per search. Finally, we study this problem in the context of dynamic trees which allow insertions and deletion s. (C) 1999 Academic Press.