Sweepline 1
Sweepline 1
Spring 2015
1 17 43
6 8 12 14 26 35 41 42 59 61
1 14 35 43
1 6 12 17 26 41 43 59
6 8 12 14 26 35 41 42 59 61
1 14 35 43
1 6 12 17 26 41 43 59
6 8 12 14 26 35 41 42 59 61
RANGE-QUERY([7, 41])
1/20/15 CMPS 3130/6130 Computational Geometry 9
Plane Sweep: An Algorithm
Design Technique
• Plane sweep algorithms (also called sweep
line algorithms) are a special kind of
incremental algorithms
• Their correctness follows inductively by
maintaining the cleanliness property
• Common runtimes in the plane are O(n log n):
– n events are processed
– Update of sweep line status takes O(log n)
– Update of event queue: O(log n) per event