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.

Slides:



Advertisements
Similar presentations
Computational Geometry The systematic study of algorithms and data structures for geometric objects, with a focus on exact algorithms that are asymptotically.
Advertisements

Computational Geometry
ADA: 15. Basic Math1 Objective o a reminder about dot product and cross product, and their use for analyzing line segments (e.g. do two segments.
Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 1 Merging two upper hulls Suppose, UH ( S 2 ) has s points given in an array according.
2/9/06CS 3343 Analysis of Algorithms1 Convex Hull  Given a set of pins on a pinboard  And a rubber band around them  How does the rubber band look when.
Planar Convex Hull 2013 / 5 / 9 Group 4 Sungheon Park Jeongho Son CS504 Presentation [CS504 Presentation]
1/13/15CMPS 3130/6130: Computational Geometry1 CMPS 3130/6130: Computational Geometry Spring 2015 Convex Hulls Carola Wenk.
Divide-and-conquer: closest pair (Chap.33) Given a set of points, find the closest pair (measured in Euclidean distance) Brute-force method: O(n 2 ). Divide-and-conquer.
MA/CSSE 473 Day 13 Divide and Conquer Closest Points Convex Hull Answer Quiz Question 1.
Closest Pair Given a set S = {p1, p2,..., pn} of n points in the plane find the two points of S whose distance is the smallest. Images in this presentation.
Divide-and-Conquer The most-well known algorithm design strategy:
The Divide-and-Conquer Strategy
A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
1 Divide-and-Conquer The most-well known algorithm design strategy: 1. Divide instance of problem into two or more smaller instances 2. Solve smaller instances.
Convex Hulls in Two Dimensions Definitions Basic algorithms Gift Wrapping (algorithm of Jarvis ) Graham scan Divide and conquer Convex Hull for line intersections.
Convex Hull(35.3) Convex Hull, CH(X), is the smallest convex polygon containing all points from X, |X|=n Different methods: –incremental: moving from left.
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.
The Divide-and-Conquer Strategy
Data Structures and Algorithms (AT70.02) Comp. Sc. and Inf. Mgmt. Asian Institute of Technology Instructor: Dr. Sumanta Guha Slide Sources: CLRS “Intro.
Sorting I / Slide 1 Mergesort Based on divide-and-conquer strategy * Divide the list into two smaller lists of about equal sizes * Sort each smaller list.
Theory of Algorithms: Divide and Conquer
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Divide and Conquer.
Convex Hulls May Shmuel Wimer Bar Ilan Univ., Eng. Faculty Technion, EE Faculty.
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
8/29/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Spring 2006 Convex Hulls Carola Wenk.
Advanced Algorithm Design and Analysis (Lecture 10) SW5 fall 2004 Simonas Šaltenis E1-215b
Computational Geometry for the Tablet PC
1 Today’s Material Computational Geometry Problems –Closest Pair Problem –Convex Hull Jarvis’s March, Graham’s scan –Farthest Point Problem.
What does that mean? To get the taste we will just look only at some sample problems... [Adapted from S.Suri]
ADA: 16. CG Topics1 Objective o an examination of four important CG topics o just a taster of a very large research area Algorithm Design and Analysis.
November 4, Algorithms and Data Structures Lecture XIV Simonas Šaltenis Nykredit Center for Database Research Aalborg University
1 Lecture 8: Voronoi Diagram Computational Geometry Prof. Dr. Th. Ottmann Voronoi Diagrams Definition Characteristics Size and Storage Construction Use.
Algorithm Design Strategy Divide and Conquer. More examples of Divide and Conquer  Review of Divide & Conquer Concept  More examples  Finding closest.
Chapter 4 Divide-and-Conquer Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Chapter 4: Divide and Conquer The Design and Analysis of Algorithms.
Computational Geometry Overview from Cormen, et al. Chapter 33
Lecture 4: Divide and Conquer III: Other Applications and Examples Shang-Hua Teng.
5 - 1 § 5 The Divide-and-Conquer Strategy e.g. find the maximum of a set S of n numbers.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2002 Tuesday, 5/7/02 Computational Geometry Chapter 33.
Design and Analysis of Algorithms - Chapter 41 Divide and Conquer The most well known algorithm design strategy: 1. Divide instance of problem into two.
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.
1 Computational Geometry Instructor: yedeshi
A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
Computational Geometry Course Summary (First Half) Spring 2008 Pay special attention to: algorithm details (able to explain correctness and carry out a.
1 Closest Pair of Points (from “Algorithm Design” by J.Kleinberg and E.Tardos) Closest pair. Given n points in the plane, find a pair with smallest Euclidean.
Convex Hull. University of Manchester biologists used lasers to measure the minimum amount of skin required to wrap around the skeletons of modern-day.
Divide-and-Conquer. Outline Introduction Merge Sort Quick Sort Closest pair of points Large integer multiplication.
Kansas State University Department of Computing and Information Sciences Friday, July 13, 2001 Mantena V. Raju Department of Computing and Information.
CSE 421 Algorithms Lecture 15 Closest Pair, Multiplication.
15. Computational Geometry Topics
COMPUTATIONAL GEOMETRY AND MATRIX MULTIPLICATION Mohammed Zeeshan Farooqui Minhaj Uddin.
Convex Hull 2012/10/23. Convex vs. Concave A polygon P is convex if for every pair of points x and y in P, the line xy is also in P; otherwise, it is.
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.
MA/CSSE 473 Day 16 Answers to your questions Divide and Conquer
Convex Hull.
CSCE350 Algorithms and Data Structure
Algorithm design techniques Dr. M. Gavrilova
Computational Geometry (35/33)
Merge sort merge sort: Repeatedly divides the data in half, sorts each half, and combines the sorted halves into a sorted whole. The algorithm: Divide.
Computational Geometry for the Tablet PC
Richard Anderson Lecture 13 Divide and Conquer
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
CHAPTER 33 Computational Geometry
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.
Merge sort merge sort: Repeatedly divides the data in half, sorts each half, and combines the sorted halves into a sorted whole. The algorithm: Divide.
Computational Geometry Algorithms
Algorithms and Data Structures Lecture XIV
Given a list of n  8 integers, what is the runtime bound on the optimal algorithm that sorts the first eight? O(1) O(log n) O(n) O(n log n) O(n2)
Presentation transcript:

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 for Closest Pair.

Line Segments and cross-product (35.1/33.1) A segment is a convex combination of ends –p1 = (x1,y1) and p2 = (x2,y2) –x =  x1+ (1-  ) x2, y =  y1+ (1-  ) y2 –p =  p1+ (1-  ) p2 Cross product –p1  p2 = x1 y2 -x2 y1 – Vectors are collinear if p1 = c p2, cross-product=0 –The segment [p0p1] and [p0p2] turns left or right if (p1-p0)  (p2-p0) > 0 (<0) –Segment intersection: bounding boxes straddling

Segments and Sweep Line (35.2/33.2) Sweep line is an imaginary vertical line moving from left to right a1 is above a2 and a3 is above a2 a1 a2 a3

Finding the Closest Pair(35.4/33.4) Brute-force: O(n 2 ) Divide-and-conquer algorithm with recurrence T(n)=2T(n/2)+O(n) Divide: divide into almost equal parts by a vertical line which divides given x-sorted array X into 2 sorted subarrays Conquer: Recursively find the closest pair in each half of X. Let  = min{  left,  right } Combine: The closest pair is either in distance  or a pair of points from different halves.

Combine in D-a-C (35.4/33.4) Subarray Y’ (y-sorted) of Y with points in 2  strip  p  Y’ find all in Y’ which are closer than in  –no more than 8 in   2  rectangle –no more than 7 points can be closer than in  If the closest in the strip closer then it is the answer 22  left right 22 