Download An Edge Quadtree for External Memory

Transcript
Quadtrees in the i/o-model were described by Agarwal et al. [1] and De
Berg et al. [4]. Agarwal et al. describe an algorithm for constructing a quadtree
on a set of n vertices in the plane such that each cell contains O(k) vertices
n
h
(for any k ≥ 1), that runs in O( B
log M/B ) i/o’s, where h is the height of the
quadtree. This is O(sort(n)) i/o’s when h = O(log n) i.e. the vertices are nicely
distributed. Their algorithm was implemented and tested in practice as part of
an application to interpolate LIDAR datasets into grids. De Berg et al. described
the star-quadtree for triangulations, and the guard-quadtree for sets of edges in
the plane, which contain at most one vertex per cell and can be constructed in
O(sort(n + l)) i/o’s, where l = O(n2 ) is the number of edge-cell intersections.
The star- and guard-quadtrees are designed to exploit fatness and density: for fat
triangulations3 and sets of edges of low density4 , respectively, the star-quadtree
and guard-quadtree have the property that each cell intersects O(1) edges, thus
l = O(n). An experimental evaluation of these structures has not been reported.
Our Contribution. We consider building an edge quadtree for a set E of
n non-intersecting edges. Let k ≥ 1 be a user defined parameter. Our algorithm
has two steps: First it builds, in O(sort(n)) i/o’s, a compressed linear quadtree
on the endpoints of E with O(n/k) cells in total and such that each cell has
O(k) vertices. Second, it computes the intersections between the edges and the
quadtree subdivision in O(sort(n + l)) i/o’s (where l = O(n2 /k) is the total
number of intersections). We refer to the resulting quadtree as a K-quadtree.
The first step, constructing the quadtree subdivision, is a generalization of
the algorithm for building guard-quadtrees in [4]. Compared to the algorithm
by Agarwal et al. [1], our algorithm has better complexity, is much simpler, and
gives an upper bound on the number of cells in the subdivision. The second step,
which we refer to as edge distribution, is based on an idea communicated to us
by Doron Nussbaum. For k = 1 the algorithm has the same complexity as in [4],
but it is simpler and faster.
In Section 4 we give an empirical evaluation of K-quadtrees on triangulated
terrains (in GIS: TINs) and USA TIGER data. We examine the size of the
quadtree, the size of a cell and the construction time for different values of k.
We use test datasets up to 427 million edges, two orders of magnitude larger than
in related work [7, 6, 8]. On TINs and TIGER data the K-quadtrees have linear
size, which matches the results of [9, 7, 6, 8]. In terms of construction time (or
bulk loading), a comparison with previous work is difficult. The running times
in [9] are given in terms of disk block accesses, not the total execution time. The
tests in [7, 6, 8] are performed on three TIGER data sets, the largest one having
approx. 200, 000 edges, on a machine with 64MB RAM. Our largest TIGER
bundle has 427 million edges (6.8 GB), and we use machines with 512MB RAM.
Furthermore a precise comparison is not possible without knowing all the tuning
parameters used in [8].
3
4
A triangulation such that every angle is larger than some fixed positive constant δ
Any disk D is intersected by at most λ edges whose length is at least the diameter
of D, for some fixed constant λ.