Abstract
Given a set ofn iso-oriented rectangles in the plane whose sides are parallel to the coordinate axes, we consider the rectangle intersection problem, i.e., finding alls intersecting pairs. The problem is well solved in the past and its solution relies heavily on unconventional data structures such as range trees, segment trees or rectangle trees. In this paper we demonstrate that classical divide-and-conquer technique and conventional data structures such as linked lists are sufficient to achieve a time bound ofO(n logn) +s, and a space bound of Θ(n), both of which are optimal.
Similar content being viewed by others
References
M. I. Shamos, and D. Hoey, Geometric intersection problems,Proc. 17th IEEE Symp. Foundations of Computer Science, pp. 208–215 (October 1976).
J. L. Bentley and T. Ottmann, Algorithms for reporting and counting geometric intersections,IEEE Trans. Comput.,C28: 643–647 (September 1979).
K. Q. Brown, Comments on ‘Algorithms for reporting and counting geometric intersections’,IEEE Trans. Comput.,C30: 147–148 (February 1981).
J. L. Bentley and D. Wood, An optimal worst-case algorithm for reporting intersections of rectangles,IEEE Trans. Comput.,C29: 571–576 (July 1980).
J. L. Bentley, Algorithms for Klee's rectangle problem, (unpublished manuscript) Carnegie-Mellon University, 1977.
H. W. Six and D. Wood, The rectangle intersection problem revisited,BIT,20: 426–433, 1980.
V. Vaishnavi and D. Wood, Data structures for the rectangle containment and enclosure problems,Computer Graphics and Image Processing, 13: 372–384, 1980.
D. T. Lee and C. K. Wong, Finding intersection of rectangles by range search,J. Algorithms,2: 337–347, 1981.
H. Edelsbrunner, Dynamic rectangle intersection searching, Inst. for Informationsverarbeitung, TU Graz, Bericht 47 (February 1980).
J. L. Bentley, Decomposable searching problems,Info. Proc. Lett.,8: 244–251, 1979.
G. S. Lueker and D. E. Willard, A data structure for dynamic range queries,Info. Proc. Lett, 15(5): 209–213 (December 1982).
D. T. Lee and F. P. Preparata, An improved algorithm for the rectangle enclosure problem,J. Algorithms,3(3): 218–224, 1982.
H. Edelsbrunner, A time- and space-optimal solution for the planar all intersecting rectangles problem, Inst. for Informationsverarbeitung, TU Graz, Bericht 50, (April 1980).
E. M. McGreight, Efficient algorithms for enumerating intersecting intervals and rectangles, Res. Rep. CSL-80-9, Xerox PARC, Palo Alto, California, (June 1980).
D. E. Knuth,The Art of Computer Programming, Vol. 3: Sorting and Searching, Addison-Wesley, Reading, Massachusetts, 1973.
H. N. Gabow and R. E. Tarjan, A linear time algorithm for a special case of disjoint set union problem,Proc. 15th ACM Symp. Theory of Computing, pp. 246–251, (April 1983).
A. V. Aho, J. E. Hopcroft, and J. D. Ullman,The Designand Analysis of Efficient Computer Algorithms, Addison-Wesley, Reading, Massachusetts, 1974.
Author information
Authors and Affiliations
Additional information
Supported in part by the National Science Foundation under Grants MCS 8342682 and ECS 8340031.
Rights and permissions
About this article
Cite this article
Lee, D.T. An optimal time and minimal space algorithm for rectangle intersection problems. International Journal of Computer and Information Sciences 13, 23–32 (1984). https://doi.org/10.1007/BF00989481
Received:
Revised:
Issue Date:
DOI: https://doi.org/10.1007/BF00989481