Skip to main content

Reporting and Counting Intersections Between Two Sets of Line Segments

  • Conference paper
Theoretical Foundations of Computer Graphics and CAD

Part of the book series: NATO ASI Series ((NATO ASI F,volume 40))

Abstract

We consider the problem of computing all intersections between two sets S and T of line segments in the plane, where no two segments in S (similarly, T) intersect. We present an asymptotically optimal algorithm which reports all those intersections in O(n log n + k) time and O(n) space, where n is the total number of line segments, and k is the number of intersections. Our algorithm works also for general arcs of single-valued curves, within the same time bounds. Applications include the intersection of two polygons and the “merge” of two planar maps in time O(n log n + m) and space O(n + m), where n and m are the number of input and output edges, respectively. In the case of straight line segments, a simple modification allows us to count the number of intersections (without reporting them) in time O((n +√ nk)log n) = O(n 1.5log n).

The work of this author was partially supported by Xerox PARC, the University of São Paulo, and the Brazilian Science and Technology Development Council (CNPq).

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. A. V. Aho, J. E. Hopcroft, and J. D. Ullman: The design and analysis of computer algorithms. Addison-Wesley, Reading (1974).

    MATH  Google Scholar 

  2. B. G. Baumgart: A polyhedron representation for computer vision. Proc. of the AFIPS National Computer Conference vol. 44 (1975), 589–596.

    Google Scholar 

  3. J. L. Bentley and Th. A. Ottman: Algorithms for reporting and counting geometric intersections. IEEE Transactions on Computers, vol. C-28 no. 9 (Sept. 1979), 643–647.

    Article  Google Scholar 

  4. J. L. Bentley and D. Wood: An optimal worst-case algorithm for reporting intersections of rectangles. IEEE Transactions on Computers, vol. C-29 no. 7 (July 1980), 571–577.

    Article  MathSciNet  Google Scholar 

  5. B. Chazelle: Reporting and counting arbitrary planar intersections. Technical Report CS-83-16, Department of Computer Science, Brown University (June 1983). Submitted to the Journal of Algorithms.

    Google Scholar 

  6. D. P. Dobkin: Personal communication.

    Google Scholar 

  7. D. Greene and F. Frances Yao: Finite-resolution computational geometry. Manuscript (1986).

    Google Scholar 

  8. L. J. Guibas and J. B. Saxe: Problem 80-15: Computing the connected components of a collection of rectangles. Journal of algorithms vol. 1 (1980), 212, and vol. 4 (1983), 177–181.

    Google Scholar 

  9. L. J. Guibas and R. Seidel: Computing convolutions by reciprocal search. Proc. 2nd ACM Symp. on Computational Geometry (1986), 90–99.

    Google Scholar 

  10. L. J. Guibas and M. Sharir: Computing the unbounded component of an arrangement of line segments. Manuscript (Jan. 1987).

    Google Scholar 

  11. L. J. Guibas and J. Stolfi: Notes on computational geometry. CS445 lecture notes, CS Department, Stanford University (Winter 1982).

    Google Scholar 

  12. D. E. Knuth: The Art of Computer Programming, vol I: Fundamental Algorithms (2nd edition). Addison-Wesley (1973).

    Google Scholar 

  13. H. G. Mairson: Reporting line segment intersections. Manuscript (1981).

    Google Scholar 

  14. E. M. McCreight: Efficient algorithms for enumerating intersecting intervals and, rectangles. Report CSL 80–9, Xerox Palo Alto Research Center (June 1980).

    Google Scholar 

  15. S. Mowchenko: Ph. D. Thesis. Department of Electrical Engineering, University of Waterloo, Ontario, Canada.

    Google Scholar 

  16. D. E. Muller and F. P. Preparata: Finding the intersection of two convex poly-hedra. Theoretical Computer Science vol. 7 (1978), 217–236.

    Article  MATH  MathSciNet  Google Scholar 

  17. J. Nievergelt and F. P. Preparata: Plane-sweep algorithms for intersecting geo metric figures. Communications of the ACM vol. 25 no. 10 (Oct. 1982), 739–747.

    Article  MATH  Google Scholar 

  18. E. M. Reingold: On the optimality of some set algorithms. Journal of the ACM vol. 19 no. 4 (Oct. 1972), 649–659.

    Article  MATH  MathSciNet  Google Scholar 

  19. M. I. Shamos and D. Hoey: Geometric intersection problems. Proc. of the 17th IEEE Symp. on Foundations of Computer Science (1976), 208–215.

    Google Scholar 

  20. D. D. Sleator and R. E. Tarjan: Self-adjusting binary trees. Proc. of the 15th ACM Symp. on Theory of Computing (1983), 235–245.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1988 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Mairson, H.G., Stolfi, J. (1988). Reporting and Counting Intersections Between Two Sets of Line Segments. In: Earnshaw, R.A. (eds) Theoretical Foundations of Computer Graphics and CAD. NATO ASI Series, vol 40. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-83539-1_11

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-83539-1_11

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-83541-4

  • Online ISBN: 978-3-642-83539-1

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics