Summary: E#cient Tree Layout in a Multilevel Memory Hierarchy #
Stephen Alstrup + Michael A. Bender # Erik D. Demaine §
Martin FarachColton ¶ Theis Rauhe + Mikkel Thorup #
December 9, 2003
We consider the problem of laying out a tree with fixed parent/child structure in
hierarchical memory. The goal is to minimize the expected number of block transfers
performed during a search along a roottoleaf path, subject to a given probability
distribution on the leaves. This problem was previously considered by Gil and Itai,
who developed optimal but slow algorithms when the blocktransfer size B is known.
We present faster but approximate algorithms for the same problem; the fastest such
algorithm runs in linear time and produces a solution that is within an additive constant
In addition, we show how to extend any approximately optimal algorithm to the
cacheoblivious setting in which the blocktransfer size is unknown to the algorithm.
The query performance of the cacheoblivious layout is within a constant factor of
the query performance of the optimal knownblocksize layout. Computing the cache
oblivious layout requires only logarithmically many calls to the layout algorithm for
known block size; in particular, the cacheoblivious layout can be computed in O(N lg N)
time, where N is the number of nodes.