Algorithms — ESA '96

Volume 1136 of the series Lecture Notes in Computer Science pp 302-319


Reporting red-blue intersections between two sets of connected line segments

  • Julien BaschAffiliated withDepartment of Computer Science, Stanford University
  • , Leonidas J. GuibasAffiliated withDepartment of Computer Science, Stanford University
  • , G. D. RamkumarAffiliated withDepartment of Computer Science, Stanford University

* Final gross prices may vary according to local VAT.

Get Access


We present a new line sweep algorithm, HeapSweep, for reporting bichromatic (‘purple’) intersections between a red and a blue family of line segments. If the union of the segments in each family is connected as a point set, HeapSweep reports all k purple intersections in time O((n+k)α(n) log 3 n), where n is the total number of input segments and α(n) is the familiar inverse Ackermann function. To achieve these bounds, the algorithm keeps only partial information about the vertical ordering between segments of the same color, using a new data structure called a kinetic queue. In order to analyze the running time of HeapSweep, we also show that a simple polygon containing a set of n line segments can be partitioned into monotone regions by lines cutting these segments Θ(n log n) times.