lecture 15 computational geometry geometry sweeping geometric preliminaries some basics geometry...

Post on 18-Jan-2018

220 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Roadmap Closest pair Geometry sweeping Geometric preliminaries Some basics geometry algorithms Convex hull problem Diameter of a set of points Intersection of line segments

TRANSCRIPT

Lecture 15 Computational Geometry

• Geometry sweeping

• Geometric preliminaries

• Some basics geometry algorithms

Computational geometry• Computational geometry is devoted to the study of

algorithms which can be stated in terms of geometry.

Roadmap• Closest pair• Geometry sweeping• Geometric preliminaries• Some basics geometry algorithms

• Convex hull problem• Diameter of a set of points• Intersection of line segments

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

Closest pair problem

Closest pair problem

Closest pair problem

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

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

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

Geometric sweeping

• Determine the sweeping line and Events• Handle events• Solve the problem

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

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

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

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

Left turn and right turn• To determine whether a point is under or

above a line segment.• To determine if two line segments

intersect.

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

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

Graham Scan

Ronald Graham(source from Wikipedia)

p0p1

p2

p3

p4p5

p6

p7

p8

p9

p10

Graham scan

p0p1

p2

p3

p4p5

p6

p7

p8

p9

p10

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)

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, ……

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.

top related