Overview
Bentley-Ottmann sweeps across segment endpoints and discovered intersections, maintaining the vertical order of active segments.
Finds all line segment intersections with a sweep line and event queue.
Compact metadata for implementation and discovery.
Bentley-Ottmann sweeps across segment endpoints and discovered intersections, maintaining the vertical order of active segments.
Quick facts
Runtime and memory behavior at a glance.
Best
O((n + k) log n)
Average
O((n + k) log n)
Worst
O((n + k) log n)
Space
O(n + k)
process events by increasing x, then by event type and yKeeps the sweep state deterministic around endpoints and intersections.
Show a vertical sweep line moving across segments while active neighbors swap at intersections.
Robust event ordering is difficult when segments overlap or share endpoints.
What each reference supports for this entry.
Computational geometry textbook support for Bentley-Ottmann Algorithm's geometric model, data structures, and robustness concerns.
Open sourceOriginal reference for reporting and counting geometric intersections using sweep-line status.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
It detects and orders segment intersection events.
Bentley-Ottmann is a sweep-line algorithm for segment intersections.