slide1 n.
Skip this Video
Download Presentation
Lecture 2 Chapter 2: Polygon Partitioning Chapter 3: 2D Convex Hulls Monday, 2/12/01

Loading in 2 Seconds...

play fullscreen
1 / 21

Lecture 2 Chapter 2: Polygon Partitioning Chapter 3: 2D Convex Hulls Monday, 2/12/01 - PowerPoint PPT Presentation

  • Uploaded on

UMass Lowell Computer Science 91.504 Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2001. Lecture 2 Chapter 2: Polygon Partitioning Chapter 3: 2D Convex Hulls Monday, 2/12/01. Chapter 2. Polygon Partitioning useful for triangulations and many other uses!.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'Lecture 2 Chapter 2: Polygon Partitioning Chapter 3: 2D Convex Hulls Monday, 2/12/01' - gray-gould

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

UMass Lowell Computer Science 91.504Advanced AlgorithmsComputational GeometryProf. Karen DanielsSpring, 2001

Lecture 2

Chapter 2: Polygon Partitioning

Chapter 3: 2D Convex Hulls

Monday, 2/12/01

chapter 2

Chapter 2

Polygon Partitioning

useful for triangulations

and many other uses!

monotone partitioning
Monotone Partitioning
  • A chain is monotone with respect to a line L if every line orthogonal to L intersects the chain in at most 1 point
  • P is monotone with respect to a line L if boundary of P can be split into 2 polygonal chains A and B such that each chain is monotone with respect to L
  • Monotonicity implies sorted order with respect to L
  • Monotone polygon can be (greedily) triangulated in O(n) time
  • Partition into trapezoids
  • Horizontal line through each vertex
  • Diagonal with each “supporting” vertex yields monotone partition
  • To trapezoidalize, vertically sweep a lineL
    • presort vertices by y (O(nlogn) time)
    • maintain sorted list of edges intersecting L
      • lg n lookup/insert/delete time (e.g. ht-balanced tree)
    • for each vertex
      • find edge left and right along sweep line


Sort vertices by y coordinate

Perform plane sweep to construct trapezoidalization

Partition into monotone polygons by connecting from interior cusps

Triangulation each monotone polygon in O(n) time

O(n lg n)

partition into monotone mountains
Partition into Monotone Mountains
  • One monotone chain is a single segment
  • Every strictly convex vertex is an ear tip (except maybe base endpoints)


Identify base edge

Initialize internal angles at each nonbase vertex

Link nonbase strictly convex vertices into a list

while list nonempty do

For convex vertex b, remove triangle abc

Output diagonal ac

Update angles and list


linear time triangulation
Linear-Time Triangulation

Year Complexity Authors

linear time triangulation1
Linear-Time Triangulation
  • Chazelle’s Algorithm (High-Level Sketch)
    • Computes visibility map
      • horizontal chords left and right from each vertex
    • Algorithm is like MergeSort (divide-and-conquer)
      • Partition polygon of n vertices into n/2 vertex chains
      • Merge visibility maps of subchains to get one for chain
    • Improve this by dividing process into 2 phases:

1) Coarse approximations of visibility maps for linear-time merge

2) Refine coarse map into detailed map in linear time

seidel s randomized triangulation
Seidel’s Randomized Triangulation
  • Simple, practical algorithm
  • Randomized: Coin-flip for some decisions
  • Build trapezoidalization quickly
    • O(log n) expected cost for locating point in query structure
    • Coin-flip to decide which segment to add next

Trapezoidalize -> Monotone Mountain -> Triangulate

convex partitioning
Convex Partitioning
  • Competing Goals:
    • minimize number of convex pieces
    • minimize partitioning time
  • To add points or not add points?

Theorem (Chazelle): Let F be the fewest number of convex pieces into which a polygon may be partitioned. For a polygon of r reflex vertices:

chapter 3

Chapter 3

2D Convex Hulls

convexity convex hulls

nonconvex polygon

convex hull of a point set

Convexity & Convex Hulls
  • A convex combination of points x1, ..., xk is a sum of the form a1x1+...+ akxk where
  • Convex hull of a set of points is the set of all convex combinations of points in the set.
naive algorithms for extreme points


for each i do

for each j = i do

for each k = j = i do

for each L = k = j = i do

if pL in triangle(pi, pj, pk)

then pL is nonextreme


for each i do

for each j = i do

for each k = j = i do

if pk is not left or on (pi, pj)

then (pi , pj) is not extreme


Naive Algorithms for Extreme Points


gift wrapping



i0 index of the lowest point

i i0


for each j = i

Compute counterclockwise angle q from previous hull edge

k index of point with smallest q

Output (pi , pk) as a hull edge

i k

until i = i0


Gift Wrapping
  • Use one extreme edge as an anchor for finding the next



Algorithm: QUICK HULL

function QuickHull(a,b,S)

if S = 0 return()


c index of point with max distance from ab

A points strictly right of (a,c)

B points strictly right of (c,b)

return QuickHull(a,c,A) + (c) + QuickHull(c,b,B)


  • Concentrate on points close to hull boundary
  • Named for similarity to Quicksort
graham s algorithm

Algorithm: GRAHAM SCAN, Version B

Find rightmost lowest point; label it p0.

Sort all other points angularly about p0.

In case of tie, delete point(s) closer to p0.

Stack S (p1, p0) = (pt, pt-1); t indexes top

i 2

while i < n do

if pi is strictly left of pt-1pt

then Push(pi, S) and set i i +1

else Pop(S)



Graham’s Algorithm
  • Points sorted angularly provide “star-shaped” starting point
  • Prevent “dents” as you go via convexity testing
lower bound of o nlgn
Lower Bound of O(nlgn)
  • Worst-case time to find convex hull of n points in algebraic decision tree model is in W(nlgn)
  • Proof uses sorting reduction:
    • Given unsorted list of n numbers: (x1,x2 ,…, xn)
    • Form unsorted set of points: (xi, xi2) for each xi
    • Convex hull of points produces sorted list!
      • Parabola: every point is on convex hull
    • Reduction is O(n) (which is o(nlgn))
    • Finding convex hull of n points is therefore at least as hard as sorting n points, so worst-case time is in W(nlgn)

Parabola for sorting 2,1,3

incremental algorithm
Incremental Algorithm
  • Add points, one at a time
    • update hull for each new point
  • Key step becomes adding a single point to an existing hull.
  • Idea is extended to 3D in Chapter 4.


Let H2 ConvexHull{p0 , p1 , p2 }

for k 3 to n - 1 do

Hk ConvexHull{ Hk-1 U pk }


can be improved to O(nlgn)

divide and conquer
  • Divide-and-Conquer in a geometric setting
  • O(n) merge step is the challenge
    • Find upper and lower tangents
    • Lower tangent: find rightmost pt of A & leftmost pt of B; then “walk it downwards”
  • Idea is extended to 3D in Chapter 4.



Algorithm: DIVIDE-and-CONQUER

Sort points by x coordinate

Divide points into 2 sets A and B:

A contains left n/2 points

B contains right n/2 points

Compute ConvexHull(A) and ConvexHull(B) recursively

Merge ConvexHull(A) and ConvexHull(B)



HW# Assigned DueContent

  • Fri, 2/9 Wed, 2/14 Chapter 1 (O’Rourke)

problems 1 & 2

Extra credit may be turned in any time during week of 2/12

  • Mon, 2/12 Wed, 2/21 Chapters 2,3 (O’Rourke)

problems 1 & 2

Extra credit may be turned in any time during week of 2/21

machine accounts
Machine Accounts
  • Each student has an account on my machine:
  • Username is the same as your username on CS
  • Password is your initials followed by the last 5 digits on the bottom right hand corner of the back of your student id card (1 exception)
  • To remotely log in, use a secure shell (e.g. ssh)
  • To transfer files, use a secure FTP (e.g. sftpc)
    • Saturn has an sftpc client
  • Code to use with assignments will be there.
preparing for homework 2
Preparing for Homework 2
  • Graham Scan 2D Convex Hull Code
  • Background on research problem that motivates problem 2