COMPUTATIONAL GEOMETRY AND MATRIX MULTIPLICATION Mohammed Zeeshan Farooqui Minhaj Uddin.

Slides:



Advertisements
Similar presentations
Computational Geometry - Part II Mohammed Nadeem Ahmed Raghavendra Kyatham.
Advertisements

CS 450: COMPUTER GRAPHICS FILLING POLYGONS SPRING 2015 DR. MICHAEL J. REALE.
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.
Lecture 3: Parallel Algorithm Design
Jarvis March Graham Scan Chan’s Algorithm
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
Convex Hulls in Two Dimensions Definitions Basic algorithms Gift Wrapping (algorithm of Jarvis ) Graham scan Divide and conquer Convex Hull for line intersections.
Ruslana Mys Delaunay Triangulation Delaunay Triangulation (DT)  Introduction  Delaunay-Voronoi based method  Algorithms to compute the convex hull 
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Divide and Conquer.
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.
Classes of Polygons Planar polygons Non-planar polygons Simple
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
8/29/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Spring 2006 Convex Hulls Carola Wenk.
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.
Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.
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.
Algorithms and Data Structures Lecture 13. Agenda: Plane Geometry: algorithms on polygons - Verification if point belongs to a polygon - Convex hull.
5/17/2015 1:32 AMConvex Hull1 obstacle start end.
What does that mean? To get the taste we will just look only at some sample problems... [Adapted from S.Suri]
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 Lecture 3 Chapter 3: 2D Convex Hulls Friday,
5 - 1 § 5 The Divide-and-Conquer Strategy e.g. find the maximum of a set S of n numbers.
Convex Hull Computation ● Applications of Convex Hull Computation ● Definitions ● Basic Math Functions ● Algorithms Algorithm Speed Discovered By Brute.
Geometric Algorithms1 segment intersection orientation point inclusion simple closed path.
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
Computational Geometry Convex Hulls Robust Geometric Primitives Degeneracy and Stability Nick Pilkington.
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.
Part 6: Graphics Output Primitives (4) 1.  Another useful construct,besides points, straight line segments, and curves for describing components of a.
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.
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.
CMPS 3120: Computational Geometry Spring 2013
Convex Hull. University of Manchester biologists used lasers to measure the minimum amount of skin required to wrap around the skeletons of modern-day.
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. Otherwise, it is called concave.
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.
Convex Hulls Guo Qi, Chen Zhenghai, Wang Guanhua, Shen Shiqi, Himeshi De Silva.
Computer Graphics Lecture 08 Taqdees A. Siddiqi Computer Graphics Filled Area Primitives I Lecture 08 Taqdees A. Siddiqi
Lecture 3: Parallel Algorithm Design
Introduction to Polygons
Computer Graphics CC416 Week 13 Clipping.
Computer Graphics Filled Area Primitives II Lecture 09 Taqdees A
Convex Hull R.L. Graham’s Algorithm Computer Graphics.
Fill Area Algorithms Jan
Convex Hull.
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
Convex Hull 1/1/ :28 AM Convex Hull obstacle start end.
CHAPTER 33 Computational Geometry
CMPS 3130/6130: Computational Geometry Spring 2017
CMPS 3120: Computational Geometry Spring 2013
Convex Hull obstacle start end 4/30/2019 5:21 PM Convex Hull
Introduction to Algorithms
Computational Geometry Algorithms
Computational Geometry
Convex Hull - most ubiquitous structure in computational geometry
Presentation transcript:

COMPUTATIONAL GEOMETRY AND MATRIX MULTIPLICATION Mohammed Zeeshan Farooqui Minhaj Uddin

UTA COMPUTATIONAL GEOMETRY Data is defined as points, lines, surfaces, polygons etc. Convex Non-convex  Convex Polygon has every in degree less than 180  Non Convex Polygon may have one or more in degrees greater than 180

UTA Computational Geometry – Position of Point Problem: To determine whether a given point lies outside or inside a given polygon. Answer: Yes if the point lies inside the polygon, No otherwise Solution: Draw a line along the X –axis from the point in one direction i.e. the line can have a increasing as well as decreasing X – axis. If the line thus drawn intersects ONLY once with any edge of the polygon then the point lies inside the polygon else it lies outside the polygon

UTA Computational Geometry – Position of Point (..contd.) Example: _ _ _ _ _ _ _ _ _ __ _ _.P The above point intersects only once with an edge of the polygon hence it lies inside polygon

UTA Computational Geometry – Position of Point (…contd) Example: _ _.P___ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _.P _ _ (a) (b) (a)The line extending from point P intersects the polygon edges more than once (twice in this Example), hence P lies outside the polygon (b) In case of Non Convex Polygon, a given point lies inside the polygon if the line segment Extending from it intersects the polygon edges an ODD number of times else it lies outside

UTA Convex Hulls Informally,Convex hull is defined as an Convex Polygon whose vertices come from the original points and its perimeter encapsulates all the points. 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. 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

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

UTA Convex Hull – Jarvis March Convex Hull  Jarvis March  Graham Scan Jarvis March: Computation of Convex Hull  For Every Point, join with all the original points and for the resulting line segments compute the angle with respect to origin, the smallest angle thus obtained gives the next point.  Running time is O(n 2 )  Actual running time is O(n*h), where h is the number of points on the convex hull.

UTA Convex Hull – Jarvis March (…contd.) 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.

UTA Convex Hull – Graham Scan Graham Scan – Computation of Convex Hull  Sort angles in counter clock wise direction  Create Polygon by connecting points in sorted order  Thereby a Non Convex Polygon results( Could also be convex)  Now wrap the above Non – Convex polygon by a convex polygon.

UTA Convex Hull – Graham Scan (…contd.) Algorithm (Package Wrapping or Gift Wrapping)  Start from bottom i.e. left most point going counter clockwise  Join with the next point in the counter clock wise direction so long as the resulting line segment makes left turns (>180) it will be included.  If the line segment forms an angle <180, then discard current path, walk back to the previous points and join successfully with new points and measure the resulting angle.  Running time is O(nlogn), as walking around takes 2n, since each is traversed only twice in the worst case and once the edge is dropped it is never again considered and the sorting of angles takes O(logn), hence the resulting running time is O(nlongn)

UTA Convex Hull – Graham Scan (…contd.) 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

UTA Convex Hull – Graham Scan (…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

UTA Convex Hull – Graham Scan (…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:

UTA Convex Hull – Graham Scan (…contd.)

Once the initial point is reached the algorithm self terminates, and the Convex Hull is formed.

UTA Multiplication of Large Numbers Matrix Multiplication: Traditional method Takes O(n 2 ) time Traditional Method Given two matrices A and B compute their product. A B

UTA Multiplication of Large Numbers (…contd.)  Divide the two arrays into two parts each, A into A l and A r, and B into B l and B r.  A l A r  B l B r

UTA Multiplication of Large Numbers (…contd.) A = A l 10 n/2 + A r B = B l 10 n/2 + B r A.B = (A l 10 n/2 + A r )( B l 10 n/2 + B r ) = A l B l 10 n + A l B r 10 n/2 + A r B l 10 n/2 + A r B r Time Complexity : T(n) T(n) = 4T(n/2) + O(n) = O(n 2 )

UTA Multiplication of Large Numbers (…contd.) The goal is to reduce the time complexity from O(n 2 ). The intuition is that since we use recursion in our multiplication of the equation, if we can reduce the number of calls to the recursive function Multiply(x,y) the overall complexity of the problem can be significantly reduced.

UTA Multiplication of Large Numbers (…contd.) Consider the equation from the previous slide: A l B l 10 n + A l B r 10 n/2 + A r B l 10 n/2 + A r B r This equation can be re-arranged as under: A l B l 10 n/2 + (A l B r + A r B l )10 n/2 + A r B r Now, we call the multiplication function Mult(X,Y) recursively as follows:  X = Mult(A l,B l )  Y = Mult(A r,B r )  P = A l + A r  Q = B l + B r

UTA Multiplication of Large Numbers (…contd.) Z = Mult(p,q) U = Z – X – Y Return: X10n + U10n/2 + Y, Where X10n = A l B l 10 n/2 U10n/2 = (A l B r + A r B l )10 n/2 Y = A r B r Thus, in this approach we have replaced four calls to the Mult(X,Y) function in the traditional method to three calls.

UTA Multiplication of Large Numbers (…contd.) Thus the resulting time complexity is: T(n) = 3T(n/2) + O(n) = 3[3T(n/2 2 ) + n/2] + n = 3 2 T(n/2 2 ) + 3n/2 + n = nlog 2 3 = n 1.7