Loading in 2 Seconds...

Finding the Largest Area Axis-Parallel Rectangle in a Polygon in O (n log 2 n) Time

Loading in 2 Seconds...

- By
**tuwa** - Follow User

- 184 Views
- Uploaded on

Download Presentation
## Finding the Largest Area Axis-Parallel Rectangle in a Polygon in O (n log 2 n) Time

**An Image/Link below is provided (as is) to download presentation**

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript

### Finding the Largest Area Axis-Parallel Rectangle in a Polygon in O(n log2 n) Time

MATHEMATICAL SCIENCES COLLOQUIUM

Prof. Karen Daniels

Wednesday, October 18, 2000

Computational

Geometry

Efficient

Geometric Algorithms

Design

Analyze

Theoretical

Computer

Science

Applied

Math

Applied Computer Science

Apply

Computational Geometryin ContextSubdivision

Maximum

Rectangle

Geometric Restriction

Ordered

Containment

Limited Gaps

Containment

Minimal

Enclosure

Core Algorithms

Maximal Cover

Application-Based Algorithms

Lattice

Packing

Two-Phase Layout

Column-Based Layout

Taxonomy of ProblemsSupporting Apparel Manufacturingn

n log2(n)

n log(n)

n a(n) log(n)

n5

2n

1

What’s the Problem?

- 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?

Summary of Algorithmic Results

for a Variety of Polygon Types

n a(n)

n

n log2(n)

n log(n)

n a(n) log(n)

n5

2n

1

Karen Daniels

Victor Milenkovic

Dan Roth

this

talk

W(n log(n))

- Establish O(n5) upper bound
- Characterize the Largest Rectangle (LR)
- examine cases based on polygon/LR contacts
- Reduce the O(n5) bound to O(n log2 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

Characterizing the LR

Independent Sliding Contact

Dependent Sliding Contacts

Fixed Contact

Reflex Contact

Contacts reduce degrees of freedom

Characterizing the LR (continued)

Maximization Problems for Sliding Contacts

1-parameter:

- Max. quadratic in 1 variable: O(1)
- 1 Independent Sliding Contact
- 2 Dependent Sliding Contacts
- 3 Dependent 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

O(n5) LR Algorithm

Find_LR(Polygon P)

area0 Find_LR_0_RC(P)

area1 Find_LR_1_RC(P)

area2 Find_LR_2_RC(P)

area3 Find_LR_3_RC(P)

area4 Find_LR_4_RC(P)

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 k 1 to n

for l 1 to n

area area of LR for 0-RC determining set for (i,j,k,l)

if LR is empty, then update maximum area

return maximum area

O(n5)

O(n)

- Establish O(n5) upper bound
- Characterize the Largest Rectangle (LR)
- examine cases based on polygon/LR contacts
- Reduce the O(n5) bound to O(n log2 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

A General Framework for the 2-Contact Case

b

c

b

c

a

1

2

3

24

27

1

10

2

15

24

14

3

20

15

6

A General Framework for the 2-Contact CaseArea Matrix M for “empty corner rectangles”

Definition: M is totally monotone if, for every i<i’ and j<j’ corresponding to a legal 2x2 minor, mij’ > mij implies mi’j’ > mi’j

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 Q(m+n) time.

LR is the Largest Empty Corner Rectangle (LECR)

A General Framework for the 2-Contact Case

P

Goal: reduce to the Largest Empty Corner Rectangle (LECR) problem

E’

V’

- 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 e V’ and every edge e e E’: if any point q e interior(e) is rectangularly visible from v inside P’, then all of e is rectangularly visible from v.
- Property III
- If vertex v e V’ and a point q e E’ are rectangularly visible with respect to vertices(P’), then v and q are rectangularly visible with respect to P’.

P’

Given vertically separated, y-monotone chains V, E of P, “orthogonalize” them

E

V

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.

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

Partitioning the polygon with a vertical line produces a vertically separated, horizontally convex polygon for the merge step of divide-and-conquer.

Theorem: The LR in an n-vertex general polygon can be found in O(n log2 n) time.

O(n log2 n) LR Algorithm

Find_LR(Polygon P)

preprocess P

H, V horizontal, vertical visibility maps of P

P P U internal vertex projections

return LR_DivideConquer(P, H, V)

LR_DivideConquer(P, H, V)

if P.numVertices is “too small”calculate & return LR area

Pleft , Pright left, right parts of P L [vertical partitioning line]

Hleft , Hleft , Vleft , Vright H, V updated for L

arealeft LR_DivideConquer(Pleft , Hleft , Vleft)

arearight LR_DivideConquer(Pright, Hright , Vright)

Q U1<=i<=k Qi[L may contain k partitions]

areaQ LR_HV_DivideConquer(Q)

return maximum(arealeft , arearight, areaQ )

O(n log n)

O(n log2 n)

T(n) < 2T( | n/2 |) + O(nlogn)

U

U

T( | n/2 |)

T( | n/2 |)

O(n log n)

point set, polygon

SmallestOuterCircle: Q(n)

LargestInnerRectangle: O(n log2(n))

polygon

point set

SmallestOuterRectangle: Q(n)

LargestInnerCircle: Q(n log n)

polygon

LargestInnerRectangle: W(n log n)

2n

1

n

n log(n)

n log2(n)

n5

Lower Bounds in ContextLR area is a solution to the MAX-GAP instance

self-intersecting,

orthogonal polygon

x2

x4

x1

x3

Establishing a Lower Bound of W(n log n)MAX-GAP instance: given n real numbers { x1, x2, ... xn } find the maximum difference between 2 consecutive numbers in the sorted list.

O(n) time transformation

LR algorithm must take as least as much time as MAX-GAP.

But, MAX-GAP is already known to be in W(n log n).

LR algorithm must take W(n log n) time

for self-intersecting polygons.

EVEN-DISTRIBUTION: given n real numbers { x1, x2, ... xn }

check if there exist adjacent xi, xj in the sorted list s.t. xj- xi > 1

O(n) time transformation

LR area is a solution to the EVEN-DISTRIBUTION instance

orthogonal polygon with degenerate holes

x2

x4

x1

x3

LR must take as least as much time as EVEN-DISTRIBUTION.

But, EVEN-DISTRIBUTION is already known to be in W(n log n).

LR algorithm must take W(n log n) time

for polygons with degenerate holes.

[McKenna et al. (85)]

Establishing a Lower Bound of W(n log n)Extend to non-degenerate holes using symbolic perturbation.

- Establish O(n log2 n) upper bound for LR
- Establish O(n5) upper bound
- Characterize the Largest Rectangle (LR)
- examine cases based on polygon/LR contacts
- Reduce the O(n5) bound to O(n log2 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 W(n log n) lower bound for LR

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
- 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

Download Presentation

Connecting to Server..