Geometric Algorithms João Comba. Example: Convex Hull convex Non-convex.

Slides:



Advertisements
Similar presentations
Convex Hull obstacle start end Convex Hull Convex Hull
Advertisements

MA/CSSE 473 Day 13 Divide and Conquer Closest Points Convex Hull Answer Quiz Question 1.
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:
Convex Hulls in Two Dimensions Definitions Basic algorithms Gift Wrapping (algorithm of Jarvis ) Graham scan Divide and conquer Convex Hull for line intersections.
CS4413 Divide-and-Conquer
Reminder: Closest-Pair Problem Given a collection P of n points in  × , obtain the two points p1 and p2 such that their distance is less or equal that.
Introduction to Algorithms Rabie A. Ramadan rabieramadan.org 6 Ack : Carola Wenk nad Dr. Thomas Ottmann tutorials.
Convex Hulls May Shmuel Wimer Bar Ilan Univ., Eng. Faculty Technion, EE Faculty.
Geometry Chapter Polygons. Convex Polygon – a polygon with a line containing a side with a point in the interior of the polygon.
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,
1 Convex Hull in Two Dimensions Jyun-Ming Chen Refs: deBerg et al. (Chap. 1) O’Rourke (Chap. 3)
Computational Geometry
Design and Analysis of Algorithms – Chapter 51 Divide and Conquer (III)* Dr. Ying Lu RAIK 283: Data Structures & Algorithms *slides referred.
THE WORLD OF POLYGONS LESSON 4.
(over Lesson 10-1) Slide 1 of 1 1-1a.
1 Today’s Material Computational Geometry Problems –Closest Pair Problem –Convex Hull Jarvis’s March, Graham’s scan –Farthest Point Problem.
Algorithms and Data Structures Lecture 13. Agenda: Plane Geometry: algorithms on polygons - Verification if point belongs to a polygon - Convex hull.
6.1 Classify polygons based on their sides and angles.
Computational Geometry Piyush Kumar (Lecture 3: Convexity and Convex hulls) Welcome to CIS5930.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2004 Chapter 4: 3D Convex Hulls Monday, 2/23/04.
Design and Analysis of Algorithms - Chapter 41 Divide and Conquer The most well known algorithm design strategy: 1. Divide instance of problem into two.
GEOMETRY Eqao preparation day 5.
ACM Schedule… 2/23 Geometry problems 3/2 Lab problems (geometry!) 3/30 "Mock" competition and lab session (4:15) 3/9 Final algorithm discussion… 3/16 [Spring.
CSE53111 Computational Geometry TOPICS q Preliminaries q Point in a Polygon q Polygon Construction q Convex Hulls Further Reading.
Convex Hull. What is the Convex Hull? Imagine a set of points on a board with a nail hammered into each point. Now stretch a rubber band over all the.
Geometry 3.5 Angles of a Polygon Standard 12.0 & 13.0.
MA/CSSE 473 Day 17 Divide-and-conquer Convex Hull Strassen's Algorithm: Matrix Multiplication.
Computational Geometry (35/33) Line Segments and cross-product Segment intersection and Sweep Line Convex Hull and Graham’s Scan, Jarvis’s march Divide-and-Conquer.
Lesson 8.2 (Part 2) Exterior Angles in Polygons
Geometry B Section 12.3 Surface Area of Pyramids and Cones.
8.2 Angles in Polygons Polygon Number of sides Number of triangles Sum of measures of interior angles Triangle Quadrilateral Pentagon Hexagon Heptagon.
Geometry Section 8.1 Find Angle Measures in Polygons.
Geometry: From Triangles to Quadrilaterals and Polygons.
Geometry Final Vocabulary. A ____________________ polygon is both equilateral and equiangular. regular.
CMPS 3120: Computational Geometry Spring 2013
CSC-305 Design and Analysis of AlgorithmsBS(CS) -6 Fall-2014CSC-305 Design and Analysis of AlgorithmsBS(CS) -6 Fall-2014 Design and Analysis of Algorithms.
Geometry. 3 sides 4 sides 5 sides 6 sides 8 sides 9 sides 10 sides 12 sides triangle quadrilateral pentagon hexagon octagon nonagon decagon dodecagon.
Algebra, Geometry, and Geoboards
Section 3-5 Angles of Polygons
Computational Geometry 2D Convex Hulls
Polygons Advanced Geometry Polygons Lesson 1. Polygon a closed figure Examples NO HOLES NO CURVES SIDES CANNOT OVERLAP all sides are segments.
COMPUTATIONAL GEOMETRY AND MATRIX MULTIPLICATION Mohammed Zeeshan Farooqui Minhaj Uddin.
Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms.
CS6234 Advanced Algorithms - Convex hull. Terminologies – ◦ Convex hull of a set Q of points is the smallest convex polygon P for which each point in.
Gradient Diagrams Geometry The diagram shows a straight line with the vert/horiz. distances marked on it. Straight line horizontal vertical In each of.
Convex Hulls Guo Qi, Chen Zhenghai, Wang Guanhua, Shen Shiqi, Himeshi De Silva.
Polygons 1 What is the difference between concave and convex?
Chapter 10 – Topics in Analytic Geometry. Section 10.1 – Lines.
Week 5 Warm Up { -3, 8, 19, 30, 41, . . } n = 3 1) tn = 2) tn - 1 =
Classify Quadrilaterals
MA/CSSE 473 Day 17 Divide-and-conquer Convex Hull
MA/CSSE 473 Day 16 Answers to your questions Divide and Conquer
Convex Hull.
d = 180°-120°= 60° (∠s on a straight line) = 130° f = 180°-130° = 50°
CSCE350 Algorithms and Data Structure
Algorithm design techniques Dr. M. Gavrilova
6.1 Notes: Angles of Polygons
Convex Hull obstacle start end 11/21/2018 4:05 AM Convex Hull
Computational Geometry (35/33)
Convex Hull 1/1/ :28 AM Convex Hull obstacle start end.
Dilations Objectives:
Convex Hulls Given a set of points (x1,y1),(x2,y2),…,(xn,yn), the convex hull is the smallest convex polygon containing all the points.
Three Step Geometric Pipeline
a closed figure whose sides are straight line segments.
Convex Hull obstacle start end 4/30/2019 5:21 PM Convex Hull
Introduction to Algorithms
Angle Measures of Polygons
Angle Measures in Polygons
Figure 1: Triangle Review
Clipping Polygons Lecture 31 Fri, Nov 9, 2007.
Presentation transcript:

Geometric Algorithms João Comba

Example: Convex Hull convex Non-convex

Example: Convex Hull p9p9 p2p2 p8p8 p6p6 p5p5 p4p4 p 11 p1p1 p7p7 p3p3 p 10 Input: p 1,p 2,p 3,p 4,p 5,p 6,p 7,p 8,p 9,p 10,p 11 Output: p 2,p 9,p 11,p 4,p 5,p 6,p 8,p 2 CH is a convex polygon

Example: Convex Hull p9p9 p2p2 p8p8 p6p6 p5p5 p4p4 p 11 p1p1 p7p7 p3p3 p 10

Quickhull p3p3 p1p1 p2p2 p7p7 p 11 p 10 p8p8 p5p5 p4p4 p9p9 p6p6 1.Find extreme points above, below, left and right 2.Define a quadrilateral connecting extreme points, discard internal points 3.Process 4 triangles recursively 4.For each triangle, find vertex with the greatest distance from the triangle baseline. 5.Define another triangle and discard internal triangles 6.Process 2 triangles recursively

Quickhull p3p3 p1p1 p2p2 p7p7 p 11 p 10 p8p8 p5p5 p4p4 p9p9 p6p6 1.Find extreme points above, below, left and right 2.Define a quadrilateral connecting extreme points, discard internal points

Quickhull p3p3 p1p1 p2p2 p7p7 p 11 p 10 p8p8 p5p5 p4p4 p9p9 p6p6 1.Find extreme points above, below, left and right 2.Define a quadrilateral connecting extreme points, discard internal points Which Points are internal?

A Fact From Analytical Geometry P 3 is to the left of the line P 1 ->P 2 if and only if the sign of the following determinant is positive: P 1 (x 1, y 1 ) P 2 (x 2, y 2 ) P 3 (x 3, y 3 )

Quickhull p3p3 p1p1 p2p2 p7p7 p 11 p 10 p8p8 p5p5 p4p4 p9p9 p6p6 1.Find extreme points above, below, left and right 2.Define a quadrilateral connecting extreme points, discard internal points 3.Process 4 triangles recursively

Quickhull p3p3 p1p1 p2p2 p7p7 p 11 p 10 p8p8 p5p5 p4p4 p9p9 p6p6 1.Find extreme points above, below, left and right 2.Define a quadrilateral connecting extreme points, discard internal points 3.Process 4 triangles recursively 4.For each triangle, find vertex with the greatest distance from the triangle baseline.

Quickhull p3p3 p1p1 p2p2 p7p7 p 11 p 10 p8p8 p5p5 p4p4 p9p9 p6p6 1.Find extreme points above, below, left and right 2.Define a quadrilateral connecting extreme points, discard internal points 3.Process 4 triangles recursively 4.For each triangle, find vertex with the greatest distance from the triangle baseline. How to calculate a vertex’s distance from a line?

A Fact From Analytical Geometry The area of the triangle  P 1 P 2 P 3 is ½ of the magnitude of the determinant P 1 (x 1, y 1 ) P 2 (x 2, y 2 ) P 3 (x 3, y 3 )

Quickhull p3p3 p1p1 p2p2 p7p7 p 11 p 10 p8p8 p5p5 p4p4 p9p9 p6p6 1.Find extreme points above, below, left and right 2.Define a quadrilateral connecting extreme points, discard internal points 3.Process 4 triangles recursively 4.For each triangle, find vertex with the greatest distance from the triangle baseline. 5.Define another triangle and discard internal triangles

Quickhull p3p3 p1p1 p2p2 p7p7 p 11 p 10 p8p8 p5p5 p4p4 p9p9 p6p6 1.Find extreme points above, below, left and right 2.Define a quadrilateral connecting extreme points, discard internal points 3.Process 4 triangles recursively 4.For each triangle, find vertex with the greatest distance from the triangle baseline. 5.Define another triangle and discard internal triangles 6.Process 2 triangles recursively

Quickhull p3p3 p1p1 p2p2 p7p7 p 11 p 10 p8p8 p5p5 p4p4 p9p9 p6p6 1.Find extreme points above, below, left and right 2.Define a quadrilateral connecting extreme points, discard internal points 3.Process 4 triangles recursively 4.For each triangle, find vertex with the greatest distance from the triangle baseline. 5.Define another triangle and discard internal triangles 6.Process 2 triangles recursively

Quickhull p3p3 p1p1 p2p2 p7p7 p 11 p 10 p8p8 p5p5 p4p4 p9p9 p6p6 1.Find extreme points above, below, left and right 2.Define a quadrilateral connecting extreme points, discard internal points 3.Process 4 triangles recursively 4.For each triangle, find vertex with the greatest distance from the triangle baseline. 5.Define another triangle and discard internal triangles 6.Process 2 triangles recursively

Quickhull p3p3 p1p1 p2p2 p7p7 p 11 p 10 p8p8 p5p5 p4p4 p9p9 p6p6 1.Find extreme points above, below, left and right 2.Define a quadrilateral connecting extreme points, discard internal points 3.Process 4 triangles recursively 4.For each triangle, find vertex with the greatest distance from the triangle baseline. 5.Define another triangle and discard internal triangles 6.Process 2 triangles recursively

Quickhull p3p3 p1p1 p2p2 p7p7 p 11 p 10 p8p8 p5p5 p4p4 p9p9 p6p6 1.Find extreme points above, below, left and right 2.Define a quadrilateral connecting extreme points, discard internal points 3.Process 4 triangles recursively 4.For each triangle, find vertex with the greatest distance from the triangle baseline. 5.Define another triangle and discard internal triangles 6.Process 2 triangles recursively

Quickhull p3p3 p1p1 p2p2 p7p7 p 11 p 10 p8p8 p5p5 p4p4 p9p9 p6p6 1.Find extreme points above, below, left and right 2.Define a quadrilateral connecting extreme points, discard internal points 3.Process 4 triangles recursively 4.For each triangle, find vertex with the greatest distance from the triangle baseline. 5.Define another triangle and discard internal triangles 6.Process 2 triangles recursively

Quickhull p3p3 p1p1 p2p2 p7p7 p 11 p 10 p8p8 p5p5 p4p4 p9p9 p6p6 1.Find extreme points above, below, left and right 2.Define a quadrilateral connecting extreme points, discard internal points 3.Process 4 triangles recursively 4.For each triangle, find vertex with the greatest distance from the triangle baseline. 5.Define another triangle and discard internal triangles 6.Process 2 triangles recursively

Quickhull p3p3 p1p1 p2p2 p7p7 p 11 p 10 p8p8 p5p5 p4p4 p9p9 p6p6 1.Find extreme points above, below, left and right 2.Define a quadrilateral connecting extreme points, discard internal points 3.Process 4 triangles recursively 4.For each triangle, find vertex with the greatest distance from the triangle baseline. 5.Define another triangle and discard internal triangles 6.Process 2 triangles recursively

Quickhull p3p3 p1p1 p2p2 p7p7 p 11 p 10 p8p8 p5p5 p4p4 p9p9 p6p6 1.Find extreme points above, below, left and right 2.Define a quadrilateral connecting extreme points, discard internal points 3.Process 4 triangles recursively 4.For each triangle, find vertex with the greatest distance from the triangle baseline. 5.Define another triangle and discard internal triangles 6.Process 2 triangles recursively

Quickhull p3p3 p1p1 p2p2 p7p7 p 11 p 10 p8p8 p5p5 p4p4 p9p9 p6p6 1.Find extreme points above, below, left and right 2.Define a quadrilateral connecting extreme points, discard internal points 3.Process 4 triangles recursively 4.For each triangle, find vertex with the greatest distance from the triangle baseline. 5.Define another triangle and discard internal triangles 6.Process 2 triangles recursively Time Efficiency?

Quickhull p3p3 p1p1 p2p2 p7p7 p 11 p 10 p8p8 p5p5 p4p4 p9p9 p6p6 1.Find extreme points above, below, left and right 2.Define a quadrilateral connecting extreme points, discard internal points 3.Process 4 triangles recursively 4.For each triangle, find vertex with the greatest distance from the triangle baseline. 5.Define another triangle and discard internal triangles 6.Process 2 triangles recursively Time Efficiency? Time Efficiency of Steps 4, 5, 6?

Quickhull p3p3 p1p1 p2p2 p7p7 p 11 p 10 p8p8 p5p5 p4p4 p9p9 p6p6 T(n) = O(n) + 2T(n/2) -> O(nlogn) T(n) = O(n) + T(n-1) ->O(n 2 ) T(n) = O(n) + T(a) + T(b) 1.Find extreme points above, below, left and right 2.Define a quadrilateral connecting extreme points, discard internal points 3.Process 4 triangles recursively 4.For each triangle, find vertex with the greatest distance from the triangle baseline. 5.Define another triangle and discard internal triangles 6.Process 2 triangles recursively