Computational Geometry Capter:1-2.1

Slides:



Advertisements
Similar presentations
Introduction to Algorithms
Advertisements

Two Segments Intersect?
Geometry Introduction
Polygon Triangulation
Computational Geometry
Lecture 3: Parallel Algorithm Design
Dynamic Planar Convex Hull Operations in Near- Logarithmic Amortized Time TIMOTHY M. CHAN.
2/14/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Planar Subdivisions and Point Location Carola Wenk Based on: Computational.
Brute-Force Triangulation
2/3/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Triangulations and Guarding Art Galleries II Carola Wenk.
Convex Hull obstacle start end Convex Hull Convex Hull
One of the most important problems is Computational Geometry is to find an efficient way to decide, given a subdivision of E n and a point P, in which.
UNC Chapel Hill M. C. Lin Polygon Triangulation Chapter 3 of the Textbook Driving Applications –Guarding an Art Gallery –3D Morphing.
9/12/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Triangulations and Guarding Art Galleries II Carola Wenk.
© The McGraw-Hill Companies, Inc., Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
1 Voronoi Diagrams. 2 Voronoi Diagram Input: A set of points locations (sites) in the plane.Input: A set of points locations (sites) in the plane. Output:
The Divide-and-Conquer Strategy
Advanced Topics in Algorithms and Data Structures Lecture 7.1, page 1 An overview of lecture 7 An optimal parallel algorithm for the 2D convex hull problem,
Computational Geometry
9/5/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Plane Sweep Algorithms and Segment Intersection Carola Wenk.
Intersections. Intersection Problem 3 Intersection Detection: Given two geometric objects, do they intersect? Intersection detection (test) is frequently.
Lecture 7: Voronoi Diagrams Presented by Allen Miu Computational Geometry September 27, 2001.
Robert Pless, CS 546: Computational Geometry Lecture #3 Last Time: Convex Hulls Today: Plane Sweep Algorithms, Segment Intersection, + (Element Uniqueness,
Computational Geometry -- Voronoi Diagram
17. Computational Geometry Chapter 7 Voronoi Diagrams.
Convex Hulls Computational Geometry, WS 2006/07 Lecture 2 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
2 -1 Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
2 -1 Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
Voronoi Diagrams.
The Complexity of Algorithms and the Lower Bounds of Problems
Lection 1: Introduction Computational Geometry Prof.Dr.Th.Ottmann 1 History: Proof-based, algorithmic, axiomatic geometry, computational geometry today.
Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 1 Line Segment Intersection Motivation: Computing the overlay of several.
Brute-Force Triangulation
Advanced Algorithm Design and Analysis (Lecture 9) SW5 fall 2004 Simonas Šaltenis E1-215b
1 Geometric Intersection Determining if there are intersections between graphical objects Finding all intersecting pairs Brute Force Algorithm Plane Sweep.
UNC Chapel Hill M. C. Lin Point Location Reading: Chapter 6 of the Textbook Driving Applications –Knowing Where You Are in GIS Related Applications –Triangulation.
UNC Chapel Hill M. C. Lin Line Segment Intersection Chapter 2 of the Textbook Driving Applications –Map overlap problems –3D Polyhedral Morphing.
Line Arrangement Chapter 6. Line Arrangement Problem: Given a set L of n lines in the plane, compute their arrangement which is a planar subdivision.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 8 Arrangements and Duality.
V Spanning Trees Spanning Trees v Minimum Spanning Trees Minimum Spanning Trees v Kruskal’s Algorithm v Example Example v Planar Graphs Planar Graphs v.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 8 Arrangements and Duality.
CMPS 3130/6130 Computational Geometry Spring 2015
Great Theoretical Ideas in Computer Science for Some.
9/8/10CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2010 Triangulations and Guarding Art Galleries Carola Wenk.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 9 Line Arrangements.
Polygon Triangulation
Computational Geometry
UNC Chapel Hill M. C. Lin Geometric Data Structures Reading: Chapter 10 of the Textbook Driving Applications –Windowing Queries Related Application –Query.
CMPS 3130/6130 Computational Geometry Spring 2017
3. Polygon Triangulation
Computational Geometry
Introduction to Polygons
CMPS 3130/6130 Computational Geometry Spring 2017
Dynamic Dictionaries Primary Operations: Additional operations:
Algorithm design techniques Dr. M. Gavrilova
CMPS 3130/6130 Computational Geometry Spring 2017
Orthogonal Range Searching and Kd-Trees
Computational Geometry 2
Polygon Triangulation
A Kind of Binary Tree Usually Stored in an Array
I. The Problem of Molding
Convex Hull 1/1/ :28 AM Convex Hull obstacle start end.
CMPS 3130/6130: Computational Geometry Spring 2017
Computational Geometry
Introduction to Algorithms
Trevor Brown DC 2338, Office hour M3-4pm
CS 113: Data Structures and Algorithms
Algorithms and Data Structures Lecture XIV
Mathematical Induction II
Presentation transcript:

Computational Geometry Capter:1-2.1 M1 Shohei Nishida

Chapter1:Convex hull What is “Convex”? The subset S of the plane is convex iff for any pair of point ,the line segment is completely in S The convex hull CH(S) of subset S is the smallest convex that contains S After this page, S is the set of points on plane

Convex hull

How to get the convex hull? What is “compute the convex hull”? Compute a list that are the vertices of CH(S),and listed in clockwise order

How to get the convex full? Let’s see what the edges of CH(S) are. If all points except p,q lie to the right of ,then is the edge of CH(S) Check the all pairs {p,q} whether this can be the edge of CH(S)

Three difficult point of calculate First , how to get right? Use cross product on plane

Three difficult point of calculate Second ,three points lie on a straight line In this book middle points are ignored Check right turn strictly

Three difficult point of calculate Last , rounding error Computer cannot calculate irrational number correctly We don’t think this situation Let the numbers can calculate correctly

The algorithm1

Is this clever? No. The computation time is very slow. Is there more clever way? Yes, we can compute the convex full more rapidly.

The sketch of faster algorithm. Let no pair of points has same x-coordinate Sort all points by x-coordinat First, compute ”upper hull”. The upper hull is the set of segments that bounding convex hull from above Second, compute “lower hull”. Merge two segments

The sketch of faster algorithm.

How to get upper hull? Basic idea is right turn. Any three points on upper hull must be “right turn”. Let’s define are sorted points Add point one by one this order. If the point that makes turn left comes, delete previous points to save “turn right”

How to get upper hull

The algorihtm2

The correctness of this algorithm Can this algorithm compute “upper hull” correctly? The proof is by induction. The points is calculated by x-coordinate order. Think the situation that the algorithm can compute upper hull correctly for and add the new point

The correctness of this algorithm If the algorithm is wrong ,there are some points over the segments. But by induction, the points in range cannot be such points. So such points must be in range .But it cannot be.(The order made by x-coordinate)

The computation time of this algorihtm The sort can be done time. How long is for-loop and while-loop? The answer is .Adding point and deleting point is at most once for each points. The total computation time is

When some points has same x-coordinate When we calculate upper hull - we think only highest y- coordinate point. So we can use same proof for correctness. When marge two line – If end point is not same , the algorithm don’t delete lower hull end point.

Chapter 2:Line Segment Intersection We want to count the number of Line Segment Intersection How large the computation time is?

Computation time of Line Segment Intersection In general case,the computational complexity is But in real world, the number of Intersection is small Can we reduce the complexity of the algorithm? Output-sensitive algorithm

The sketch of the algorithm This algorithm called plane sweep algorithm Imagine the sweeping line L L scan downwards over the plane and find “event point”

The sketch of the algorithm Event point is “state” change point on L “state” is list of segments sorted by x-coordinate of intersection point the segment and L

The sketch of the algorithm If two lines intersect , this point is a event point. At intersection, two segment’s positions are swapped. So this is event point. If we can check all event point. We can know all intersection

The sketch of the algorithm The event point has two type – intersection and end of segments We already know end of segments but don’t know intersection We can calculate intersection at event point above this intersection Why?

The sketch of the algorithm If the segments intersect , then two lines are “neighbors” on L There must be event point above p that two segments become neighbors. So We can “add event point” at this time.

The sketch of the algorithm All we have to do is following Check the event point that has most highest y- coordinate(if same smaller x-coordinate) If this point is intersection , check this point as intersection If new event point occur , then add this point to event point queue

Event point – what to do The state change in three situations. First is L touch the upper endpoint of some segment - new cross point occurs on L Second is L touch the crossing point of two segments. - swap the relation between two points on L Last is L touch the lower endpoint of some segment -delete point on L

L touch the upper endpoint of some segment New points occur , so we have to check whether the new segment intersects it’s neighbor

L touch the crossing point of two segments Output here is Intersection Swap the points on L and check whether the new neighbor intersects

L touch the lower endpoint of some segment Delete segment on L Check whether the new neighbor intersects

The important data The state data - intersect point between L and segments -The place data have to sorted by x-coordinate order The event point data - The event have to sorted by y-coordinate order if same x-coordinate And these data change dynamic with sweep by L We have to get good data structure

Balanced binary search tree The data structure using tree. Two data must be able to compare - event points are compared by y-coordinate if same ,x- coordinate - place data are compared by x-coordinate Insert , delete ,find can do It is convenient to treat “same point” as one point. So we cannot use heap structure

How to make status binary tree Binary search tree’s nodes must have compare data In event point structure, the compare data is y-coordinate But in status structure, x-coordinates are change by y- coordinate of L. So each node has the most right leaf’s segment number under this node

How to make status binary tree At each event point we can calculate x-coordinate from y-coordinate of L and segment number.

The algorithm1-1

The algorithm1-2

The algorithm1-3

The correctness of this algorithm Let p be an intersection point and assume that all intersecion points q with higher priority have been computed correctly. If the p is end point ,U(p) , L(p) and C(p)are stored in J. So we can calculate p correctly If the p is not an end point , C(p) have to be inserted in J. And there are event points and that are neighbor. Then p is stored.

The computation time of the algorithm Sort can be done All operation to J can be done Find new event can be done in constant time Let the number of operation to J , The computation time is

How large m is? At each event point , the number of operation is linear in connected edge with the point. The total number of operation can be bounded by number of edge*2 Let all event points as vertex

The computation time of algorithm From Euler’s formula So total computation time is