Sweep line algorithm: Difference between revisions

Content deleted Content added
Legobot II (talk | contribs)
Date maintenance tags and general fixes
No edit summary
 
(35 intermediate revisions by 26 users not shown)
Line 1:
{{Short description|Class of algorithms which use a moving line to solve geometrical problems}}
[[ImageFile:FortunesSweep-line-algorithm.gif‎gif|frame|right|Animation of [[Fortune's algorithm]], a sweep line technique for constructing [[Voronoi diagram]]s.]]
 
In [[computational geometry]], a '''sweep line algorithm''' or '''plane sweep algorithm''' is aan type of[[algorithmic algorithmparadigm]] that uses a conceptual ''sweep line'' or ''sweep surface'' to solve various problems in [[Euclidean space]]. It is one of the keycritical techniques in computational geometry.
 
The idea behind algorithms of this type is to imagine that a line (often a vertical line) is swept or moved across the plane, stopping at some points. Geometric operations are restricted to geometric objects that either intersect or are in the immediate vicinity of the sweep line whenever it stops, and the complete solution is available once the line has passed over all objects.
 
==History==
This approach may be traced to [[scanline algorithm]]s of rendering in [[computer graphics]], followed by exploiting this approach in early algorithms of [[integrated circuit layout]] design, in which geometric description of an IC was processed in parallel strips, because the entire description could not fit into memory.{{Fact|date=May 2009}}
 
==Applications==
ApplicationAn application of thisthe approach had led to a breakthrough in the [[Analysis of algorithms|computational complexity]] of geometric algorithms when [[Michael Ian Shamos|Shamos]] and Hoey presented algorithms for [[line segment intersection]] in the plane, andin in1976. In particular, they described how a combination of the scanline approach with efficient data structures ([[self-balancing binary search tree]]s) makes it possible to detect whether there are intersections among ''{{mvar|N''}} segments in the plane in [[time complexity]] of {{math|[[Big O notation|O]](''N''&nbsp; log&nbsp; ''N'')}}.<ref>{{citation
| last1 = Shamos | first1 = Michael I. | author1-link = Michael Ian Shamos
| last2 = Hoey | first2 = Dan
| contribution = Geometric intersection problems
| doi = 10.1109/SFCS.1976.16
| pagepages = 208–215
| title = Proc. 17th IEEE Symp. Foundations of Computer Science (FOCS '76)
| year = 1976| s2cid = 124804 | url = http://euro.ecom.cmu.edu/shamos.html }}.</ref> The closely related [[Bentley–Ottmann algorithm]] uses a sweep line technique to report all ''{{mvar|K''}} intersections among any ''{{mvar|N''}} segments in the plane in time complexity of {{math|O((''N''&nbsp; +&nbsp; ''K'')&nbsp; log&nbsp; ''N'')}} and space complexity of {{math|O(''N'')}}.<ref>{{citation
| last = Souvaine | first = Diane | author-link = Diane Souvaine
| title = Line Segment Intersection Using a Sweep Line Algorithm
| url = httphttps://www.cs.tufts.edu/comp/163/notes05/seg_intersection_handout.pdf
| year = 2008}}.</ref>
 
Since then, this approach has been used to design efficient algorithms for a number of problems in computational geometry, such as the construction of the [[Voronoi diagram]] ([[Fortune's algorithm]]) and the [[Delaunay triangulation]] or [[Booleanboolean operations on polygons]].
 
==Generalizations and extensions==
Topological sweeping is a form of the plane sweep with a relaxedsimple ordering of processing points, thatwhich avoids the necessity of completely sorting the points; it allows some sweep line algorithms to be performed more efficiently.
The [[rotating calipers]] technique for designing geometric algorithms may also be interpreted as a form of the plane sweep, in the [[projective dual]] of the input plane: a form of projective duality transforms the slope of a line in one plane into the ''x''-coordinate of a point in the dual plane, so the progression through lines in sorted order by their slope as performed by a rotating calipers algorithm is dual to the progression through points sorted by their ''x''-coordinates in a plane sweep algorithm.<ref>{{cite conference
| last1 = Cheung | first1 = Yam Ki
| last2 = Daescu | first2 = Ovidiu
| editor1-last = Goldberg | editor1-first = Andrew V.
| editor2-last = Zhou | editor2-first = Yunhong
| contribution = Line segment facility ___location in weighted subdivisions
| doi = 10.1007/978-3-642-02158-9_10
| pages = 100–113
| publisher = Springer (1)
| series = Lecture Notes in Computer Science
| title = Algorithmic Aspects in Information and Management, 5th International Conference, AAIM 2009, San Francisco, CA, USA, June 15-17, 2009. Proceedings
| volume = 5564
| year = 2009}}</ref>
 
The sweeping approach may be generalised to higher dimensions.<ref>{{cite arXiv |last=Sinclair |first=David |eprint=1602.04707 |title=A 3D Sweep Hull Algorithm for computing Convex Hulls and Delaunay Triangulation |class=cs.CG |date=2016-02-11}}</ref>
 
==References==
{{reflist}}{{Algorithmic paradigms}}
 
[[Category:Geometric algorithms]]
[[Category:1976 in computing]]
 
[[de:Sweep (Informatik)]]