Presentation is loading. Please wait.

Presentation is loading. Please wait.

Finding the Largest Area Axis-Parallel Rectangle in a Polygon in O(n log 2 n) Time MATHEMATICAL SCIENCES COLLOQUIUM Prof. Karen Daniels Wednesday, October.

Similar presentations


Presentation on theme: "Finding the Largest Area Axis-Parallel Rectangle in a Polygon in O(n log 2 n) Time MATHEMATICAL SCIENCES COLLOQUIUM Prof. Karen Daniels Wednesday, October."— Presentation transcript:

1 Finding the Largest Area Axis-Parallel Rectangle in a Polygon in O(n log 2 n) Time MATHEMATICAL SCIENCES COLLOQUIUM Prof. Karen Daniels Wednesday, October 18, 2000

2 Computational Geometry in Context Applied Computer Science Geometry TheoreticalComputerScience AppliedMath ComputationalGeometryEfficient Geometric Algorithms Design Analyze Apply

3 Taxonomy of Problems Supporting Apparel Manufacturing OrderedContainment Geometric Restriction Distance-BasedSubdivision MaximumRectangle Limited Gaps MinimalEnclosure Column-Based Layout Two-Phase Layout LatticePacking Containment Maximal Cover

4 A Common (sub)Problem Find a Good (and Convex) Approximation Outer Inner

5 ä Given a 2D polygon that: ä does not intersect itself ä may have holes ä has n vertices ä Find the Largest-Area Axis-Parallel Rectangle ä How “hard” is it? ä How “fast” can we find it? What’s the Problem? n 1 n log(n) n log 2 (n) 2n2n2n2n n5n5n5n5 n  (n) log(n) n  (n)

6 Related Work n 1 n log(n) n log 2 (n) 2n2n2n2n n5n5n5n5 n  (n) log(n) n  (n)

7 Related Work (continued) n 1 n log(n) n log 2 (n) 2n2n2n2n n5n5n5n5 n  (n) log(n) n  (n)

8 Summary of Algorithmic Results for a Variety of Polygon Types Karen Daniels Victor Milenkovic Dan Roth n 1 n log(n) n log 2 (n) 2n2n2n2n n5n5n5n5 n  (n) log(n) n  (n)   (n log(n)) thistalk

9 Establishing an Upper Bound of O(n log 2 n)

10 ä Establish O(n 5 ) upper bound ä Characterize the Largest Rectangle (LR) ä examine cases based on polygon/LR contacts ä Reduce the O(n 5 ) bound to O(n log 2 n) ä Develop a general framework for dominant case ä based on rectangular visibility and matrix total monotonicity ä Use divide-and-conquer: T(n) < 2T( | n/2 |) + O(nlogn) ä Apply the framework to obtain O(nlogn) for each level Approach

11 Characterizing the LR Fixed Contact Independent Sliding Contact Dependent Sliding Contacts Reflex Contact Contacts reduce degrees of freedom

12 Characterizing the LR (continued) # RC 43210 Determining sets of contacts

13 Characterizing the LR (continued) 1-parameter: ä Max. quadratic in 1 variable: O(1) ä 1 Independent Sliding Contact ä 2 Dependent Sliding Contacts ä 3 Dependent Sliding Contacts Maximization Problems for Sliding Contacts 2-parameter: ä Max. quadratic in 2 variables: O(1) ä At least one rectangle corner is at an endpoint of polygon edge ä Reduces to 4 1-parameter problems

14 O(n 5 ) LR Algorithm Find_LR(Polygon P) area0 Find_LR_0_RC(P) area0 Find_LR_0_RC(P) area1 Find_LR_1_RC(P) area1 Find_LR_1_RC(P) area2 Find_LR_2_RC(P) area2 Find_LR_2_RC(P) area3 Find_LR_3_RC(P) area3 Find_LR_3_RC(P) area4 Find_LR_4_RC(P) area4 Find_LR_4_RC(P) return maximum(area0, area1, area2, area3, area4) return maximum(area0, area1, area2, area3, area4)Find_LR_0_RC(P) for i 1 to n [for each edge of P] for j 1 to n for j 1 to n for k 1 to n for k 1 to n for l 1 to n for l 1 to n area area of LR for 0-RC determining set for (i,j,k,l) area area of LR for 0-RC determining set for (i,j,k,l) if LR is empty, then update maximum area if LR is empty, then update maximum area return maximum area return maximum area O(n) O(n 5 )

15 ä Establish O(n 5 ) upper bound ä Characterize the Largest Rectangle (LR) ä examine cases based on polygon/LR contacts ä Reduce the O(n 5 ) bound to O(n log 2 n) ä Develop a general framework for dominant case ä based on rectangular visibility and matrix total monotonicity ä Use divide-and-conquer: T(n) < 2T( | n/2 |) + O(nlogn) ä Apply the framework to obtain O(nlogn) for each level Approach

16 A General Framework for the 2-Contact Case Definition: M is totally monotone if, for every i m ij implies m i’j’ > m i’j 24 15 27 24bc a 1 2 3 10 14 6 20 15 ab c 1 2 3 Theorem [Aggarwal,Suri87]: If any entry of a totally monotone matrix of size mxn can be computed in O(1) time, then the row-maximum problem for this matrix can be solved in  (m+n) time. A General Framework for the 2-Contact Case Area Matrix M for “empty corner rectangles” LR is the Largest Empty Corner Rectangle (LECR)

17 A General Framework for the 2-Contact Case P ä Property I ä Polygonal regions P and P’ satisfy P’ P and each vertex-edge rectangle for P, V, and E is a vertex- edge rectangle for P’, V’, and E’. ä Property II  For every vertex v  V’ and every edge e  E’: if any point q  interior(e) is rectangularly visible from v inside P’, then all of e is rectangularly visible from v. ä Property III  If vertex v  V’ and a point q  E’ are rectangularly visible with respect to vertices(P’), then v and q are rectangularly visible with respect to P’. V E P’ V’ E’ Given vertically separated, y-monotone chains V, E of P, “orthogonalize” them U Goal: reduce to the Largest Empty Corner Rectangle (LECR) problem

18 Monotonicity and Aggarwal et al.’s matrix searching-based O(nlogn) algorithm for the LECR problem lead to the following: Lemma: The LR in an n-vertex vertically separated, horizontally convex polygon can be found in O(n log n) time. Goal: Produce a vertically separated, horizontally convex polygon for the merge step of divide-and-conquer. LR Algorithm for a General Polygon Lemma: If V’ and E’ are y-monotone, then M defined by our LR-measure (“area”) is totally monotone.

19 Theorem: The LR in an n- vertex general polygon can be found in O(n log 2 n) time. Partitioning the polygon with a vertical line produces a vertically separated, horizontally convex polygon for the merge step of divide-and-conquer. LR Algorithm for a General Polygon

20 O(n log 2 n) LR Algorithm Find_LR(Polygon P) preprocess P preprocess P H, V horizontal, vertical visibility maps of P H, V horizontal, vertical visibility maps of P P P U internal vertex projections P P U internal vertex projections return LR_DivideConquer(P, H, V) return LR_DivideConquer(P, H, V) LR_DivideConquer(P, H, V) if P.numVertices is “too small”calculate & return LR area P left, P right left, right parts of P L [vertical partitioning line] P left, P right left, right parts of P L [vertical partitioning line] H left, H left, V left, V right H, V updated for L H left, H left, V left, V right H, V updated for L area left LR_DivideConquer(P left, H left, V left ) area left LR_DivideConquer(P left, H left, V left ) area right LR_DivideConquer(P right, H right, V right ) area right LR_DivideConquer(P right, H right, V right ) Q U 1<=i<=k Q i [L may contain k partitions] Q U 1<=i<=k Q i [L may contain k partitions] area Q LR_HV_DivideConquer(Q) area Q LR_HV_DivideConquer(Q) return maximum(area left, area right, area Q ) return maximum(area left, area right, area Q ) O(n log n) U U O(n log 2 n) O(n log n) T(n) < 2T( | n/2 |) + O(nlogn) T( | n/2 |)

21 Establishing a Lower Bound of  (n log n)

22 Lower Bounds in Context n1 n log(n) n log 2 (n) 2n2n2n2n n5n5n5n5 SmallestOuterRectangle:   (n) SmallestOuterCircle:   (n) LargestInnerRectangle:   (n log n) LargestInnerCircle:   (n log n) point set, polygon point set polygon LargestInnerRectangle:   (n log 2 (n))polygon

23 Establishing a Lower Bound of  (n log n) MAX-GAP instance: given n real numbers { x 1, x 2,... x n } find the maximum difference between 2 consecutive numbers in the sorted list. O(n) time transformation self-intersecting, orthogonal polygon x2x2x2x2 x4x4x4x4 x3x3x3x3 x1x1x1x1 LR area is a solution to the MAX-GAP instance LR algorithm must take as least as much time as MAX-GAP. But, MAX-GAP is already known to be in  (n log n). LR algorithm must take  (n log n) time for self-intersecting polygons.

24 Establishing a Lower Bound of  (n log n) EVEN-DISTRIBUTION: given n real numbers { x 1, x 2,... x n } check if there exist adjacent x i, x j in the sorted list s.t. x j - x i > 1 LR must take as least as much time as EVEN-DISTRIBUTION. But, EVEN-DISTRIBUTION is already known to be in  (n log n). LR algorithm must take  (n log n) time for polygons with degenerate holes. [McKenna et al. (85)] O(n) time transformation orthogonal polygon with degenerate holes x2x2x2x2 x4x4x4x4 x3x3x3x3 x1x1x1x1 LR area is a solution to the EVEN- DISTRIBUTION instance Extend to non-degenerate holes using symbolic perturbation.

25 ä Establish O(n log 2 n) upper bound for LR ä Establish O(n 5 ) upper bound ä Characterize the Largest Rectangle (LR) ä examine cases based on polygon/LR contacts ä Reduce the O(n 5 ) bound to O(n log 2 n) ä Develop a general framework for dominant case ä based on rectangular visibility and matrix total monotonicity ä Use divide-and-conquer: T(n) < 2T( | n/2 |) + O(nlogn) ä Apply the framework to obtain O(nlogn) for each level  Establish  (n log n) lower bound for LR Summary

26 For More Information ä Computational Geometry: ä Graduate CS course in Computational Geometry to be offered at UMass Lowell in Spring ‘01 ä Introductory texts: ä Computational Geometry in C (O’Rourke) ä Computational Geometry: An Introduction (Preparata & Shamos) ä Bibliography: ftp://ftp.cs.usask.ca/pub/geometry/ ä Software:http://www.geom.umn.edu/software/cglist/ ä My research: ä http://www.cs.uml.edu/~kdaniels http://www.cs.uml.edu/~kdaniels ä Journal paper: “Finding the largest area axis-parallel rectangle in a polygon” ä (Computational Geometry: Theory and Applications) ä Prof. Victor Milenkovic: Frequent co-author and former PhD advisor ä http://www.cs.miami.edu/~vjm http://www.cs.miami.edu/~vjm


Download ppt "Finding the Largest Area Axis-Parallel Rectangle in a Polygon in O(n log 2 n) Time MATHEMATICAL SCIENCES COLLOQUIUM Prof. Karen Daniels Wednesday, October."

Similar presentations


Ads by Google