Computational Geometry Exercise session #5: Quadtrees Proof of - - PDF document

computational geometry
SMART_READER_LITE
LIVE PREVIEW

Computational Geometry Exercise session #5: Quadtrees Proof of - - PDF document

Computational Geometry Exercise session #5: Quadtrees Proof of correctness for monotone partitioning Quadtrees Mesh generation for VSLI circuits QuadTrees Octrees and applications Homework 3 handed 1 Yaron


slide-1
SLIDE 1

1

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

1

Computational Geometry

Exercise session #5: Quadtrees

  • Proof of correctness for monotone partitioning
  • Quadtrees

Mesh generation for VSLI circuits QuadTrees Octrees and applications

  • Homework 3 handed

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

17

Monotone partitioning proof

  • Lemma 1: a polygon is y-monotone if it has no

split or merge vertices (proven in lecture).

  • Lemma 2: algorithm MakeMonotone adds a

set of non-intersecting diagonals and partitions P into monotone subpolygons.

  • Proof: The pieces obtained from P have no

split or merge vertices, so by lemma 1 they are y-monotone.

slide-2
SLIDE 2

2

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

18

Proof of non-intersection

vi vm ej ek Q

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

19

VLSI circuit analysis

  • VLSI circuit heat emission analysis.
  • Analysis of physical processes typically done

using finite element methods.

  • Computation according to current element and

its neighbors.

  • Tradeoff between accuracy and time controlled

by number of elements.

  • Improvement: non-uniform mesh – small

elements only where detail is needed.

slide-3
SLIDE 3

3

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

20

Non-uniform triangular mesh

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

21

Problem definition

  • Input: square circuit board with polygonal

components, vertices on grid of size U*U, U=2m.

  • Only four orientations for edges: 0, 45, 90, or 135

degrees with x axis.

  • Output: a subdivision into triangles:

Conforming – vertices do not intersect interiors of edges. Respecting input – component edges contained in mesh triangle edges. Well shaped – triangle angles between 45 to 90 degrees. Non-uniform – mesh should be fine near component edges.

slide-4
SLIDE 4

4

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

22

QuadTrees of point sets

  • One of the first spatial data structures suitable

for high dimensions.

  • Idea: subdivide space into 2d ‘quadrants’

recursively until every square contains at most

  • ne point.
  • Tree structure with 2d sons per internal node.
  • Easy to search because node area is simple.

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

23

QuadTree Example

NE NW SW SE root

slide-5
SLIDE 5

5

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

24

Range queries with QuadTrees

NE NW SW SE root

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

25

QuadTree depth

  • Lemma: The depth of a quadtree for a set P of points

in the plane is at most log(s/c)+3/2, where c is the smallest distance between any two points in P and s is the side length of the initial square containing P.

  • Proof:

length of side at depth i is s/2i. Length of diagonal at this depth is sqrt(2)s/2i. For any internal node of depth i: sqrt(2)s/2i ≥ c. Therefore: i ≤ log(sqrt(2)s/c) = log(s/c)+1/2. Depth of leaves adds one more to bound.

slide-6
SLIDE 6

6

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

26

QuadTree complexity

  • Theorem: A quadtree of depth d storing a set of n

points has O((d+1)n) nodes and can be constructed in O((d+1)n) time.

  • Proof:

Total number of leaves is one plus three times number of internal nodes suffice to bound number of internal nodes. Each internal nodes contains at least two points. Squares of internal node of same depth are disjoint. Number of nodes in same depth is at most n. Construction time: linear in points of every depth.

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

27

Polygon QuadTrees

  • Instead of points, the data is polygonal objects.
  • New recursion stopping criteria: stop when a

node contains at most one ‘feature’.

  • Treat interior of polygon as empty.
  • Leaves contain either: empty space, interior of

polygon, or an edge dividing interior/exterior.

  • Similar complexity bounds of tree, maximum

depth determined by length of shortest edge.

slide-7
SLIDE 7

7

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

28

From QuadTrees to Meshes

  • Circuit layout is polygonal.
  • Use quadtree subdivision to obtain required

mesh.

  • Respecting input: stop recursion when square

does not intersect any edge or has unit size.

  • Output is non-uniform but it is not conforming.
  • Conformity: need to balance quadtree – make

every neighboring squares differ by at most a factor of two.

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

29

Well shaped conforming subdivision

slide-8
SLIDE 8

8

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

30

Octrees in Ray Tracing

  • Ray Tracing – popular technique in computer

graphics for generating photorealistic images.

  • Ray shot from viewpoint to find which object it

hit first.

  • Ray reflected from object to find the next object

hit.

  • Octrees – the 3D versions of Quadtrees with

eight children per node.

  • Octrees guide the search for intersected objects.

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

31

Ray Tracing example

slide-9
SLIDE 9

9

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

32

Neighbor finding in QuadTrees

  • Given a tree node, find a neighbor of this node

in a given direction.

  • Neighbor should be at same depth.
  • If not possible, find deepest neighbor.
  • Algorithm for north neighbor:

If node is SW or SE child of parent, return appropriate brother. Else, recursively find north neighbor of parent. If leaf, return. Otherwise return appropriate child.

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

33

Variants of QuadTrees

  • Non-uniform division centered at a point rather

than the center of symmetry.

Points stored at internal tree nodes. Idea further improved by KD-trees.

  • Bucket QuadTrees

Recursion stops when number of points is at most the bucket size. Useful when memory is not sufficient to hold all data. Store tree structure alone, buckets are read in pages.