Computational Geometry - Part II Mohammed Nadeem Ahmed Raghavendra Kyatham.

Slides:



Advertisements
Similar presentations
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.
Advertisements

Lecture 3: Parallel Algorithm Design
Chan’s Algorithm It is Jarvis’s march applied to big blobs of points.
Jarvis March Graham Scan Chan’s Algorithm
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.
algorithms and data structures
Convex Hull obstacle start end Convex Hull Convex Hull
CS16: Introduction to Data Structures & Algorithms
C o m p u t i n g C O N V E X H U L L S by Kok Lim Low 10 Nov 1998 COMP Presentation.
The Divide-and-Conquer Strategy
Divide-and-Conquer Matrix multiplication and Strassen’s algorithm Median Problem –In general finding the kth largest element of an unsorted list of numbers.
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
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Divide and Conquer.
Lecture 2: Divide and Conquer algorithms Phan Thị Hà Dương
Convex Hulls May Shmuel Wimer Bar Ilan Univ., Eng. Faculty Technion, EE Faculty.
Convex Sets & Concave Sets A planar region R is called convex if and only if for any pair of points p, q in R, the line segment pq lies completely in R.
1 Convex Hull in Two Dimensions Jyun-Ming Chen Refs: deBerg et al. (Chap. 1) O’Rourke (Chap. 3)
Computational Geometry
Lecture 3: Reduce to known problem Convex Hull (section 33.3 of CLRS). Suppose we have a bunch of points in the plane, given by their x and y coordinates.
Advanced Algorithm Design and Analysis (Lecture 10) SW5 fall 2004 Simonas Šaltenis E1-215b
Computational Geometry for the Tablet PC
Informal Definition : Let S is set of nails sticking out from a board. the convex hull can be visualized as the shape formed by a tight rubber band that.
1 Today’s Material Computational Geometry Problems –Closest Pair Problem –Convex Hull Jarvis’s March, Graham’s scan –Farthest Point Problem.
5/17/2015 1:32 AMConvex Hull1 obstacle start end.
ICS 415 Computer Graphics Bézier Splines (Chapter 8)
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 Lecture 3 Chapter 3: 2D Convex Hulls Friday,
Divide-and-Conquer Matrix multiplication and Strassen’s algorithm.
Convex Hull Computation ● Applications of Convex Hull Computation ● Definitions ● Basic Math Functions ● Algorithms Algorithm Speed Discovered By Brute.
Advanced Algorithm Design and Analysis (Lecture 9) SW5 fall 2004 Simonas Šaltenis E1-215b
CSE53111 Computational Geometry TOPICS q Preliminaries q Point in a Polygon q Polygon Construction q Convex Hulls Further Reading.
Curve Modeling Bézier Curves
Divide and Conquer.
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.
MA/CSSE 473 Day 17 Divide-and-conquer Convex Hull Strassen's Algorithm: Matrix Multiplication.
5 -1 Chapter 5 The Divide-and-Conquer Strategy A simple example finding the maximum of a set S of n numbers.
Data Structures and Algorithms A. G. Malamos
Project 2 due … Project 2 due … Project 2 Project 2.
C o m p u t i n g C O N V E X H U L L S. Presentation Outline 2D Convex Hulls –Definitions and Properties –Approaches: Brute Force Gift Wrapping QuickHull.
Fundamental Data Structures and Algorithms Klaus Sutner April 27, 2004 Computational Geometry.
Fundamental Data Structures and Algorithms Margaret Reid-Miller 27 April 2004 Computational Geometry.
Convex Hull. University of Manchester biologists used lasers to measure the minimum amount of skin required to wrap around the skeletons of modern-day.
Kansas State University Department of Computing and Information Sciences Friday, July 13, 2001 Mantena V. Raju Department of Computing and Information.
Divide and Conquer (Part II) Multiplication of two numbers Let U = (u 2n-1 u 2n-2 … u 1 u 0 ) 2 and V = (v 2n-1 v 2n-2 …v 1 v 0 ) 2, and our goal is to.
COMPUTATIONAL GEOMETRY AND MATRIX MULTIPLICATION Mohammed Zeeshan Farooqui Minhaj Uddin.
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.
CSE 421 Algorithms Richard Anderson Lecture 13 Recurrences, Part 2.
Convex Hulls Guo Qi, Chen Zhenghai, Wang Guanhua, Shen Shiqi, Himeshi De Silva.
Lecture 3: Parallel Algorithm Design
Convex Hull R.L. Graham’s Algorithm Computer Graphics.
Fill Area Algorithms Jan
Convex Hull.
CSCE350 Algorithms and Data Structure
Convex Hull obstacle start end 11/21/2018 4:05 AM Convex Hull
Computational Geometry (35/33)
Convex Sets & Concave Sets
Computational Geometry for the Tablet PC
Richard Anderson Lecture 13 Recurrences and Divide and Conquer
Richard Anderson Lecture 12 Recurrences and Divide and Conquer
Richard Anderson Lecture 13 Recurrences, Part 2
CMPS 3130/6130: Computational Geometry Spring 2017
Introduction to Algorithms
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.
CMPS 3120: Computational Geometry Spring 2013
Convex Hull obstacle start end 4/30/2019 5:21 PM Convex Hull
Kruskal’s Algorithm AQR.
Computational Geometry Algorithms
Richard Anderson Lecture 13, Winter 2019 Recurrences, Part 2
Convex Hull - most ubiquitous structure in computational geometry
Presentation transcript:

Computational Geometry - Part II Mohammed Nadeem Ahmed Raghavendra Kyatham

Table of Contents Convex Hull 1. Jarvis’s March (Gift Wrapping Algorithm) 2. Graham’s Scan Matrix Multiplication 1. Strassen’s Multiplication Algorithm 2. Analysis of Strassen’s

Convex Hull Definition: The Convex Hull of a set Q of points is the smallest convex polygon P, for which each point in Q is either on the boundary of P or in its interior. Intuition: If there is a plane Q, consisting of nails sticking out from a board. Then the Convex Hull of Q can be thought of the shape formed by a tight rubber band that surrounds all the nails.

Example of Convex Hull Po P1 P3 P10 P12 P11 P9 P6 P7 P8 P5 P4 P2

Jarvis’s March Jarvis March computes the Convex Hull of a set Q of points by a technique called package wrapping or gift wrapping. Intuitively Jarvis March simulates a taut piece of paper around the set Q. To get the turning we take an “anchor” point then make a line with every other point and select the one with the least angle and keep on repeating. The algorithm runs in time O(nh) where h is the number of vertices

Example of Jarvis March P1 P9 P7 P2 P6 P3 P5 P4 P8 P0 Jarvis March’s algorithm starts from P0 ie the anchor point. Then it wraps the next outer point and makes this as the new anchor point and repeats the procedure for the rest of the points……. Till every point is wrapped inside.

Graham’s Scan Graham Scan algorithm starts by taking the leftmost point. From this point calculate the angles to all other points Sort all the angles Start plotting to the next points Whenever it takes right turns it backtracks and re-joins those points that makes the shortest path.

Example: As shown, Grahams starts from a point (p0) and calculates all the angles it makes to all the points and sorts the angles in an order

Example contd: It selects the point with the least angle and starts traversing (P0- P1). Then P1 to P2 & from P2 to P3 it realizes that it takes a right turn, so it backtracks and selects P1 – P3 directly, it being shorter

Example contd: The algorithm continues, based on the above mentioned conditions till it reaches back to the initial point. Hence forming the Convex Hull as shown:

Example contd:

Once the initial point is reached the algorithm self terminates, and the Convex Hull is formed. The algorithm takes O(nlgn) i.e the time it takes to sort the angles.

Strassen’s algorithm The regular matrix multiplication algorithm takes O(n 3 ). But strassen’s algorithm uses dynamic programming to compute the matrix multiplication in O(n 2.81 ).

Strassen’s explained: Suppose there are two matrices A and B giving the product matrix C. Then each matrix is divided into four sections as shown. ab dc ef hg rs ut = AB C

Strassen’s contd: The product matrix C can be defined by the following equations: r=ae+bg s=af+bh t=ce+dg u=cf+df rs ut C

strassen’s contd: Each of the above entities in the previous equations take T(n/2) time. Since we have eight such multiplications it takes 8T(n/2)+O(n 2 ), but strassen’s uses dynamic programming to reduce the number of multiplications to seven. Thus we have 7T(n/2)+O(n 2 ).

Strassen’s explained: s= af+bh = af-ah+ah+bh = a(f-h) + h(a+b) p1 p2 s= p1+p2 p1 takes T(n/2)+O(n 2 ) p2 also takes T(n/2)+O(n 2 ).

Strassen’s contd: t= ce+dg = ce-de+de+dg = e(c-d) + d(e+g) p3 p4 t= p3+p4 p3 takes T(n/2)+O(n 2 ) p4 also takes T(n/2)+O(n 2 ).

Strassen’s contd: r= ae+bg p5= (a+d) (e+h) = ae+ah+de+dh. p5 computes the inessential terms ah and de, which need to be cancelled some how. We can use p4 and p2 to cancel them, but two other inessential terms appear so hence we use p6 to cancel them. p5 +p4-p2= ae+dh+dg-bh And p6 is given as (b-d) (g+h) P6= bg+bh-dg-dh. Thus we obtain r= p5+p4-p2+p6 = ae+bg. (hence achieved)

Strassen’s contd: Similarly we obtain ‘u’ from p5 by using p1 and p3 to remove the inessential terms from p5. We have p5+p1-p3 = ae+af-ce+dh and p7 is given as p7= (a-e) (e+f) = ae+af-ce-cf Leading us to u = p5+p1-p3-p7 = cf+dh

Strassen’s analysis Thus we computed only seven multiplications from p1- p7 using seven recursive calls. Thus T(n)= 7T(n/2)+(n 2 ). Expanding: n 2 (………(7/2 2 ) 3 + (7/2 2 ) 2 + 7/ ) we have logn such terms that can be represented by the formula a.r n r - 1

Strassen’s contd: Using the above formula we can simplify the series to (7/4) logn + O(n 2 ) This can also be represented as: = n log7/4 + O(n 2 ) = n log7-log4 + O(n 2 ) = n log7-2 + O(n 2 ) = n log7 /n 2 + O(n 2 ) = n 2 (n log7 /n 2 ) = n log7 Thus we get the complexity O(n log7 ) = O(n 2.81 ).