Abstract

We reconsider the problem of finding all pairwise intersections in a set of isooriented rectangles. It has been shown previously that time- and space-optimal solutions for this problem can be obtained using either the line-sweep or the divide-and-conquer paradigm. In this paper we concentrate on some practical aspects of a divide-and-conquer solution. We develop a divide-and-conquer algorithm which solves the problem directly rather than by solving two subproblems, treats special cases elegantly, and has a simple implementation. It has been noted recently that in practical applications the usual assumption that all input data fit into main memory (at the same time) is often unrealistic. This implies that algorithms with sublinear internal space requirements are needed. In the second part of this paper we show that the divide-and-conquer approach supports space-saving techniques very well. If, for instance, any vertical cross section through the set of n rectangles intersects at most c rectangles [in practice this often holds for c = O(√ n)], then our algorithm can easily be modified to run in O(c) internal space and still optimal time. Another modification permits to run the algorithm completely or partly externally. That is, the internal space requirements can be selected to be O(m), for 1 ⩽ m ⩽ n, without increasing the asymptotic time complexity or requiring “too many” disk accesses. This means that the problem can be solved efficiently even on a very small computer.

Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.