computational geometry
play

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


  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 1 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 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. 17 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 1

  2. Proof of non-intersection v m e k e j Q v i 18 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 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. 19 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 2

  3. Non-uniform triangular mesh 20 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 Problem definition • Input: square circuit board with polygonal components, vertices on grid of size U * U , U =2 m . • 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. 21 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 3

  4. QuadTrees of point sets • One of the first spatial data structures suitable for high dimensions. • Idea: subdivide space into 2 d ‘quadrants’ recursively until every square contains at most one point. • Tree structure with 2 d sons per internal node. • Easy to search because node area is simple. 22 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 QuadTree Example root NW SE NE SW 23 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 4

  5. Range queries with QuadTrees root NE NW SW SE 24 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 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 /2 i . � Length of diagonal at this depth is sqrt(2) s /2 i . � For any internal node of depth i : sqrt(2) s /2 i ≥ c . � Therefore: i ≤ log(sqrt(2) s / c ) = log( s / c )+1/2. � Depth of leaves adds one more to bound. 25 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 5

  6. 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. 26 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 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. 27 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 6

  7. 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. 28 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 Well shaped conforming subdivision 29 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 7

  8. 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. 30 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 Ray Tracing example 31 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 8

  9. 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. 32 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 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. 33 Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005 9

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend