lecture 15 computational geometry geometry sweeping geometric preliminaries some basics geometry...
DESCRIPTION
Roadmap Closest pair Geometry sweeping Geometric preliminaries Some basics geometry algorithms Convex hull problem Diameter of a set of points Intersection of line segmentsTRANSCRIPT
![Page 1: Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms](https://reader034.vdocument.in/reader034/viewer/2022051522/5a4d1b617f8b9ab0599adcc9/html5/thumbnails/1.jpg)
Lecture 15 Computational Geometry
• Geometry sweeping
• Geometric preliminaries
• Some basics geometry algorithms
![Page 2: Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms](https://reader034.vdocument.in/reader034/viewer/2022051522/5a4d1b617f8b9ab0599adcc9/html5/thumbnails/2.jpg)
Computational geometry• Computational geometry is devoted to the study of
algorithms which can be stated in terms of geometry.
![Page 3: Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms](https://reader034.vdocument.in/reader034/viewer/2022051522/5a4d1b617f8b9ab0599adcc9/html5/thumbnails/3.jpg)
Roadmap• Closest pair• Geometry sweeping• Geometric preliminaries• Some basics geometry algorithms
• Convex hull problem• Diameter of a set of points• Intersection of line segments
![Page 4: Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms](https://reader034.vdocument.in/reader034/viewer/2022051522/5a4d1b617f8b9ab0599adcc9/html5/thumbnails/4.jpg)
Closest pair problemProblem: ClosestPairInput: A set S of n points in the planeOutput: The pair p1 = (x1, y1) and p2 = (x2, y2) such that the Euclidean distance between p1 and p2 is minimal.
Divide
Conquer
Combineδl δr
2δr
δr
![Page 5: Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms](https://reader034.vdocument.in/reader034/viewer/2022051522/5a4d1b617f8b9ab0599adcc9/html5/thumbnails/5.jpg)
Closest pair problem
![Page 6: Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms](https://reader034.vdocument.in/reader034/viewer/2022051522/5a4d1b617f8b9ab0599adcc9/html5/thumbnails/6.jpg)
Closest pair problem
![Page 7: Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms](https://reader034.vdocument.in/reader034/viewer/2022051522/5a4d1b617f8b9ab0599adcc9/html5/thumbnails/7.jpg)
![Page 8: Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms](https://reader034.vdocument.in/reader034/viewer/2022051522/5a4d1b617f8b9ab0599adcc9/html5/thumbnails/8.jpg)
Closest pair problem
![Page 9: Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms](https://reader034.vdocument.in/reader034/viewer/2022051522/5a4d1b617f8b9ab0599adcc9/html5/thumbnails/9.jpg)
Where are we?• Closest pair• Geometry sweeping• Geometric preliminaries• Some basics geometry algorithms
• Convex hull problem• Diameter of a set of points• Intersection of line segments
![Page 10: Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms](https://reader034.vdocument.in/reader034/viewer/2022051522/5a4d1b617f8b9ab0599adcc9/html5/thumbnails/10.jpg)
The point p2 = (x2, y2) dominates the point p1 = (x1, y1), denoted by p1 ≺ p2, if x1 ≤ x2 and y1 ≤y2.
p2
p1
A point p is maximal point if there does NOT exist a point q such that p ≠ q and p ≺ q.
p3
p4
Maximal points problem
![Page 11: Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms](https://reader034.vdocument.in/reader034/viewer/2022051522/5a4d1b617f8b9ab0599adcc9/html5/thumbnails/11.jpg)
Maximal points problem
Sweeping line
Θ(nlogn)
Problem: MaximalPointsInput: a set of points with their coordinates (xi,yi). Output: All the maximal points in the set.
Event
![Page 12: Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms](https://reader034.vdocument.in/reader034/viewer/2022051522/5a4d1b617f8b9ab0599adcc9/html5/thumbnails/12.jpg)
Geometric sweeping
• Determine the sweeping line and Events• Handle events• Solve the problem
![Page 13: Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms](https://reader034.vdocument.in/reader034/viewer/2022051522/5a4d1b617f8b9ab0599adcc9/html5/thumbnails/13.jpg)
City Skyline8
(1, 1)(2, 2)(3, 3)(4, 2)(5, 3)(6, 2)(7, 0)(8, 1)
11 2 3 4 5 6 7 8
![Page 14: Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms](https://reader034.vdocument.in/reader034/viewer/2022051522/5a4d1b617f8b9ab0599adcc9/html5/thumbnails/14.jpg)
Where are we?• Closest pair• Geometry sweeping• Geometric preliminaries• Some basics geometry algorithms
• Convex hull problem• Diameter of a set of points• Intersection of line segments
![Page 15: Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms](https://reader034.vdocument.in/reader034/viewer/2022051522/5a4d1b617f8b9ab0599adcc9/html5/thumbnails/15.jpg)
Geometry preliminaries• Point: p(x,y)• Line segment: ((x1,y1),(x2,y2))• Convex polygon: A polygon P is convex if the line segment connecting any two points in P lies ENTIRELY in P.
concaveconvex
![Page 16: Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms](https://reader034.vdocument.in/reader034/viewer/2022051522/5a4d1b617f8b9ab0599adcc9/html5/thumbnails/16.jpg)
Left turn and right turn
p1(x1,y1) Area = ?p2(x2,y2)
p3(x3,y3)
p1(x1,y1)
p2(x2,y2)
p3(x3,y3)
D > 0 p1(x1,y1)
p2(x2,y2)
p3(x3,y3)
D < 0
![Page 17: Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms](https://reader034.vdocument.in/reader034/viewer/2022051522/5a4d1b617f8b9ab0599adcc9/html5/thumbnails/17.jpg)
Left turn and right turn• To determine whether a point is under or
above a line segment.• To determine if two line segments
intersect.
![Page 18: Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms](https://reader034.vdocument.in/reader034/viewer/2022051522/5a4d1b617f8b9ab0599adcc9/html5/thumbnails/18.jpg)
Where are we?• Closest pair• Geometry sweeping• Geometric preliminaries• Some basics geometry algorithms
• Convex hull problem• Diameter of a set of points• Intersection of line segments
![Page 19: Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms](https://reader034.vdocument.in/reader034/viewer/2022051522/5a4d1b617f8b9ab0599adcc9/html5/thumbnails/19.jpg)
Convex hullProblem: ConvexHullInput: a set S={p1, p2,..., pn} of n points in the plane,Output: CH(S)
•Graham scan•Jarvis’ march (gift-wrapping algorithm)•Quick-hull
![Page 20: Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms](https://reader034.vdocument.in/reader034/viewer/2022051522/5a4d1b617f8b9ab0599adcc9/html5/thumbnails/20.jpg)
Graham Scan
Ronald Graham(source from Wikipedia)
p0p1
p2
p3
p4p5
p6
p7
p8
p9
p10
![Page 21: Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms](https://reader034.vdocument.in/reader034/viewer/2022051522/5a4d1b617f8b9ab0599adcc9/html5/thumbnails/21.jpg)
Graham scan
p0p1
p2
p3
p4p5
p6
p7
p8
p9
p10
![Page 22: Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms](https://reader034.vdocument.in/reader034/viewer/2022051522/5a4d1b617f8b9ab0599adcc9/html5/thumbnails/22.jpg)
Geometric sweeping
• Sweeping line and Events• How to handle
events• Solve the problem
p0p1
p2
p3
p4p5
p6
p7
p8
p9
p10
Θ(nlogn)+ O(n)
![Page 23: Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms](https://reader034.vdocument.in/reader034/viewer/2022051522/5a4d1b617f8b9ab0599adcc9/html5/thumbnails/23.jpg)
![Page 24: Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms](https://reader034.vdocument.in/reader034/viewer/2022051522/5a4d1b617f8b9ab0599adcc9/html5/thumbnails/24.jpg)
Conclusion• Computational geometry is devoted to the study
of algorithms which can be stated in terms of geometry.• Computational complexity: the difference
between O(n2) and O(n log n) may be the difference between days and seconds of computation.• Applications include: CAD/CAM, GIS, Integrated
Circuit design, Computer vision, ……
![Page 25: Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms](https://reader034.vdocument.in/reader034/viewer/2022051522/5a4d1b617f8b9ab0599adcc9/html5/thumbnails/25.jpg)
References
[1] Franco P. Preparata and Michael Ian Shamos. Computational Geometry - An Introduction. Springer-Verlag. [2] Mark de Berg, Otfried Cheong,Marc van Kreveld, Mark Overmars. Computational Geometry: Algorithms and ApplicationsThird Edition (March 2008) Springer-Verlag.