CCCG 2013, Waterloo, Ontario, August 8–10, 2013 Planar Convex Hull Range Query and Related Problems Nadeem Moidu * Jatin Agarwal † Kishore Kothapalli ‡ Abstract We consider the planar convex hull range query prob- lem. Let P be a set of points in the plane. We prepro- cess these points into a data structure such that given an orthogonal range query, we can report the convex hull of the points in the range in O(log 2 n + h) time, where h is the size of the output. The data structure uses O(n log n) space. This improves the previous bound of O(log 5 n + h) time and O(n log 2 n) space. Given a range query, it also supports extreme points in a given direc- tion, tangent queries through a given point, and line-hull intersection queries on the points in the range in time O(log 2 n) for each orthogonal query and O(log n) time for each additional query on that range. These problems have not been studied before. 1 Introduction Planar convex hull is a well studied topic in computa- tional geometry. Let P be a set of n points on the plane. Overmars and van Leeuwen gave a data structure which allows insertions and deletions in P in O(log 2 n) time and reporting of points on the hull in O(log n + h) time, where h is the number of points on the hull [7]. Instead of supporting reporting of the entire hull, recent works provide data structures to support common queries on the convex hull, CH(P ), without actually computing it. The following queries are typically studied: 1. Extreme point query : Find the most extreme vertex in CH(P ) along a query direction 2. Tangent query : Find the two vertices of CH(P ) that form tangents with a query point outside the hull 3. Line stabbing query : Find the intersection of CH(P ) with an arbitrary query line These queries can be supported in O(log n) time by the structure of Overmars and van Leeuwen [7]. Brodal and Jacob gave a solution which supports insertions and deletions in O(log n) amortized time and the first two queries in O(log n) time without actually computing the hull [3]. Chan gave a data structure which supports the * nadeem.moiduug08@students.iiit.ac.in † jatin.agarwal@research.iiit.ac.in ‡ kkishore@iiit.ac.in third query in O(log 3/2 n) time [4] and later improved it to O(log 1+ǫ n) time [6]. In this paper, we study the orthogonal range query versions of the above problems. Given an orthogonal range query of the form q =[x low ,x high ] × [y low ,y high ], we support the above queries for the points in P ∩ q. Brass et al. first gave a solution to report the convex hull of an orthogonal range in O(log 5 n + h) time in [2]. The other problems are being studied for the first time but the data structure in [2] can be enhanced to support these queries in O(log 5 n) time per orthogonal range query and an additional O(log 2 n) time for any of the above queries. Our data structure takes O(log 2 n) time to process one orthogonal range query. Once this is done, we can report the points on the hull of P ∩ q in O(h) time and any of the above queries in O(log n) time. 2 Overview In a standard two dimensional range tree, a query is di- vided vertically into O(log n) rectangular regions where each region corresponds to a canonical node in the pri- mary tree. Each of these primary regions are further divided horizontally into O(log n) regions correspond- ing to canonical nodes in the secondary tree. However, these horizontally divided regions are independent of each other, i.e. they correspond to different intervals in different primary regions. In our data structure we modify the secondary trees such that, for a given query, the horizontal divisions are same across all canonical primary node regions. So an orthogonal query is di- vided into a grid of O(log n) × O(log n) regions which are perfectly aligned as shown in figure 1. By having the divisions aligned like this, we are able to discard a large number of regions which do not contribute to the final hull without processing them. This idea is similar to the method used by Abam et al. to enhance kinetic kd-trees in [1]. 3 Data Structure Let P be a static set of points on a plane. We construct a one dimensional range tree, T y of all the points based on their y coordinates. We call this the template tree. Given a subset S of the point set P , the contracted tree of T y with respect to S is defined as the tree obtained