Docsity

Optimal and Greedy Triangulation Algorithms: Delaunay, Voronoi, and Plane-Sweep - Prof. Ha, Study notes of Data Structures and Algorithms

Partial preview of the text

Download Optimal and Greedy Triangulation Algorithms: Delaunay, Voronoi, and Plane-Sweep - Prof. Ha and more Study notes Data Structures and Algorithms in PDF only on Docsity!

tg

Copyright © 1997 Hanan Samet

These notes may not be reproduced by any means (mechanical or elec- tronic or any other) without the express written permission of Hanan Samet

TRIANGULATIONS

Hanan Samet

Computer Science Department and Center for Automation Research and Institute for Advanced Computer Studies University of Maryland College Park, Maryland 20742 e-mail: [email protected]

tg

TRIANGULATION

  1. Find a complete set of minimal clusters of locations in a scattered data set
  2. Sample triangulation

1 b

Copyright © 1998 by Hanan Samet

tg

TRIANGULATION

  1. Find a complete set of minimal clusters of locations in a scattered data set
  2. Sample triangulation

1 b

Copyright © 1998 by Hanan Samet

(^2) tg r

  • bad triangulation

Copyright © 1998 by Hanan Samet

(^3) tg z

  • good triangulation

Copyright © 1998 by Hanan Samet

tg

TRIANGULATION

  1. Find a complete set of minimal clusters of locations in a scattered data set
  2. Sample triangulation

1 b

Copyright © 1998 by Hanan Samet

(^2) tg r

  • bad triangulation

Copyright © 1998 by Hanan Samet

(^3) tg z

  • good triangulation

Copyright © 1998 by Hanan Samet

(^4) tg g

  1. Thin triangles are often undesirable (e.g., terrain modeling)
    • involve one or two very small angles which result from connecting vertices using a distance that is much longer than that which can be obtained through the use of more equiangular angles a. two very small interior angles, or b. one very small angle and two angles close to 90°
    • elevation values at the vertices of the triangles are used to interpolate (e.g., a weighted average) a surface at a

pointp in the plane

a. use the vertices of the triangle containingp

b. the longer and thinner the triangles, the further away are the vertices of the triangles serving as the basis of the triangulation and the higher the likelihood of error

Copyright © 1998 by Hanan Samet

tg

INTUITIVE TRIANGULATION PROCEDURES

  • Start with an arbitrary triangulation
    1. finite set of points (triangle vertices)
    2. form a finite collection of line segments (triangle edges)
    3. form a collection of triangles (point or edge triples)
    4. record triangle adjacencies (edge-triangle triples)
      • can also be implicit
  • Optimize by iterating with a local rule to select more equi– angular triangles
    1. select shorter of two intersecting quadrilateral diagonals
    2. reduce the minimal distance to a triangle vertex
    3. select triangle with minimum altitude
    4. select triangle with closest circumcenter
    5. select triangle with least rate of steepest ascent
  • Disadvantages
    1. nonuniqueness
    2. elongated triangles
    3. need for several iterations
    4. preprocessing requirements

Copyright © 1998 by Hanan Samet

(^1) tg b EXAMPLE POLYGON TRIANGULATIONS They work for arbitrary point sets as well

B C

A

D

(0.0,0.0) E (8.0,0.0)

(7.15,3.1)

(1.4,4.5) (3.8,4.9)

7.99 6.

Copyright © 1998 by Hanan Samet

(^1) tg b EXAMPLE POLYGON TRIANGULATIONS They work for arbitrary point sets as well

B C

A

D

(0.0,0.0) E (8.0,0.0)

(7.15,3.1)

(1.4,4.5) (3.8,4.9)

7.99 6.

Copyright © 1998 by Hanan Samet

(^2) tg r

Optimal triangulation (MWT)

  • choose triangles so the total length of edges is minimized
  • AC and CE

• takesO (N 3 ) time for a

polygon and much higher for more complex point sets

Copyright © 1998 by Hanan Samet

(^3) tg z

Greedy triangulation

  • exclude an edge if a shorter edge intersects it
  • process edges in order of increasing length
  • choose BD first (it is the shortest) followed by AD because it is the shortest of the remaining nonintersecting edges

• O (N 2 log(N 2 )) =O (N 2 logN ) time as need to sort edges

Copyright © 1998 by Hanan Samet

(^1) tg b EXAMPLE POLYGON TRIANGULATIONS They work for arbitrary point sets as well

B C

A

D

(0.0,0.0) E (8.0,0.0)

(7.15,3.1)

(1.4,4.5) (3.8,4.9)

7.99 6.

Copyright © 1998 by Hanan Samet

(^2) tg r

Optimal triangulation (MWT)

  • choose triangles so the total length of edges is minimized
  • AC and CE

• takesO (N 3 ) time for a

polygon and much higher for more complex point sets

Copyright © 1998 by Hanan Samet

(^3) tg z

Greedy triangulation

  • exclude an edge if a shorter edge intersects it
  • process edges in order of increasing length
  • choose BD first (it is the shortest) followed by AD because it is the shortest of the remaining nonintersecting edges

• O (N 2 log(N 2 )) =O (N 2 logN ) time as need to sort edges

Copyright © 1998 by Hanan Samet

(^4) tg g

Delaunay triangulation

  • no point lies inside the circumcircle of any other triangle
  • choose edges AC and AD because only triangles ABC, ACD, and ADE have empty circumcircles

• O (N logN ) time

Copyright © 1998 by Hanan Samet

tg

USE OF TRIANGULATIONS IN ELEVATION MODELS

  • Assume that elevations of a subset of points in the plane are known
  • Use interpolation on triangle faces to determine the elevation of a point that is not a triangle vertex

Ex: given pointq = (qx,qy), determineqz

1. locate trianglet (t 1 ,t 2 ,t 3 ) containingq

  • Kirkpatrick’s K-structure
  • Edelsbrunner, Guibas, and Stolfi’s layered dag
  • store triangulation in a PMR quadtree

a. locatee —the nearest edge toq

b. starting ate, walk aroundq to extract the

enclosing triangle

2.q =a 1 ·t 1 +a 2 ·t 2 +a 3 ·t 3

• a 1 +a 2 +a 3 = 1 anda 1 ,a 2 ,a 3 are non-negative

• uniquea 1 +a 2 +a 3 = 1 anda 1 ,a 2 ,a 3 are known as

vertex (orbarycentric) coordinates

• we knowqx andqy

a. qx =a 1 ·t 1 x +a 2 ·t 2 x +a 3 ·t 3 x

b. qy =a 1 ·t 1 y +a 2 ·t 2 y +a 3 ·t 3 y

3. solve forai and substitute intoqz =a 1 ·t 1 z +a 2 ·t 2 z +a 3 ·t 3 z

Copyright © 1998 by Hanan Samet

tg

AMBIGUITY IN CHOOSING TRIANGULATIONS

  • Problems in using triangulations for modeling surfaces
    1. any four non-coplanar measurements can be viewed as vertices of a tetrahedron in three-dimensional space
    2. projection of the tetrahedron in two-dimensional space yields a nonplanar triangulation
      • only retain one of the diagonals of the quadrilateral
      • the retained diagonal determines whether the surface is convex or concave

C

C

D

D

B

B

A

A

C

C

D

D

B

B

A

A

Copyright © 1998 by Hanan Samet

tg

MINIMUM WEIGHT POLYGON TRIANGULATION ALGORITHM

• For each ofO (N 2 ) possible edges, assume it is in the

MWT triangulation and determine the two vertices out of

O (N ) which form the two triangles of the MWT in which

the edge participates

  • Algorithm:

1. given polygonQ with verticesP 1 P 2 …PN P 1 in order

aboutQ

2. letEj denote an edge fromPi toPj

3. letTij be the MWT of the polygon with verticesPi Pi+

…Pj Pi and letWij be its total edge length

• if edgeEij is not a legal edge of a triangulation ofQ

(i.e., some part of it lies outsideQ ), thenTij is

undefined andWij = ∞

• if edgeEij is a legal edge, then there exists a vertex

Pk inTij such thatPi Pj Pk form a triangle

a. Pk is found by solving min{Wik +Wkj | i <k <j },

AND

b. Wij =Wik +Wkj + length (Pij)

5. compute allTij and allWij inO (N 3 ) time using dynamic

programming

6. MWT ofQ isT 1 N

Copyright © 1998 by Hanan Samet

tg

GREEDY TRIANGULATION

  • Construct by adding the edges in increasing order of length, excluding a new edge if it intersects an existing edge

• TakesO(N 2 log(N 2 )) =O(N 2 logN ) time since have to

first sort the edges according to length, and there are

O (N 2 ) possible edges

• Checking if an edge intersects an existing set of at mostN

edges (because there are onlyO(N) edges in a

triangulation)

• can be done inO(logN ) time

  • Not unique if two properly intersecting edges have the same length
  • Not used much since not even a good approximation to the optimal triangulation (MWT)
    1. edges are chosen to optimize a sequential condition
    2. choice of edges is somewhat local (i.e., do they intersect some previously selected edge?, which must be smaller by nature of the ordering)
    3. in contrast, optimal triangulation (MWT) is optimized on a global condition

Copyright © 1998 by Hanan Samet

tg

DELA UNA Y TRIA NGULA TION (DT)

Circle Property: no data point lies inside the circumcircle of any other triangle

  • Unique as long as no local configuration of four or more points is cocircular
  • Maximizes the minimum interior vertex angle
    1. biased against large circumcircles
    2. biased against “thin” triangles
  • Effectively chooses edges connecting nearest natural neighbors
    1. i.e., data points at the vertices are closer to their mutual circumcenter than is any other data point
    2. a form of local optimization
  • Triangles are as close as possible to being equiangular

Def: V oronoi diagram (also a Thiessen or Dirichlet tessellation)

  • partition of the plane into regions so that each point in a

region is closer to its region’ssite (a vertex of the

Delaunay triangulation) than to any other site

  • geometric dual of DT w ith the circumcenters as its vertices

1 b

Copyright © 1998 by Hanan Samet

tg

Delaunay triangles

2 r

Copyright © 1998 by Hanan Samet

tg

DELA UNA Y TRIA NGULA TION (DT)

Circle Property: no data point lies inside the circumcircle of any other triangle

  • Unique as long as no local configuration of four or more points is cocircular
  • Maximizes the minimum interior vertex angle
    1. biased against large circumcircles
    2. biased against “thin” triangles
  • Effectively chooses edges connecting nearest natural neighbors
    1. i.e., data points at the vertices are closer to their mutual circumcenter than is any other data point
    2. a form of local optimization
  • Triangles are as close as possible to being equiangular

Def: V oronoi diagram (also a Thiessen or Dirichlet tessellation)

  • partition of the plane into regions so that each point in a

region is closer to its region’ssite (a vertex of the

Delaunay triangulation) than to any other site

  • geometric dual of DT w ith the circumcenters as its vertices

1 b

Copyright © 1998 by Hanan Samet

tg

Delaunay triangles

2 r

Copyright © 1998 by Hanan Samet

tg

circumcircles

3 z

Copyright © 1998 by Hanan Samet