In this paper we consider the dynamic vertical ray shooting problem, that is the task of maintaining a dynamic set S of n non intersecting horizontal line segments in the plane subject to a query that reports the first segment in S intersecting a vertical ray from a query point. We develop a linearsize structure that supports queries, insertions and deletions in O(log n) worst-case time. Our structure works in the comparison model and uses a RAM .
IntroductionIn this paper we consider data structures for the dynamic vertical ray shooting problem. In this problem we maintain a dynamic set S of n non intersecting horizontal line segments in the plane such that we can efficiently report the segment in S immediately above a given point. The vertical ray shooting problem is in fact a version of the dynamic rectilinear planar point location problem. In particular, given a subdivision of the plane by horizontal and vertical line segments, our data structure allows to find the rectangle containing a query point. The dynamic rectilinear planar point location problem is a special case of the general dynamic planar point location problem in which segments are not restricted to be horizontal or vertical. Obtaining a linear space data structure with logarithmic query and update time for dynamic planar point location is a central open question in algorithms and computational geometry. Although the restriction of segments to be horizontal is strong, an optimal algorithm for this special case was not known prior to our work.We present a data structure in the RAM model of computation, that requires linear space and supports updates and queries in O(log n) worst-case time. Our data structure does not make any assumptions on the segments. That is, we manipulate the segments only by comparisons. In this sense our result is optimal, since by an easy reduction from sorting, at least one of the operations takes Ω(log n) time.