Why it matters

Line sweep is core technique. Understanding shapes computational geometry.

Advertisement

The architecture

Sort events by x.

Maintain active status structure.

Process events left-to-right.

Line sweep patternSort eventsby x-coordActive structureBBST / interval treeProcess eventssweep left-to-rightBentley-Ottmann sweep for segment intersection; sweep + PQ common combo
Line sweep.
Advertisement

How it works end to end

Events: start, end, intersection.

Active: BBST indexed by y.

PQ for future events.