Bentley–Ottmann algorithm: Difference between revisions

Content deleted Content added
Overall strategy: rephrase sweep line intro
m Faster algorithms: {{log-star}}
Line 51:
The O(''n''&nbsp;log&nbsp;''n'') part of the time bound for the Bentley–Ottmann algorithm is necessary, as there are matching [[lower bound]]s for the problem of detecting intersecting line segments in [[algebraic decision tree]] models of computation.<ref>{{harvtxt|Preparata|Shamos|1985}}, Theorem 7.6, p. 280.</ref> However, the dependence on ''k'', the number of crossings, can be improved. {{harvtxt|Clarkson|1988}} and {{harvtxt|Mulmuley|1988}} both provided randomized algorithms for constructing the [[planar graph]] whose vertices are endpoints and crossings of line segments, and whose edges are the portions of the segments connecting these vertices, in expected time O(''n''&nbsp;log&nbsp;''n''&nbsp;+&nbsp;''k''), and this problem of [[arrangement of lines|arrangement]] construction was solved [[deterministic algorithm|deterministically]] in the same O(''n''&nbsp;log&nbsp;''n''&nbsp;+&nbsp;''k'') time bound by {{harvtxt|Chazelle|Edelsbrunner|1992}}. However, constructing this arrangement as a whole requires space O(''n''&nbsp;+&nbsp;''k''), greater than the O(''n'') space bound of the Bentley–Ottmann algorithm; {{harvtxt|Balaban|1995}} described a different algorithm that lists all intersections in time O(''n''&nbsp;log&nbsp;''n''&nbsp;+&nbsp;''k'') and space O(''n'').
 
If the input line segments and their endpoints form the edges and vertices of a [[connected graph]] (possibly with crossings), the O(''n''&nbsp;log&nbsp;''n'') part of the time bound for the Bentley–Ottmann algorithm may also be reduced. As {{harvtxt|Clarkson|Cole|Tarjan|1992}} show, in this case there is a randomized algorithm for solving the problem in expected time O(''n''&nbsp;log*&nbsp;''n''&nbsp;+&nbsp;''k''), where {{log*-star}} denotes the [[iterated logarithm]], a function much more slowly growing than the logarithm. A closely related randomized algorithm of {{harvtxt|Eppstein|Goodrich|Strash|2009}} solves the same problem in time O(''n''&nbsp;+&nbsp;''k''&nbsp;log<sup>(''i'')</sup>''n'') for any constant ''i'', where log<sup>(''i'')</sup> denotes the function obtained by iterating the logarithm function ''i'' times. The first of these algorithms takes linear time whenever ''k'' is larger than ''n'' by a log<sup>(''i'')</sup>''n'' factor, for any constant ''i'', while the second algorithm takes linear time whenever ''k'' is smaller than ''n'' by a log<sup>(''i'')</sup>''n'' factor. Both of these algorithms involve applying the Bentley–Ottmann algorithm to small random samples of the input.
 
==Notes==