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.

Slides:



Advertisements
Similar presentations
Linear Inequalities in 2 Variables
Advertisements

Incremental Linear Programming Linear programming involves finding a solution to the constraints, one that maximizes the given linear function of variables.
LIAL HORNSBY SCHNEIDER
Linear Programming (LP) (Chap.29)
Approximations of points and polygonal chains
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
Dynamic Planar Convex Hull Operations in Near- Logarithmic Amortized Time TIMOTHY M. CHAN.
Linear Inequalities and Linear Programming Chapter 5 Dr.Hayk Melikyan/ Department of Mathematics and CS/ Linear Programming in two dimensions:
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 
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
Basic Feasible Solutions: Recap MS&E 211. WILL FOLLOW A CELEBRATED INTELLECTUAL TEACHING TRADITION.
Convexity of Point Set Sandip Das Indian Statistical Institute.
Query Processing in Databases Dr. M. Gavrilova.  Introduction  I/O algorithms for large databases  Complex geometric operations in graphical querying.
Advanced Topics in Algorithms and Data Structures Lecture pg 1 Recursion.
Advanced Topics in Algorithms and Data Structures Lecture 6.1 – pg 1 An overview of lecture 6 A parallel search algorithm A parallel merging algorithm.
Advanced Topics in Algorithms and Data Structures Page 1 Parallel merging through partitioning The partitioning strategy consists of: Breaking up the given.
CSCI 3160 Design and Analysis of Algorithms Tutorial 6 Fei Chen.
MIT and James Orlin © Nonlinear Programming Theory.
Advanced Topics in Algorithms and Data Structures 1 Lecture 4 : Accelerated Cascading and Parallel List Ranking We will first discuss a technique called.
Prune-and-search Strategy
Parallel Merging Advanced Algorithms & Data Structures Lecture Theme 15 Prof. Dr. Th. Ottmann Summer Semester 2006.
3.3 Linear Inequalities in Two Variables Objectives: Solve and graph a linear inequality in two variables. Use a linear inequality in two variables to.
6. 5 Graphing Linear Inequalities in Two Variables 7
Algebra 2 Chapter 3 Notes Systems of Linear Equalities and Inequalities Algebra 2 Chapter 3 Notes Systems of Linear Equalities and Inequalities.
Algebra 2 Chapter 3 Notes Systems of Linear Equalities and Inequalities Algebra 2 Chapter 3 Notes Systems of Linear Equalities and Inequalities.
Systems of Linear Equations and Inequalities (Chapter 3)
UNC Chapel Hill M. C. Lin Linear Programming Reading: Chapter 4 of the Textbook Driving Applications –Casting/Metal Molding –Collision Detection Randomized.
Linear Programming. Consider the following problem: A tailor has the following materials available in stock: 16 m 2 of cotton, 11 m 2 of silk and 15 m.
5 -1 Chapter 5 The Divide-and-Conquer Strategy A simple example finding the maximum of a set S of n numbers.
© The McGraw-Hill Companies, Inc., Chapter 6 Prune-and-Search Strategy.
Pareto Linear Programming The Problem: P-opt Cx s.t Ax ≤ b x ≥ 0 where C is a kxn matrix so that Cx = (c (1) x, c (2) x,..., c (k) x) where c.
Graphing Linear Inequalities in Two Variables Chapter 4 – Section 1.
Linear Inequalities in Two Variables Objectives: Solve and graph a linear inequality in two variables..
Copyright © 2013, 2009, 2005 Pearson Education, Inc. 1 5 Systems and Matrices Copyright © 2013, 2009, 2005 Pearson Education, Inc.
Linear Inequalities and Linear Programming Chapter 5 Dr.Hayk Melikyan Department of Mathematics and CS
1 Prune-and-Search Method 2012/10/30. A simple example: Binary search sorted sequence : (search 9) step 1  step 2  step 3  Binary search.
Notes 7.5 – Systems of Inequalities. I. Half-Planes A.) Given the inequality, the line is the boundary, and the half- plane “below” the boundary is the.
Linear Programming Problem. Definition A linear programming problem is the problem of optimizing (maximizing or minimizing) a linear function (a function.
4  The Simplex Method: Standard Maximization Problems  The Simplex Method: Standard Minimization Problems  The Simplex Method: Nonstandard Problems.
3.4: Linear Programming Objectives: Students will be able to… Use linear inequalities to optimize the value of some quantity To solve linear programming.
OR Chapter 8. General LP Problems Converting other forms to general LP problem : min c’x  - max (-c)’x   = by adding a nonnegative slack variable.
Chapter 4: Systems of Equations and Inequalities Section 4.7: Solving Linear Systems of Inequalities.
Chapter 3 Section 3.7 Graphing Linear Inequalities.
Common Intersection of Half-Planes in R 2 2 PROBLEM (Common Intersection of half- planes in R 2 ) Given n half-planes H 1, H 2,..., H n in R 2 compute.
Linear Programming Chap 2. The Geometry of LP  In the text, polyhedron is defined as P = { x  R n : Ax  b }. So some of our earlier results should.
Computational Geometry
Slide 4- 1 Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 1- 1 Copyright © 2010 Pearson Education, Inc. Publishing.
Linear Programming Many problems take the form of maximizing or minimizing an objective, given limited resources and competing constraints. specify the.
Lecture 3: Parallel Algorithm Design
Chapter 2 An Introduction to Linear Programming
Chapter 5 Linear Inequalities and Linear Programming
LESSON TOPIC: Graphing Linear Inequalities
Copyright © Cengage Learning. All rights reserved.
Query Processing in Databases Dr. M. Gavrilova
CSCE350 Algorithms and Data Structure
Algorithm design techniques Dr. M. Gavrilova
Linear Programming.
Chapter 5 Linear Inequalities and Linear Programming
Inequalities in Two Variables
I. The Problem of Molding
CMPS 3130/6130 Computational Geometry Spring 2017
Chapter 7: Systems of Equations and Inequalities; Matrices
Chapter 2. Simplex method
Graphical solution A Graphical Solution Procedure (LPs with 2 decision variables can be solved/viewed this way.) 1. Plot each constraint as an equation.
Chapter 2. Simplex method
Presentation transcript:

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 to their order on UH ( S 2 ). We allocate processors and divide the points on UH ( S 2 ) into intervals and do a parallel search. We can identify the point in time.

Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 2 Merging two upper hulls Suppose, the common tangent to UH ( S 1 ) and UH ( S 2 ) is the line. u is on UH ( S 1 ) and v is on UH ( S 2 ). If we know the line, we can say in O (1) time whether u is above or below the line.

Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 3 Merging two upper hulls Suppose, there are t points on UH ( S 1 ), given in an array according to their order on UH ( S 1 ). We divide these t points in intervals, each interval contains points. We now do a parallel search in the following ways.

Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 4 Merging two upper hulls We allocate processors for the parallel search. Suppose r i is the boundary vertex of one of the intervals. For each such r i, we can find the tangent to UH ( S 2 ) in O (1) time using processors.

Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 5 Merging two upper hulls u is to the left of (along the polygonal chain of UH(S )) if and only if is above

Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 6 Merging two upper hulls Hence, we can identify two boundary vertices r j and r k such that u is above r j and below r k. Hence, u must be one of the vertices in between r j and r k. This computation takes O (1) time and processors.

Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 7 Merging two upper hulls We can do a similar computation to find a group of vertices on UH ( S 2 ) in which v is a member. This computation again takes O (1) time and processors.

Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 8 Merging two upper hulls Now, we have vertices on UH ( S 2 ) and vertices on UH ( S 1 ). There are possible lines if we join one point from UH ( S 1 ) and one point from UH ( S 2 ). For each of these O ( n ) lines, we can check in O (1) time whether the line is a common tangent to UH ( S 1 ) and UH ( S 2 ).

Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 9 Merging two upper hulls Suppose, is one such line. u l and u r are the two neighboring vertices of u. Also, v l and v r are the two neighboring vertices of v. is the common tangent to both UH ( S 1 ) and UH ( S 2 ) if all the point u l, u r, v l, v r are below.

Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 10 Merging two upper hulls For each of the O ( n ) lines, we can check this condition in O (1) time. Hence, we can find a common tangent to UH ( S 1 ) and UH ( S 2 ) in O (1) time and O ( n ) work. We can form another array of vertices containing the vertices in UH ( S 1 )  UH ( S 2 ) by deleting some parts of the arrays of UH ( S 1 ) and UH ( S 2 ) and merging the remaining parts.

Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 11 The convex hull algorithm We solve the problem through a divide and conquer strategy. The depth of the recursion is O (log n ) and we can do the merging of the convex hulls at every level of the recursion in O (1) time and O ( n ) work. Hence, the overall time required is O (log n ) and the overall work done is O ( n log n ) which is optimal. We need the CREW PRAM model due to the concurrent reading in the parallel search algorithm.

Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 12 Intersection of half planes Consider a line L defined by the equation y = ax + b. L divides the entire plane into two half planes, H + ( L ) and H - ( L ). H + ( L ) consists of all the points ( ,  ) such that   a  + b. Similarly, H - ( L ) consists of all the points   a  + b. Intuitively, H + ( L ) is the set of points on or above the line L, And, H - ( L ) is the set of points on or below the line L.

Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 13 Intersection of half planes For a set of lines, the intersection of the positive half planes defined by these lines is a convex region. However, the intersection may or may not be bounded. Our aim is to compute the boundary of the intersection.

Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 14 Dual transform Let T be a transformation that maps a point p = ( a, b ) into the line T ( p ) defined by y = ax + b. The reverse transformation maps the line L : y = ax + b into the point T ( L ) = (- a, b ).

Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 15 A property Property: A point p is below a line L if and only if T ( p ) is below the point T ( L ). –Consider a set of lines L 1, L 2,…, L n, and the region C defined by  1  i  n H + ( L i ) –The region C consists of all the points above all the lines L i,1  i  n

Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 16 Intersection of half planes In the transformed domain, T ( C + ) = { T ( p ) | p  C + } consists of all the lines above all the points T ( L i ), for 1  i  n.

Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 17 Intersection of half planes The extreme points of the intersection of half planes are now the line segments between two consecutive vertices of the convex hull in the dual space.

Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 18 Intersection of half planes To compute the intersection of the half planes, we first convert the lines into their dual points. Then we compute the convex hull of these dual points. Finally, we get the extreme points of the intersection of half planes by converting the line segments between two consecutive extreme points of the convex hull into points.

Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 19 Intersection of half planes The transformations take O (1) time each if we allocate one processor for each line. The convex hull construction takes O (log n ) time and O ( n log n ) work on the CREW PRAM.

Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 20 Two variable linear program The two-variable linear program problem is defined as: Minimize cx + dy (Objective function) Subject to: a i x + b i y + c i  0, 1  i  n. (Constraints)

Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 21 Two variable linear programming Each constraint is a half plane. The feasible region is a set of points satisfying all the constraints. The solution of the linear program is a point in the feasible region that minimizes the objective function. The objective function is minimized at one of the extreme points of the feasible region.

Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 22 Two variable linear programming Hence, we can find all the O ( n ) extreme points of the feasible region by the half plane intersection algorithm. Then we can find the extreme point which minimizes the objective function. The algorithm takes O (log n ) time and O ( n log n ) work on the CREW PRAM.