Download presentation
Presentation is loading. Please wait.
Published byVivian Hodge Modified over 9 years ago
1
Fundamentals of computational geometry M. Ramanathan STTP CAD 2011
2
camera How many cameras are needed to guard a gallery and How should they be placed? Fundamentals of computational geometrySTTP CAD 2011
3
Fundamentals of computational geometrySTTP CAD 2011
4
Model the art gallery as a region bounded by some simple polygon (no self-crossing). Regions with holes are not allowed. convex polygon one camera an arbitrary n-gon (n vertices) Bad news: finding the minimum number of cameras for a given polygon is NP-hard (exponential time). Fundamentals of computational geometrySTTP CAD 2011
5
There are no holes in a simple polygon. Simple polygon Nonsimple polygons Fundamentals of computational geometrySTTP CAD 2011
6
How many stationary guards are needed to guard a room? Guards are located at fixed points and have 2π range of visibility. A guard cannot see through walls. A set of guards covers a polygon if every point of the polygon is visible to some guard. Problem: Find the max over all n-vertex polygons of the min number of guards needed to cover the polygons. Fundamentals of computational geometrySTTP CAD 2011
7
This 12-vertex polygon needs 4 guards to cover it This 12-vertex polygon needs 3 guards to cover it. Fundamentals of computational geometrySTTP CAD 2011
8
Fundamentals of computational geometrySTTP CAD 2011
9
Fundamentals of computational geometrySTTP CAD 2011
10
Fundamentals of computational geometrySTTP CAD 2011
11
First Proof of sufficiency is due to Chvátal in 1975 (very complex). We’ll present a simple, four-step proof by Fisk from 1978. Necessity follows from the prong’s example. 1.Triangulation of polygon. 2.3-coloring of triangulation graph. 3.Placing guards at a single color guarantees cover. 4.“Pigeon-hole principle”: placing n objects in k holes, one at least contains no more than └ n/k ┘ objects. Fundamentals of computational geometrySTTP CAD 2011
12
A diagonal of a polygon is a line segment connecting two visible vertices. Triangulation: the partition of a polygon by maximal non crossing diagonals into triangles (not unique!). Fundamentals of computational geometrySTTP CAD 2011
13
n=14 Interesting, both triangulations have same number of diagonals! Notice that number of diagonals equals n-3. Fundamentals of computational geometrySTTP CAD 2011
14
G(V,E) is a graph defined on a triangulated polygon P. E consists of P’s edges and the triangulation diagonals, while V consists of P’s vertices. k-coloring is an assignment of k colors to the vertices of V such that no adjacent vertices have same color. We’ll show later that a triangulation graph is 3-colorable. Fundamentals of computational geometrySTTP CAD 2011
15
5 4 5 6 3 5 The coloring of a triangulation graph is unique! Assigning color to first vertex enforces the rest color assignments. Fundamentals of computational geometrySTTP CAD 2011
16
It is sufficient to place guards at one color only (say red). This follows since every triangle must have 3 distinct colors at its corners, hence one must be red. Therefore every triangle is covered. But the triangles cover the entire polygon P. Pigeon-hole principle: There must be one color whose number of assigned vertices doesn’t exceed └ n/3 ┘. Fundamentals of computational geometrySTTP CAD 2011
17
Fundamentals of computational geometry An example of a polyhedron with interior points not visible from any vertex. STTP CAD 2011
18
Schönhardt polyhedron is the smallest non-convex polyhedron which cannot be triangulated into tetrahedra without adding new vertices.non-convex polyhedrontriangulatedtetrahedra Fundamentals of computational geometrySTTP CAD 2011
19
Fundamentals of computational geometrySTTP CAD 2011
20
Area of polygons can be found by triangulation and calculation of triangles areas. We’d like to obtain a closed-form formula, independent of triangulation. Fundamentals of computational geometrySTTP CAD 2011
21
A(P) expression depends on triangulation. We’ll consider first quadrilaterals and show its area is independent of triangulation. Fundamentals of computational geometrySTTP CAD 2011
22
Diagonal related terms are canceled out! Fundamentals of computational geometrySTTP CAD 2011
23
What happens for non-convex quadrilateral ? v2v2 v3v3 v1v1 v0v0 Fundamentals of computational geometrySTTP CAD 2011
24
We’d like to obtain the area of a general simple polygon in terms of its vertices only. Fundamentals of computational geometrySTTP CAD 2011
25
Definitions Basic algorithms Gift Wrapping (algorithm of Jarvis ) Graham scan Divide and conquer Fundamentals of computational geometrySTTP CAD 2011
26
A set S is convex if x S and y S implies the segment xy S x y Fundamentals of computational geometrySTTP CAD 2011
27
Convex Hull of a finite set of points S in the plane is the smallest convex polygon P that encloses S which means that there is no other polygon P ’ such that S P’ P Intersection of all convex sets containing the points in S Fundamentals of computational geometrySTTP CAD 2011
28
The convex hull of a set of points S in the plane is the union of all the triangles determined by points in S Informal definition: Convex hull of a set of points in plane is the shape taken by a rubber band stretched around the nails pounded into the plane at each point Now we define the convex hull problem: - The problem is to construct the boundary of a convex hull in two dimensions given a finite set S of n points - Four outputs can be distinguished for the above problem: 1. all the points on the hull, in arbitrary order; 2. the extreme points, in arbitrary order; 3. all the points on the hull, in boundary traversal order; 4. the extreme points, in boundary traversal order; Fundamentals of computational geometrySTTP CAD 2011
29
The extreme points of a set S of points in the plane are the vertices of the convex hull at which the interior angle is less than π Also a point is extreme iff there exists a line through that point that other wise does not touch the convex hull Fundamentals of computational geometrySTTP CAD 2011
30
A] Using Non Extreme Points Identifying non extreme points implies identifying extreme points A point is non extreme iff it is inside some (closed) triangle whose vertices are the points of the set and is not itself a corner of that triangle. Thus given a triangle: If a point is interior to triangle it is non extreme Corners of the triangle might be extreme Thus as the output we will get the extreme points in some arbitrary order. Fundamentals of computational geometrySTTP CAD 2011
31
for each i do for each j ≠ i do for each k ≠ i ≠ j do for each l ≠ k ≠ i ≠ j do if p l Δ(p i,p j, p k ) then p l is nonextreme There are four nested loops in this algorithm Hence the order is O(n 4 ) For each of the n 3 triangles, the test for extremeness costs n It is important to find a faster algorithm Fundamentals of computational geometrySTTP CAD 2011
32
An edge is extreme if every point of S is on or to one side of the line determined by the edge If we treat the edge as directed and let the left side of edge be inside then – the directed edge is not extreme if there is some point that is not left of it or on it The output of this algorithm will be all the points on the convex hull in arbitrary order Fundamentals of computational geometrySTTP CAD 2011
33
for each i do for each j ≠ i do for each k ≠ i ≠ j do if p k is not left or on (p i,p j ) then (p i,p j ) is not extreme There are three nested loops in this algorithm Hence the order is O(n 3 ) For each of the n 2 pair of points, the test for extremeness costs n The vertices that are extreme can now be found Fundamentals of computational geometrySTTP CAD 2011
34
A minor variation of Extreme Edge algorithm can accelerate it by factor n as well as output the points in order The idea is to use one extreme edge as an anchor for finding the next Suppose the algorithm found an extreme edge whose unlinked endpoint is x θ y x e For each y of set S we compute the angle θ The point that yields the smallest θ must determine an extreme edge The output of this algorithm is all the points on the hull in boundary traversal order Fundamentals of computational geometrySTTP CAD 2011
35
Idea: Think of wrapping a gift. Put the paper in contact with the gift and continue to wrap around from one surface to the next until you get all the way around. Fundamentals of computational geometrySTTP CAD 2011
36
Find the lowest point (smallest y coordinate) Let i 0 be its index, and set i ← i 0 repeat for each j ≠ i do compute counterclockwise angle θ from previous hull edge Let k be the index of the point with the smallest θ Output (p i,p k ) as a hull edge i ← k until i = i 0 We use the lowest point as the anchor The order is O(n 2 ) The cost is O(n) for each hull edge The point set is wrapped by a string that bends the that bends with minimum angle from previous to next hull edge Fundamentals of computational geometrySTTP CAD 2011
37
p0p0 p1p1 p3p3 p2p2 p4p4 p5p5 p6p6 p7p7 p8p8 p9p9 p 11 p 12 p 10 Fundamentals of computational geometrySTTP CAD 2011
38
p0p0 p1p1 p3p3 p2p2 p4p4 p5p5 p6p6 p7p7 p8p8 p9p9 p 11 p 12 p 10 Fundamentals of computational geometrySTTP CAD 2011
39
p0p0 p1p1 p3p3 p2p2 p4p4 p5p5 p6p6 p7p7 p8p8 p9p9 p 11 p 12 p 10 Fundamentals of computational geometrySTTP CAD 2011
40
p0p0 p1p1 p3p3 p2p2 p4p4 p5p5 p6p6 p7p7 p8p8 p9p9 p 11 p 12 p 10 Fundamentals of computational geometrySTTP CAD 2011
41
p0p0 p1p1 p3p3 p2p2 p4p4 p5p5 p6p6 p7p7 p8p8 p9p9 p 11 p 12 p 10 Fundamentals of computational geometrySTTP CAD 2011
42
p0p0 p1p1 p3p3 p2p2 p4p4 p5p5 p6p6 p7p7 p8p8 p9p9 p 11 p 12 p 10 Fundamentals of computational geometrySTTP CAD 2011
43
p0p0 p1p1 p3p3 p2p2 p4p4 p5p5 p6p6 p7p7 p8p8 p9p9 p 11 p 12 p 10 Fundamentals of computational geometrySTTP CAD 2011
44
p0p0 p1p1 p3p3 p2p2 p4p4 p5p5 p6p6 p7p7 p8p8 p 11 p 12 p 10 p9p9 Fundamentals of computational geometrySTTP CAD 2011
45
p0p0 p1p1 p3p3 p2p2 p4p4 p5p5 p6p6 p7p7 p8p8 p 11 p 12 p 10 p9p9 Fundamentals of computational geometrySTTP CAD 2011
46
p0p0 p1p1 p3p3 p2p2 p4p4 p5p5 p6p6 p7p7 p8p8 p 11 p 12 p 10 p9p9 Fundamentals of computational geometrySTTP CAD 2011
47
p0p0 p1p1 p3p3 p2p2 p4p4 p5p5 p6p6 p7p7 p8p8 p 11 p 12 p 10 p9p9 Fundamentals of computational geometrySTTP CAD 2011
48
p0p0 p1p1 p3p3 p2p2 p4p4 p5p5 p6p6 p7p7 p8p8 p 11 p 12 p 10 p9p9 Fundamentals of computational geometrySTTP CAD 2011
49
p0p0 p1p1 p3p3 p2p2 p4p4 p5p5 p6p6 p7p7 p8p8 p 11 p 12 p 10 p9p9 Fundamentals of computational geometrySTTP CAD 2011
50
p0p0 p1p1 p3p3 p2p2 p4p4 p5p5 p6p6 p7p7 p8p8 p 11 p 12 p 10 p9p9 Fundamentals of computational geometrySTTP CAD 2011
51
p0p0 p1p1 p3p3 p2p2 p4p4 p5p5 p6p6 p7p7 p8p8 p9p9 p 11 p 12 p 10 Fundamentals of computational geometrySTTP CAD 2011
52
p0p0 p1p1 p3p3 p2p2 p4p4 p5p5 p6p6 p7p7 p8p8 p9p9 p 11 p 12 p 10 Fundamentals of computational geometrySTTP CAD 2011
53
p0p0 p1p1 p3p3 p2p2 p4p4 p5p5 p6p6 p7p7 p8p8 p9p9 p 11 p 12 p 10 Fundamentals of computational geometrySTTP CAD 2011
54
p0p0 p1p1 p3p3 p2p2 p4p4 p5p5 p6p6 p7p7 p8p8 p9p9 p 11 p 12 p 10 Fundamentals of computational geometrySTTP CAD 2011
55
p0p0 p1p1 p3p3 p2p2 p4p4 p5p5 p6p6 p7p7 p8p8 p9p9 p 11 p 12 p 10 Fundamentals of computational geometrySTTP CAD 2011
56
p0p0 p1p1 p3p3 p2p2 p4p4 p5p5 p6p6 p7p7 p8p8 p9p9 p 11 p 12 p 10 Fundamentals of computational geometrySTTP CAD 2011
57
Algorithm: Find a point with a median x coordinate (time: O( n )) Compute the convex hull of each half (recursive execution) Combine the two convex hulls by finding common tangents. Can be done in O( n ) Complexity: O(nlogn) Fundamentals of computational geometrySTTP CAD 2011
58
Voronoi Diagram Fundamentals of computational geometrySTTP CAD 2011
59
P A set of n distinct points in the plane. VD(P) a subdivision of the plane into n cells such that each cell contains exactly one site, if a point q lies in a cell containing p i then d(q, p i ) < d(q, p j ) for all p i P, j i. In other words, given a set P of points in 2D, VD(P) is a partition of the plane into n convex regions {R 1, R 2, …, R n }, each (R i ) containing exactly one member (p i ) in P such that for each point in R i, its nearest member in P is p i Fundamentals of computational geometrySTTP CAD 2011
60
Fundamentals of computational geometry P1P2 B(P1,P2) P1 P2 P3 B(P1,P3) B(P1,P2) B(P2,P3) Remember that VD is not defined for just points but for any set e.g. curves, surfaces etc. Moreover, the definition is applicable for any dimension. STTP CAD 2011
61
Each vertex (corner) of VD(P) has degree 3 The circle through the three points defines a vertex of the Voronoi diagram, and it does not contain any other point The locus of the center of a largest empty circles passing through only a pair of points p i, p j P defines an edge The locus of the center of largest empty circles passing through only one points in P defines a cell The Voronoi region of a point is unbounded if and only if the point is a vertex of the convex hull of the point set. Assumption: No 4 points are co- circular. Fundamentals of computational geometrySTTP CAD 2011
62
Search for nearest neighbour Input: A fixed (static) set P of n points in the plane, and a query point p Output: Nearest neighbour of p in P Solution Construct the Voronoi diagram for P in time O(n log n) Solve the point location problem in O(log n) time. Fundamentals of computational geometrySTTP CAD 2011
63
Closest pair of points: Inspect all the edges list of Vor(P) and determine the minimally separated pair Largest empty circle: Each Voronoi vertex represents the center of a maximal empty circle. Find one having maximum radius. Computing Euclidian Minimum Spanning Tree: Compute dual of the Voronoi diagram, and apply Kruskal’s algorithm for computing the minimum Spanning tree. Fundamentals of computational geometrySTTP CAD 2011
64
V -1 (p i ) : the set of point of the plane farther from p i than from any other site Vor -1 (P) : the partition of the plane formed by the farthest point Voronoi regions, their edges, and vertices Fundamentals of computational geometrySTTP CAD 2011
65
V(p i,p j ) : the set of points of the plane closer to each of p i and p j than to any other site Property The order-2 Voronoi regions are convex Fundamentals of computational geometrySTTP CAD 2011
66
S Set of points in 2D w(p) weight attached with the point p S d w (x,p) = d e (x,p)/w(p) weighted distance of a point x from p S Weighted Voronoi diagram WVD(S) the subdivision of the plane such that region(p) = {x : d w (x,p) < d w (x,q) q S Thus, a point having large weight will cover bigger space Fundamentals of computational geometrySTTP CAD 2011
67
Voronoi edges: These are formed with line segments and/or parabolic arcs. Straight line edges are part of either the perpendicular bisector of two segment end-points or the angular bisector or two segments. Curve edges consist of points equidistant from a segment end- point and a segment’s interior. Fundamentals of computational geometrySTTP CAD 2011
68
Nearest site proximity partitioning of the plane Voronoi Diagram & Delaunay Triangulation Fundamentals of computational geometrySTTP CAD 2011
69
Voronoi Diagram & Delaunay Triangulation Fundamentals of computational geometrySTTP CAD 2011
70
Fundamentals of computational geometry The medial axis (MA), or skeleton of the set D, is defined as the locus of points inside which lie at the centers of all closed discs (or balls in 3-D) which are maximal in D. STTP CAD 2011
71
Art-gallery problem for orthogonal polygon STTP CAD 2011Fundamentals of computational geometry smallest circle that completely encloses a set of points Relation between MA and VD for a) convex and b) non-convex polygons.
72
www.cs.iastate.edu/~cs518/handouts/ art - gallery. ppt www.cs.iastate.edu/~cs518/handouts/ art - gallery. ppt www.tcs.tifr.res.in/~igga/lectureslides/vor-July- 08-2009. ppt www.tcs.tifr.res.in/~igga/lectureslides/vor-July- 08-2009. ppt in2.csie.ncu.edu.tw/~jrjiang/alg2008/ Voronoi. ppt www.cse.ttu.edu.tw/~jmchen/compg/slides/vor o-apps. ppt www.cse.ttu.edu.tw/~jmchen/compg/slides/vor o-apps. ppt www.cse.yorku.ca/~ andy /courses/4101/Slides/ CG - Intro. ppt x www.cse.yorku.ca/~ andy /courses/4101/Slides/ CG - Intro. ppt x Joseph O’Rourke, Computational Geometry in C, Second edition, Cambridge university press, 1998 Joseph O’Rourke, Art Gallery theorems and algorithms, Oxford university press, 1987 STTP CAD 2011Fundamentals of computational geometry
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.