Multiple line segment intersection
Appearance
In computational geometry, the line segment intersection problem supplies a list of line segments in the plane and asks us to determine whether any two of them intersect, or cross.
Naive algorithms examine each pair of segments, but this is highly inefficient, since most pairs of segments aren't anywhere close to one another in a typical input sequence. The most common, more efficient way to solve this problem is to use a sweep line algorithm, where we imagine a line sliding across the line segments and we track which line segments it intersects at each point in time using a dynamic data structure.
References
- Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. Introduction to Algorithms, Second Edition. MIT Press and McGraw-Hill, 1990. ISBN 0262032937. Section 33.2: Determining whether any pair of segments intersects, pp.934–947.
External links
- Robert Pless. Lecture 4 notes. Washington University in St. Louis, CS 506: Computational Geometry.
- A Java applet demonstrating the sweep line algorithm for the problem.